Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ComponentTcad2d Class Reference

Interpolation in a two-dimensional field map created by Sentaurus Device. More...

#include <ComponentTcad2d.hh>

+ Inheritance diagram for Garfield::ComponentTcad2d:

Public Member Functions

 ComponentTcad2d ()
 Constructor.
 
 ~ComponentTcad2d ()
 Destructor.
 
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).
 
void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
 
MediumGetMedium (const double x, const double y, const double z) override
 Get the medium at a given location (x, y, z).
 
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
 Get the bounding box coordinates.
 
bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
 Get the coordinates of the elementary cell.
 
void SetRangeZ (const double zmin, const double zmax)
 Set the z-extent of the bounding box (default: unlimited).
 
bool GetElement (const size_t i, double &vol, double &dmin, double &dmax, int &type, std::vector< size_t > &nodes, int &reg) const
 
bool GetNode (const size_t i, double &x, double &y, double &v, double &ex, double &ey) const
 
- Public Member Functions inherited from Garfield::ComponentTcadBase< 2 >
 ComponentTcadBase ()=delete
 Default constructor.
 
 ComponentTcadBase (const std::string &name)
 Constructor.
 
virtual ~ComponentTcadBase ()
 Destructor.
 
void WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
 
double WeightingPotential (const double x, const double y, const double z, const std::string &label) override
 
bool GetVoltageRange (double &vmin, double &vmax) override
 Calculate the voltage range [V].
 
bool Initialise (const std::string &gridfilename, const std::string &datafilename)
 
bool SetWeightingField (const std::string &datfile1, const std::string &datfile2, const double dv, const std::string &label)
 
bool SetWeightingFieldShift (const std::string &label, const double x, const double y, const double z)
 
void PrintRegions () const
 List all currently defined regions.
 
size_t GetNumberOfRegions () const
 Get the number of regions in the device.
 
void GetRegion (const size_t ireg, std::string &name, bool &active) const
 Get the name and "active volume" flag of a region.
 
void SetDriftRegion (const size_t ireg)
 Make a region active ("driftable").
 
void UnsetDriftRegion (const size_t ireg)
 Make a region inactive.
 
void SetMedium (const size_t ireg, Medium *m)
 Set the medium to be associated to a given region.
 
size_t GetNumberOfElements () const
 Get the number of elements in the mesh.
 
size_t GetNumberOfNodes () const
 Get the number of vertices in the mesh.
 
void EnableVelocityMap (const bool on)
 Switch use of the imported velocity map on/off.
 
bool HasVelocityMap () const override
 Does the component have velocity maps?
 
bool ElectronVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
 Get the electron drift velocity.
 
bool HoleVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
 Get the hole drift velocity.
 
size_t GetNumberOfDonors ()
 Get the number of donor states found in the map.
 
size_t GetNumberOfAcceptors ()
 Get the number of acceptor states found in the map.
 
bool SetDonor (const size_t donorNumber, const double exsec, const double hxsec, const double concentration)
 
bool SetAcceptor (const size_t acceptorNumber, const double exsec, const double hxsec, const double concentration)
 Set the properties of an acceptor-type defect state.
 
void EnableAttachmentMap (const bool on)
 Switch use of the imported trapping map on/off.
 
bool HasAttachmentMap () const override
 Does the component have attachment maps?
 
bool ElectronAttachment (const double x, const double y, const double z, double &eta) override
 Get the electron attachment coefficient.
 
bool HoleAttachment (const double x, const double y, const double z, double &eta) override
 Get the hole attachment coefficient.
 
bool GetElectronLifetime (const double x, const double y, const double z, double &etau) override
 
bool GetHoleLifetime (const double x, const double y, const double z, double &htau) override
 
bool GetElectronMobility (const double x, const double y, const double z, double &mob)
 
bool GetHoleMobility (const double x, const double y, const double z, double &mob)
 
- Public Member Functions inherited from Garfield::Component
 Component ()=delete
 Default constructor.
 
 Component (const std::string &name)
 Constructor.
 
virtual ~Component ()
 Destructor.
 
