1#ifndef G_COMPONENT_TCAD_3D_H
2#define G_COMPONENT_TCAD_3D_H
20 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
21 double& ey,
double& ez,
double& v,
Medium*& m,
22 int& status)
override;
23 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
24 double& ey,
double& ez,
Medium*& m,
int& status)
override;
26 Medium*
GetMedium(
const double x,
const double y,
const double z)
override;
29 double& xmax,
double& ymax,
double& zmax)
override;
31 double& xmax,
double& ymax,
double& zmax)
override;
42 bool GetElement(
const size_t i,
double& vol,
double& dmin,
double& dmax,
43 int& type, std::vector<size_t>& nodes,
int& reg)
const;
46 bool GetNode(
const size_t i,
double& x,
double& y,
double& z,
double& v,
47 double& ex,
double& ey,
double& ez)
const;
52 std::unique_ptr<TetrahedralTree> m_tree;
54 void Reset()
override {
59 size_t FindElement(
const double x,
const double y,
const double z,
60 std::array<double, nMaxVertices>& w)
const;
61 bool InElement(
const double x,
const double y,
const double z,
63 std::array<double, nMaxVertices>& w)
const {
64 if (x < element.bbMin[0] || x > element.bbMax[0] ||
65 y < element.bbMin[1] || y > element.bbMax[1] ||
66 z < element.bbMin[2] || z > element.bbMax[2]) {
70 switch (element.type) {
72 if (InTriangle(x, y, z, element, w)) inside =
true;
75 if (InTetrahedron(x, y, z, element, w)) inside =
true;
79 <<
" Invalid element type (" << element.type <<
").\n";
84 bool InTetrahedron(
const double x,
const double y,
const double z,
86 std::array<double, nMaxVertices>& w)
const;
87 bool InTriangle(
const double x,
const double y,
const double z,
89 std::array<double, nMaxVertices>& w)
const;
91 bool Interpolate(
const double x,
const double y,
const double z,
92 const std::vector<double>& field,
double& f)
override;
93 bool Interpolate(
const double x,
const double y,
const double z,
94 const std::vector<std::array<double, 3> >& field,
95 double& fx,
double& fy,
double& fz)
override;
96 void FillTree()
override;
Interpolation in a three-dimensional field map created by Sentaurus Device.
bool GetElementaryCell(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the coordinates of the elementary cell.
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) override
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
bool GetNode(const size_t i, double &x, double &y, double &z, double &v, double &ex, double &ey, double &ez) const
bool GetElement(const size_t i, double &vol, double &dmin, double &dmax, int &type, std::vector< size_t > &nodes, int ®) const
~ComponentTcad3d()
Destructor.
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
Medium * GetMedium(const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
ComponentTcad3d()
Constructor.
Interpolation in a field map created by Sentaurus Device.
std::string m_className
Class name.
bool m_ready
Ready for use?
Abstract base class for media.