1#ifndef G_COMPONENT_TCAD_3D_H
2#define G_COMPONENT_TCAD_3D_H
18 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
19 double& ey,
double& ez,
double& v,
Medium*& m,
21 void ElectricField(
const double x,
const double y,
const double z,
double& ex,
22 double& ey,
double& ez,
Medium*& m,
int& status);
27 bool GetBoundingBox(
double& xmin,
double& ymin,
double& zmin,
double& xmax,
28 double& ymax,
double& zmax);
31 bool Initialise(
const std::string& gridfilename,
32 const std::string& datafilename);
38 void GetRegion(
const unsigned int ireg, std::string& name,
47 bool GetElement(
const unsigned int i,
double& vol,
double& dmin,
double& dmax,
49 bool GetElement(
const unsigned int i,
double& vol,
double& dmin,
double& dmax,
50 int& type,
int& node1,
int& node2,
int& node3,
int& node4,
51 int& node5,
int& node6,
int& node7,
int& reg)
const;
53 bool GetNode(
const unsigned int i,
double& x,
double& y,
double& z,
double& v,
54 double& ex,
double& ey,
double& ez)
const;
58 static const int nMaxVertices = 7;
68 std::vector<Region> m_regions;
77 std::vector<Vertex> m_vertices;
82 int vertex[nMaxVertices];
98 std::vector<int> neighbours;
104 std::vector<Element> m_elements;
114 double m_pMin, m_pMax;
117 double m_xMinBB, m_yMinBB, m_zMinBB;
118 double m_xMaxBB, m_yMaxBB, m_zMaxBB;
126 void UpdatePeriodicity();
128 bool CheckElement(
const double x,
const double y,
const double z,
129 const Element& element,
double w[nMaxVertices])
const {
132 switch (element.type) {
134 if (CheckTriangle(x, y, z, element, w)) inside =
true;
137 if (CheckTetrahedron(x, y, z, element, w)) inside =
true;
141 <<
" Invalid element type (" << element.type <<
").\n";
146 bool CheckTetrahedron(
const double x,
const double y,
const double z,
147 const Element& element,
double w[nMaxVertices])
const;
148 bool CheckTriangle(
const double x,
const double y,
const double z,
149 const Element& element,
double w[nMaxVertices])
const;
151 void FindNeighbours();
152 bool LoadGrid(
const std::string& gridfilename);
153 bool LoadData(
const std::string& datafilename);
154 bool ReadDataset(std::ifstream& datafile,
const std::string& dataset);
157 void MapCoordinates(
double& x,
double& y,
double& z,
158 bool& xmirr,
bool& ymirr,
bool& zmirr)
const;
159 int FindRegion(
const std::string& name)
const;
Abstract base class for components.
std::string m_className
Class name.
Interpolation in a three-dimensional field map created by Sentaurus Device.
unsigned int GetNumberOfNodes() const
bool Initialise(const std::string &gridfilename, const std::string &datafilename)
void UnsetDriftRegion(const unsigned int ireg)
void GetRegion(const unsigned int ireg, std::string &name, bool &active) const
bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
Get the bounding box coordinates.
bool GetNode(const unsigned int i, double &x, double &y, double &z, double &v, double &ex, double &ey, double &ez) const
int GetNumberOfElements() const
Medium * GetMedium(const double x, const double y, const double z)
Get the medium at a given location (x, y, z).
void SetDriftRegion(const unsigned int ireg)
bool GetVoltageRange(double &vmin, double &vmax)
Calculate the voltage range [V].
unsigned int GetNumberOfRegions() const
void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status)
bool GetElement(const unsigned int i, double &vol, double &dmin, double &dmax, int &type) const
void SetMedium(const unsigned int ireg, Medium *m)
Abstract base class for media.