virtual void SetGeometry (Geometry *geo)
 Define the geometry.
 
virtual void Clear ()
 Reset.
 
virtual MediumGetMedium (const double x, const double y, const double z)
 Get the medium at a given location (x, y, z).
 
virtual void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0
 
virtual void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status)=0
 Calculate the drift field [V/cm] and potential [V] at (x, y, z).
 
virtual bool GetVoltageRange (double &vmin, double &vmax)=0
 Calculate the voltage range [V].
 
virtual void WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
 
virtual double WeightingPotential (const double x, const double y, const double z, const std::string &label)
 
virtual void DelayedWeightingField (const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label)
 
virtual double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label)
 
virtual void MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status)
 
void SetMagneticField (const double bx, const double by, const double bz)
 Set a constant magnetic field.
 
virtual bool IsReady ()
 Ready for use?
 
virtual bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
 Get the bounding box coordinates.
 
virtual bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
 Get the coordinates of the elementary cell.
 
double IntegrateFluxCircle (const double xc, const double yc, const double r, const unsigned int nI=50)
 
double IntegrateFluxSphere (const double xc, const double yc, const double zc, const double r, const unsigned int nI=20)
 
double IntegrateFluxParallelogram (const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20)
 
double IntegrateWeightingFluxParallelogram (const std::string &label, const double x0, const double y0, const double z0, const double dx1, const double dy1, const double dz1, const double dx2, const double dy2, const double dz2, const unsigned int nU=20, const unsigned int nV=20)
 
double IntegrateFluxLine (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const double xp, const double yp, const double zp, const unsigned int nI, const int isign=0)
 
virtual bool IsWireCrossed (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc, const bool centre, double &rc)
 
virtual bool IsInTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yw, double &rw)
 
void EnablePeriodicityX (const bool on=true)
 Enable simple periodicity in the $x$ direction.
 
void EnablePeriodicityY (const bool on=true)
 Enable simple periodicity in the $y$ direction.
 
void EnablePeriodicityZ (const bool on=true)
 Enable simple periodicity in the $z$ direction.
 
void IsPeriodic (bool &perx, bool &pery, bool &perz)
 Return periodicity flags.
 
void EnableMirrorPeriodicityX (const bool on=true)
 Enable mirror periodicity in the $x$ direction.
 
