Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Two-dimensional implementation of the nearly exact Boundary Element Method. More...
#include <ComponentNeBem2d.hh>
Public Member Functions | |
ComponentNeBem2d () | |
Constructor. | |
~ComponentNeBem2d () | |
Destructor. | |
Medium * | GetMedium (const double x, const double y, const double z) override |
Get the medium at a given location (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 |
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 | GetVoltageRange (double &vmin, double &vmax) override |
Calculate the voltage range [V]. | |
bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override |
Get the bounding box coordinates. | |
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) override |
bool | IsInTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yx, double &rw) override |
void | SetMedium (Medium *medium) |
Set the "background" medium. | |
bool | AddSegment (const double x0, const double y0, const double x1, const double y1, const double v, const int ndiv=-1) |
bool | AddWire (const double x, const double y, const double d, const double v, const int ntrap=5) |
bool | AddRegion (const std::vector< double > &xp, const std::vector< double > &yp, Medium *medium, const unsigned int bctype=4, const double v=0., const int ndiv=-1) |
void | SetRangeZ (const double zmin, const double zmax) |
Set the extent of the drift region along z. | |
bool | Initialise () |
Discretise the geometry and compute the solution. | |
void | SetNumberOfDivisions (const unsigned int ndiv) |
Set the default number of elements per segment. | |
void | SetNumberOfCollocationPoints (const unsigned int ncoll) |
void | EnableAutoResizing (const bool on=true) |
void | EnableRandomCollocation (const bool on=true) |
void | SetMaxNumberOfIterations (const unsigned int niter) |
unsigned int | GetNumberOfRegions () const |
Return the number of regions. | |
bool | GetRegion (const unsigned int i, std::vector< double > &xv, std::vector< double > &yv, Medium *&medium, unsigned int &bctype, double &v) |
Return the properties of a given region. | |
unsigned int | GetNumberOfSegments () const |
Return the number of conducting straight-line segments. | |
bool | GetSegment (const unsigned int i, double &x0, double &y0, double &x1, double &x2, double &v) const |
Return the coordinates and voltage of a given straight-line segment. | |
unsigned int | GetNumberOfWires () const |
Return the number of wires. | |
bool | GetWire (const unsigned int i, double &x, double &y, double &d, double &v, double &q) const |
Return the coordinates, diameter, potential and charge of a given wire. | |
unsigned int | GetNumberOfElements () const |
Return the number of boundary elements. | |
bool | GetElement (const unsigned int i, double &x0, double &y0, double &x1, double &y1, double &q) const |
Return the coordinates and charge of a given boundary element. | |
Public Member Functions inherited from Garfield::ComponentBase | |
ComponentBase () | |
Constructor. | |
virtual | ~ComponentBase () |
Destructor. | |
virtual void | SetGeometry (GeometryBase *geo) |
Define the geometry. | |
virtual void | Clear () |
Reset. | |
virtual Medium * | GetMedium (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 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. | |
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 | IntegrateFlux (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) |
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 direction. | |
void | DisablePeriodicityX () |
void | EnablePeriodicityY (const bool on=true) |
Enable simple periodicity in the direction. | |
void | DisablePeriodicityY () |
void | EnablePeriodicityZ (const bool on=true) |
Enable simple periodicity in the direction. | |
void | DisablePeriodicityZ () |
void | EnableMirrorPeriodicityX (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityX () |
void | EnableMirrorPeriodicityY (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityY () |
void | EnableMirrorPeriodicityZ (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | DisableMirrorPeriodicityZ () |
void | EnableAxialPeriodicityX (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityX () |
void | EnableAxialPeriodicityY (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityY () |
void | EnableAxialPeriodicityZ (const bool on=true) |
Enable axial periodicity in the direction. | |
void | DisableAxialPeriodicityZ () |
void | EnableRotationSymmetryX (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryX () |
void | EnableRotationSymmetryY (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryY () |
void | EnableRotationSymmetryZ (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | DisableRotationSymmetryZ () |
void | EnableDebugging () |
Switch on debugging messages. | |
void | DisableDebugging () |
Switch off debugging messages. | |
void | ActivateTraps () |
Request trapping to be taken care of by the component (for TCAD). | |
void | DeactivateTraps () |
bool | IsTrapActive () |
void | ActivateVelocityMap () |
Request velocity to be taken care of by the component (for TCAD). | |
void | DectivateVelocityMap () |
bool | IsVelocityActive () |
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 void | ElectronVelocity (const double, const double, const double, double &vx, double &vy, double &vz, Medium *&, int &status) |
Get the electron drift velocity. | |
virtual void | HoleVelocity (const double, const double, const double, double &vx, double &vy, double &vz, Medium *&, int &status) |
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 | |
virtual void | Reset ()=0 |
Reset the component. | |
virtual void | UpdatePeriodicity ()=0 |
Verify periodicities. | |
Protected Attributes inherited from Garfield::ComponentBase | |
std::string | m_className = "ComponentBase" |
Class name. | |
GeometryBase * | m_geometry = nullptr |
Pointer to the geometry. | |
bool | m_ready = false |
Ready for use? | |
bool | m_activeTraps = false |
Does the component have traps? | |
bool | m_hasVelocityMap = false |
Does the component have velocity maps? | |
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. | |
double | m_bx0 = 0. |
double | m_by0 = 0. |
double | m_bz0 = 0. |
bool | m_debug = false |
Switch on/off debugging messages. | |
Two-dimensional implementation of the nearly exact Boundary Element Method.
Definition at line 10 of file ComponentNeBem2d.hh.
Garfield::ComponentNeBem2d::ComponentNeBem2d | ( | ) |
Constructor.
Definition at line 210 of file ComponentNeBem2d.cc.
|
inline |
bool Garfield::ComponentNeBem2d::AddRegion | ( | const std::vector< double > & | xp, |
const std::vector< double > & | yp, | ||
Medium * | medium, | ||
const unsigned int | bctype = 4 , |
||
const double | v = 0. , |
||
const int | ndiv = -1 |
||
) |
Add a region bounded by a polygon.
xp,yp | x/y-coordinates of the vertices of the polygon. |
medium | pointer to the medium associated to the region. |
bctype | 1: fixed voltage, 4: dielectric-dielectric interface. |
v | applied potential. |
ndiv | number of elements on each edge segment. |
Definition at line 566 of file ComponentNeBem2d.cc.
bool Garfield::ComponentNeBem2d::AddSegment | ( | const double | x0, |
const double | y0, | ||
const double | x1, | ||
const double | y1, | ||
const double | v, | ||
const int | ndiv = -1 |
||
) |
Add a conducting straight-line segment.
x0,y0,x1,y1 | coordinates of start and end point. |
v | applied potential. |
ndiv | number of elements in which to split the segment. |
Definition at line 506 of file ComponentNeBem2d.cc.
bool Garfield::ComponentNeBem2d::AddWire | ( | const double | x, |
const double | y, | ||
const double | d, | ||
const double | v, | ||
const int | ntrap = 5 |
||
) |
Add a wire.
x,y | centre of the wire. |
d | wire diameter. |
v | applied potential. |
ntrap | multiple of the wire radius within which a particle is considered to be trapped by the wire. |
Definition at line 535 of file ComponentNeBem2d.cc.
|
overridevirtual |
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
Implements Garfield::ComponentBase.
Definition at line 214 of file ComponentNeBem2d.cc.
|
overridevirtual |
Calculate the drift field at given point.
x,y,z | coordinates [cm]. |
ex,ey,ez | components of the electric field [V/cm]. |
m | pointer to the medium at this location. |
status | status 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::ComponentBase.
Definition at line 298 of file ComponentNeBem2d.cc.
Referenced by ElectricField().
|
inline |
Definition at line 77 of file ComponentNeBem2d.hh.
|
inline |
Definition at line 78 of file ComponentNeBem2d.hh.
|
overridevirtual |
Get the bounding box coordinates.
Reimplemented from Garfield::ComponentBase.
Definition at line 353 of file ComponentNeBem2d.cc.
bool Garfield::ComponentNeBem2d::GetElement | ( | const unsigned int | i, |
double & | x0, | ||
double & | y0, | ||
double & | x1, | ||
double & | y1, | ||
double & | q | ||
) | const |
Return the coordinates and charge of a given boundary element.
Definition at line 721 of file ComponentNeBem2d.cc.
|
overridevirtual |
Get the medium at a given location (x, y, z).
Reimplemented from Garfield::ComponentBase.
Definition at line 341 of file ComponentNeBem2d.cc.
Referenced by ElectricField().
|
inline |
Return the number of boundary elements.
Definition at line 100 of file ComponentNeBem2d.hh.
|
inline |
Return the number of regions.
Definition at line 84 of file ComponentNeBem2d.hh.
|
inline |
Return the number of conducting straight-line segments.
Definition at line 90 of file ComponentNeBem2d.hh.
|
inline |
Return the number of wires.
Definition at line 95 of file ComponentNeBem2d.hh.
bool Garfield::ComponentNeBem2d::GetRegion | ( | const unsigned int | i, |
std::vector< double > & | xv, | ||
std::vector< double > & | yv, | ||
Medium *& | medium, | ||
unsigned int & | bctype, | ||
double & | v | ||
) |
Return the properties of a given region.
Definition at line 677 of file ComponentNeBem2d.cc.
bool Garfield::ComponentNeBem2d::GetSegment | ( | const unsigned int | i, |
double & | x0, | ||
double & | y0, | ||
double & | x1, | ||
double & | x2, | ||
double & | v | ||
) | const |
Return the coordinates and voltage of a given straight-line segment.
Definition at line 695 of file ComponentNeBem2d.cc.
|
overridevirtual |
Calculate the voltage range [V].
Implements Garfield::ComponentBase.
Definition at line 305 of file ComponentNeBem2d.cc.
Referenced by Initialise().
bool Garfield::ComponentNeBem2d::GetWire | ( | const unsigned int | i, |
double & | x, | ||
double & | y, | ||
double & | d, | ||
double & | v, | ||
double & | q | ||
) | const |
Return the coordinates, diameter, potential and charge of a given wire.
Definition at line 708 of file ComponentNeBem2d.cc.
bool Garfield::ComponentNeBem2d::Initialise | ( | ) |
Discretise the geometry and compute the solution.
Definition at line 736 of file ComponentNeBem2d.cc.
Referenced by ElectricField(), and GetRegion().
|
overridevirtual |
Determine whether a particle is inside the trap radius of a wire.
q0 | charge of the particle [in elementary charges]. |
x0,y0,z0 | position [cm] of the particle. |
xw,yw | coordinates of the wire (if applicable). |
rw | radius of the wire (if applicable). |
Reimplemented from Garfield::ComponentBase.
Definition at line 475 of file ComponentNeBem2d.cc.
|
overridevirtual |
Determine whether the line between two points crosses a wire.
x0,y0,z0 | first point [cm]. |
x1,y1,z1 | second point [cm] |
xc,yc,zc | point [cm] where the line crosses the wire or the coordinates of the wire centre. |
centre | flag whether to return the coordinates of the line-wire crossing point or of the wire centre. |
rc | radius [cm] of the wire. |
Reimplemented from Garfield::ComponentBase.
Definition at line 407 of file ComponentNeBem2d.cc.
void Garfield::ComponentNeBem2d::SetMaxNumberOfIterations | ( | const unsigned int | niter | ) |
Definition at line 668 of file ComponentNeBem2d.cc.
|
inline |
Set the "background" medium.
Definition at line 38 of file ComponentNeBem2d.hh.
void Garfield::ComponentNeBem2d::SetNumberOfCollocationPoints | ( | const unsigned int | ncoll | ) |
Definition at line 657 of file ComponentNeBem2d.cc.
void Garfield::ComponentNeBem2d::SetNumberOfDivisions | ( | const unsigned int | ndiv | ) |
Set the default number of elements per segment.
Definition at line 646 of file ComponentNeBem2d.cc.
void Garfield::ComponentNeBem2d::SetRangeZ | ( | const double | zmin, |
const double | zmax | ||
) |
Set the extent of the drift region along z.
Definition at line 495 of file ComponentNeBem2d.cc.