void EnableMirrorPeriodicityY (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
 
void EnableMirrorPeriodicityZ (const bool on=true)
 Enable mirror periodicity in the $y$ direction.
 
void IsMirrorPeriodic (bool &perx, bool &pery, bool &perz)
 Return mirror periodicity flags.
 
void EnableAxialPeriodicityX (const bool on=true)
 Enable axial periodicity in the $x$ direction.
 
void EnableAxialPeriodicityY (const bool on=true)
 Enable axial periodicity in the $y$ direction.
 
void EnableAxialPeriodicityZ (const bool on=true)
 Enable axial periodicity in the $z$ direction.
 
void IsAxiallyPeriodic (bool &perx, bool &pery, bool &perz)
 Return axial periodicity flags.
 
void EnableRotationSymmetryX (const bool on=true)
 Enable rotation symmetry around the $x$ axis.
 
void EnableRotationSymmetryY (const bool on=true)
 Enable rotation symmetry around the $y$ axis.
 
void EnableRotationSymmetryZ (const bool on=true)
 Enable rotation symmetry around the $z$ axis.
 
void IsRotationSymmetric (bool &rotx, bool &roty, bool &rotz)
 Return rotation symmetry flags.
 
void EnableDebugging ()
 Switch on debugging messages.
 
void DisableDebugging ()
 Switch off debugging messages.
 
virtual bool HasAttachmentMap () const
 Does the component have attachment maps?
 
virtual bool HasVelocityMap () const
 Does the component have velocity maps?
 
virtual bool ElectronAttachment (const double, const double, const double, double &eta)
 Get the electron attachment coefficient.
 
virtual bool HoleAttachment (const double, const double, const double, double &eta)
 Get the hole attachment coefficient.
 
virtual bool ElectronVelocity (const double, const double, const double, double &vx, double &vy, double &vz)
 Get the electron drift velocity.
 
virtual bool HoleVelocity (const double, const double, const double, double &vx, double &vy, double &vz)
 Get the hole drift velocity.
 
virtual bool GetElectronLifetime (const double, const double, const double, double &etau)
 
virtual bool GetHoleLifetime (const double, const double, const double, double &htau)
 

Additional Inherited Members

- Protected Member Functions inherited from Garfield::ComponentTcadBase< 2 >
void UpdatePeriodicity () override
 Verify periodicities.
 
void Cleanup ()
 
virtual bool Interpolate (const double x, const double y, const double z, const std::vector< double > &field, double &f)=0
 
virtual bool Interpolate (const double x, const double y, const double z, const std::vector< std::array< double, N > > &field, double &fx, double &fy, double &fz)=0
 
virtual void FillTree ()=0
 
size_t FindRegion (const std::string &name) const
 
void MapCoordinates (std::array< double, N > &x, std::array< bool, N > &mirr) const
 
bool InBoundingBox (const std::array< double, N > &x) const
 
void UpdateAttachment ()
 
bool LoadGrid (const std::string &gridfilename)
 
bool LoadData (const std::string &datafilename)
 
bool ReadDataset (std::ifstream &datafile, const std::string &dataset)
 
bool LoadWeightingField (const std::string &datafilename, std::vector< std::array< double, N > > &wf, std::vector< double > &wp)
 
virtual void Reset ()=0
 Reset the component.
 
virtual void UpdatePeriodicity ()=0
 Verify periodicities.
 
- Static Protected Member Functions inherited from Garfield::ComponentTcadBase< 2 >
static unsigned int ElementVertices (const Element &element)
 
- Protected Attributes inherited from Garfield::ComponentTcadBase< 2 >
std::vector< Region > m_regions
 
std::vector< std::array< double, N > > m_vertices
 
std::vector< Elementm_elements
 
std::vector< double > m_epot
 
std::vector< std::array< double, N > > m_efield
 
std::vector< std::array< double, N > > m_wfield
 
std::vector< double > m_wpot
 
std::vector< std::string > m_wlabel
 
std::vector< std::array< double, 3 > > m_wshift
 
std::vector< std::array< double, N > > m_eVelocity
 
std::vector< std::array< double, N > > m_hVelocity
 
std::vector< double > m_eMobility
 
std::vector< double > m_hMobility
 
std::vector< double > m_eLifetime
 
std::vector< double > m_hLifetime
 
std::vector< std::vector< float > > m_donorOcc
 
std::vector< std::vector< float > > m_acceptorOcc
 
std::vector< double > m_eAttachment
 
std::vector< double > m_hAttachment
 
std::vector< Defect > m_donors
 
std::vector< Defect > m_acceptors
 
bool m_useVelocityMap
 
bool m_useAttachmentMap
 
std::array< double, 3 > m_bbMin
 
std::array< double, 3 > m_bbMax
 
double m_pMin
 
double m_pMax
 
- Protected Attributes inherited from Garfield::Component
std::string m_className = "Component"
 Class name.
 
Geometrym_geometry = nullptr
 Pointer to the geometry.
 
std::array< double, 3 > m_b0 = {{0., 0., 0.}}
 Constant magnetic field.
 
bool m_ready = false
 Ready for use?
 
bool m_debug = false
 Switch on/off debugging messages.
 
std::array< bool, 3 > m_periodic = {{false, false, false}}
 Simple periodicity in x, y, z.
 
std::array< bool, 3 > m_mirrorPeriodic = {{false, false, false}}
 Mirror periodicity in x, y, z.
 
std::array< bool, 3 > m_axiallyPeriodic = {{false, false, false}}
 Axial periodicity in x, y, z.
 
std::array< bool, 3 > m_rotationSymmetric = {{false, false, false}}
 Rotation symmetry around x-axis, y-axis, z-axis.
 
- Static Protected Attributes inherited from Garfield::ComponentTcadBase< 2 >
static constexpr size_t nMaxVertices
 

Detailed Description

Interpolation in a two-dimensional field map created by Sentaurus Device.

Definition at line 13 of file ComponentTcad2d.hh.

Constructor & Destructor Documentation

◆ ComponentTcad2d()

Garfield::ComponentTcad2d::ComponentTcad2d ( )

Constructor.

Definition at line 11 of file ComponentTcad2d.cc.

11: ComponentTcadBase("Tcad2d") {}
ComponentTcadBase()=delete
Default constructor.

◆ ~ComponentTcad2d()

Garfield::ComponentTcad2d::~ComponentTcad2d ( )
inline

Destructor.

Definition at line 18 of file ComponentTcad2d.hh.

18{}

Member Function Documentation

◆ ElectricField() [1/2]

void Garfield::ComponentTcad2d::ElectricField ( const double  x,
const double  y,
const double  z,
double &  ex,
double &  ey,
double &  ez,
double &  v,
Medium *&  m,
int &  status 
)
overridevirtual

Calculate the drift field [V/cm] and potential [V] at (x, y, z).

Implements Garfield::Component.

Definition at line 13 of file ComponentTcad2d.cc.

16 {
17 // Assume this will work.
18 status = 0;
19 // Initialise.
20 ex = ey = ez = p = 0.;
21 m = nullptr;
22
23 // Make sure the field map has been loaded.
24 if (!m_ready) {
25 std::cerr << m_className << "::ElectricField:\n"
26 << " Field map is not available for interpolation.\n";
27 status = -10;
28 return;
29 }
30
31 if (m_hasRangeZ && (zin < m_bbMin[2] || zin > m_bbMax[2])) {
32 status = -6;
33 return;
34 }
35 // In case of periodicity, reduce to the cell volume.
36 std::array<double, 2> x = {xin, yin};
37 std::array<bool, 2> mirr = {false, false};
38 MapCoordinates(x, mirr);
39 // Check if the point is inside the bounding box.
40 if (!InBoundingBox(x)) {
41 status = -6;
42 return;
43 }
44
45 std::array<double, nMaxVertices> w;
46 const auto i = FindElement(x[0], x[1], w);
47 if (i >= m_elements.size()) {
48 // Point is outside the mesh.
49 status = -6;
50 return;
51 }
52
53 const Element& element = m_elements[i];
54 const size_t nVertices = ElementVertices(element);
55 for (size_t j = 0; j < nVertices; ++j) {
56 const size_t index = element.vertex[j];
57 ex += w[j] * m_efield[index][0];
58 ey += w[j] * m_efield[index][1];
59 p += w[j] * m_epot[index];
60 }
61 if (mirr[0]) ex = -ex;
62 if (mirr[1]) ey = -ey;
63 m = m_regions[element.region].medium;
64 if (!m_regions[element.region].drift || !m) status = -5;
65}
bool InBoundingBox(const std::array< double, N > &x) const
static unsigned int ElementVertices(const Element &element)
std::vector< std::array< double, N > > m_efield
void MapCoordinates(std::array< double, N > &x, std::array< bool, N > &mirr) const
std::string m_className
Class name.
Definition: Component.hh:329
bool m_ready
Ready for use?
Definition: Component.hh:338
Definition: neBEM.h:155

Referenced by ElectricField().

◆ ElectricField() [2/2]

void Garfield::ComponentTcad2d::ElectricField ( const double  x,
const double  y,
const double  z,
double &  ex,
double &  ey,
double &  ez,
Medium *&  m,
int &  status 
)
inlineoverridevirtual

Calculate the drift field at given point.

Parameters
x,y,zcoordinates [cm].
ex,ey,ezcomponents of the electric field [V/cm].
mpointer to the medium at this location.
statusstatus flag

Status flags:

        0: Inside an active medium
      > 0: Inside a wire of type X
-4 ... -1: On the side of a plane where no wires are
       -5: Inside the mesh but not in an active medium
       -6: Outside the mesh
      -10: Unknown potential type (should not occur)
    other: Other cases (should not occur)

Implements Garfield::Component.

Definition at line 24 of file ComponentTcad2d.hh.

25 {
26 double v = 0.;
27 ElectricField(x, y, z, ex, ey, ez, v, m, status);
28 }
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).

◆ GetBoundingBox()

bool Garfield::ComponentTcad2d::GetBoundingBox ( double &  xmin,
double &  ymin,
double &  zmin,
double &  xmax,
double &  ymax,
double &  zmax 
)
overridevirtual

Get the bounding box coordinates.

Reimplemented from Garfield::Component.

Definition at line 174 of file ComponentTcad2d.cc.

175 {
176 if (!m_ready) return false;
177 if (m_periodic[0] || m_mirrorPeriodic[0]) {
178 xmin = -std::numeric_limits<double>::infinity();
179 xmax = +std::numeric_limits<double>::infinity();
180 } else {
181 xmin = m_bbMin[0];
182 xmax = m_bbMax[0];
183 }
184
185 if (m_periodic[1] || m_mirrorPeriodic[1]) {
186 ymin = -std::numeric_limits<double>::infinity();
187 ymax = +std::numeric_limits<double>::infinity();
188 } else {
189 ymin = m_bbMin[1];
190 ymax = m_bbMax[1];
191 }
192
193 if (m_hasRangeZ) {
194 zmin = m_bbMin[2];
195 zmax = m_bbMax[2];
196 }
197 return true;
198}
std::array< bool, 3 > m_mirrorPeriodic
Mirror periodicity in x, y, z.
Definition: Component.hh:346
std::array< bool, 3 > m_periodic
Simple periodicity in x, y, z.
Definition: Component.hh:344

◆ GetElement()

bool Garfield::ComponentTcad2d::GetElement ( const size_t  i,
double &  vol,
double &  dmin,
double &  dmax,
int &  type,
std::vector< size_t > &  nodes,
int &  reg 
) const

Retrieve the properties of an element.

Parameters
iindex of the element
volvolume
dminsmallest length in the element
dmaxlargest length in the element
typeelement type
nodesindices of the constituent vertices
regregion

Definition at line 230 of file ComponentTcad2d.cc.

232 {
233 nodes.clear();
234 if (i >= m_elements.size()) {
235 std::cerr << m_className << "::GetElement: Index out of range.\n";
236 return false;
237 }
238
239 const Element& element = m_elements[i];
240 if (element.type == 0) {
241 dmin = dmax = vol = 0;
242 } else if (element.type == 1) {
243 const auto& v0 = m_vertices[element.vertex[0]];
244 const auto& v1 = m_vertices[element.vertex[1]];
245 const double d = std::hypot(v1[0] - v0[0], v1[1] - v0[1]);
246 dmin = dmax = vol = d;
247 } else if (m_elements[i].type == 2) {
248 const auto& v0 = m_vertices[element.vertex[0]];
249 const auto& v1 = m_vertices[element.vertex[1]];
250 const auto& v2 = m_vertices[element.vertex[2]];
251 vol = 0.5 * fabs((v2[0] - v0[0]) * (v1[1] - v0[1]) -
252 (v2[1] - v0[1]) * (v1[0] - v0[0]));
253 const double a = std::hypot(v1[0] - v0[0], v1[1] - v0[1]);
254 const double b = std::hypot(v2[0] - v0[0], v2[1] - v0[1]);
255 const double c = std::hypot(v1[0] - v2[0], v1[1] - v2[1]);
256 dmin = std::min({a, b, c});
257 dmax = std::max({a, b, c});
258 } else if (m_elements[i].type == 3) {
259 const auto& v0 = m_vertices[element.vertex[0]];
260 const auto& v1 = m_vertices[element.vertex[1]];
261 const auto& v3 = m_vertices[element.vertex[3]];
262 const double a = std::hypot(v1[0] - v0[0], v1[1] - v0[1]);
263 const double b = std::hypot(v3[0] - v0[0], v3[1] - v0[1]);
264 vol = a * b;
265 dmin = std::min(a, b);
266 dmax = sqrt(a * a + b * b);
267 } else {
268 std::cerr << m_className << "::GetElement:\n"
269 << " Unexpected element type (" << type << ")\n";
270 return false;
271 }
272 const size_t nVertices = ElementVertices(element);
273 for (size_t j = 0; j < nVertices; ++j) {
274 nodes.push_back(element.vertex[j]);
275 }
276 reg = element.region;
277 return true;
278}
std::vector< std::array< double, N > > m_vertices
DoubleAc fabs(const DoubleAc &f)
Definition: DoubleAc.h:615
DoubleAc sqrt(const DoubleAc &f)
Definition: DoubleAc.cpp:314

◆ GetElementaryCell()

bool Garfield::ComponentTcad2d::GetElementaryCell ( double &  xmin,
double &  ymin,
double &  zmin,
double &  xmax,
double &  ymax,
double &  zmax 
)
overridevirtual

Get the coordinates of the elementary cell.

Reimplemented from Garfield::Component.

Definition at line 200 of file ComponentTcad2d.cc.

202 {
203 if (!m_ready) return false;
204 xmin = m_bbMin[0];
205 xmax = m_bbMax[0];
206 ymin = m_bbMin[1];
207 ymax = m_bbMax[1];
208 if (m_hasRangeZ) {
209 zmin = m_bbMin[2];
210 zmax = m_bbMax[2];
211 } else {
212 const double xymax = std::max({fabs(xmin), fabs(xmax),
213 fabs(ymin), fabs(ymax)});
214 zmin = -xymax;
215 zmax = +xymax;
216 }
217 return true;
218}

◆ GetMedium()

Medium * Garfield::ComponentTcad2d::GetMedium ( const double  x,
const double  y,
const double  z 
)
overridevirtual

Get the medium at a given location (x, y, z).

Reimplemented from Garfield::Component.

Definition at line 125 of file ComponentTcad2d.cc.

126 {
127 // Make sure the field map has been loaded.
128 if (!m_ready) {
129 std::cerr << m_className << "::GetMedium:\n"
130 << " Field map not available for interpolation.\n";
131 return nullptr;
132 }
133
134 if (m_hasRangeZ && (zin < m_bbMin[2] || zin > m_bbMax[2])) return nullptr;
135 std::array<double, 2> x = {xin, yin};
136 std::array<bool, 2> mirr = {false, false};
137 MapCoordinates(x, mirr);
138 // Check if the point is inside the bounding box.
139 if (!InBoundingBox(x)) return nullptr;
140
141 // Determine the shape functions.
142 std::array<double, nMaxVertices> w;
143 const size_t i = FindElement(x[0], x[1], w);
144 if (i >= m_elements.size()) {
145 // Point is outside the mesh.
146 return nullptr;
147 }
148 return m_regions[m_elements[i].region].medium;
149}

◆ GetNode()

bool Garfield::ComponentTcad2d::GetNode ( const size_t  i,
double &  x,
double &  y,
double &  v,
double &  ex,
double &  ey 
) const

Get the coordinates of a mesh node and the potential and electric field at this node.

Definition at line 280 of file ComponentTcad2d.cc.

281 {
282 if (i >= m_vertices.size()) {
283 std::cerr << m_className << "::GetNode: Index out of range.\n";
284 return false;
285 }
286
287 x = m_vertices[i][0];
288 y = m_vertices[i][1];
289 if (!m_epot.empty()) v = m_epot[i];
290 if (!m_efield.empty()) {
291 ex = m_efield[i][0];
292 ey = m_efield[i][1];
293 }
294 return true;
295}

◆ SetRangeZ()

void Garfield::ComponentTcad2d::SetRangeZ ( const double  zmin,
const double  zmax 
)

Set the z-extent of the bounding box (default: unlimited).

Definition at line 220 of file ComponentTcad2d.cc.

220 {
221 if (fabs(zmax - zmin) <= 0.) {
222 std::cerr << m_className << "::SetRangeZ: Zero range is not permitted.\n";
223 return;
224 }
225 m_bbMin[2] = std::min(zmin, zmax);
226 m_bbMax[2] = std::max(zmin, zmax);
227 m_hasRangeZ = true;
228}

The documentation for this class was generated from the following files: