Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Component for importing and interpolating three-dimensional ANSYS field maps. More...
#include <ComponentAnsys123.hh>
Public Member Functions | |
ComponentAnsys123 () | |
Constructor. | |
~ComponentAnsys123 () | |
Destructor. | |
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). | |
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 |
Medium * | GetMedium (const double x, const double y, const double z) override |
Get the medium at a given location (x, y, z). | |
bool | Initialise (std::string elist="ELIST.lis", std::string nlist="NLIST.lis", std::string mplist="MPLIST.lis", std::string prnsol="PRNSOL.lis", std::string unit="cm") |
bool | SetWeightingField (std::string prnsol, std::string label) |
Public Member Functions inherited from Garfield::ComponentFieldMap | |
ComponentFieldMap () | |
Constructor. | |
virtual | ~ComponentFieldMap () |
Destructor. | |
virtual void | SetRange () |
Calculate x, y, z, V and angular ranges. | |
void | PrintRange () |
Show x, y, z, V and angular ranges. | |
bool | IsInBoundingBox (const double x, const double y, const double z) const |
bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override |
Get the bounding box coordinates. | |
bool | GetVoltageRange (double &vmin, double &vmax) override |
Calculate the voltage range [V]. | |
void | PrintMaterials () |
List all currently defined materials. | |
void | DriftMedium (const unsigned int imat) |
Flag a field map material as a drift medium. | |
void | NotDriftMedium (const unsigned int imat) |
Flag a field map materials as a non-drift medium. | |
unsigned int | GetNumberOfMaterials () const |
Return the number of materials in the field map. | |
double | GetPermittivity (const unsigned int imat) const |
Return the permittivity of a field map material. | |
double | GetConductivity (const unsigned int imat) const |
Return the conductivity of a field map material. | |
void | SetMedium (const unsigned int imat, Medium *medium) |
Associate a field map material with a Medium class. | |
Medium * | GetMedium (const unsigned int i) const |
Return the Medium associated to a field map material. | |
unsigned int | GetNumberOfMedia () const |
int | GetNumberOfElements () const |
Return the number of mesh elements. | |
bool | GetElement (const unsigned int i, double &vol, double &dmin, double &dmax) |
Return the volume and aspect ratio of a mesh element. | |
void | EnableCheckMapIndices () |
void | DisableCheckMapIndices () |
void | EnableDeleteBackgroundElements (const bool on=true) |
Option to eliminate mesh elements in conductors (default: on). | |
void | EnableTetrahedralTreeForElementSearch (const bool on=true) |
virtual Medium * | GetMedium (const double x, const double y, const double z) |
Get the medium at a given location (x, y, z). | |
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) |
Protected Member Functions | |
void | UpdatePeriodicity () override |
Verify periodicities. | |
double | GetElementVolume (const unsigned int i) override |
void | GetAspectRatio (const unsigned int i, double &dmin, double &dmax) override |
Protected Member Functions inherited from Garfield::ComponentFieldMap | |
void | Reset () override |
Reset the component. | |
void | UpdatePeriodicity2d () |
void | UpdatePeriodicityCommon () |
int | FindElement5 (const double x, const double y, const double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det) |
Find the element for a point in curved quadratic quadrilaterals. | |
int | FindElement13 (const double x, const double y, const double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det) |
Find the element for a point in curved quadratic tetrahedra. | |
int | FindElementCube (const double x, const double y, const double z, double &t1, double &t2, double &t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN) |
Find the element for a point in a cube. | |
void | MapCoordinates (double &xpos, double &ypos, double &zpos, bool &xmirrored, bool &ymirrored, bool &zmirrored, double &rcoordinate, double &rotation) const |
Move (xpos, ypos, zpos) to field map coordinates. | |
void | UnmapFields (double &ex, double &ey, double &ez, double &xpos, double &ypos, double &zpos, bool &xmirrored, bool &ymirrored, bool &zmirrored, double &rcoordinate, double &rotation) const |
Move (ex, ey, ez) to global coordinates. | |
int | ReadInteger (char *token, int def, bool &error) |
double | ReadDouble (char *token, double def, bool &error) |
virtual double | GetElementVolume (const unsigned int i)=0 |
virtual void | GetAspectRatio (const unsigned int i, double &dmin, double &dmax)=0 |
void | PrintWarning (const std::string &header) |
void | PrintNotReady (const std::string &header) const |
void | PrintElement (const std::string &header, const double x, const double y, const double z, const double t1, const double t2, const double t3, const double t4, const Element &element, const unsigned int n, const int iw=-1) const |
virtual void | Reset ()=0 |
Reset the component. | |
virtual void | UpdatePeriodicity ()=0 |
Verify periodicities. | |
Additional Inherited Members | |
Protected Attributes inherited from Garfield::ComponentFieldMap | |
bool | m_is3d = true |
int | nElements = -1 |
std::vector< Element > | elements |
int | nNodes = -1 |
std::vector< Node > | nodes |
unsigned int | m_nMaterials = 0 |
std::vector< Material > | materials |
int | nWeightingFields = 0 |
std::vector< std::string > | wfields |
std::vector< bool > | wfieldsOk |
bool | hasBoundingBox = false |
std::array< double, 3 > | m_minBoundingBox |
std::array< double, 3 > | m_maxBoundingBox |
std::array< double, 3 > | m_mapmin |
std::array< double, 3 > | m_mapmax |
std::array< double, 3 > | m_mapamin |
std::array< double, 3 > | m_mapamax |
std::array< double, 3 > | m_mapna |
std::array< double, 3 > | m_cells |
double | m_mapvmin |
double | m_mapvmax |
std::array< bool, 3 > | m_setang |
bool | m_deleteBackground = true |
bool | m_warning = false |
unsigned int | m_nWarnings = 0 |
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. | |
Component for importing and interpolating three-dimensional ANSYS field maps.
Definition at line 10 of file ComponentAnsys123.hh.
Garfield::ComponentAnsys123::ComponentAnsys123 | ( | ) |
Constructor.
Definition at line 10 of file ComponentAnsys123.cc.
|
inline |
|
overridevirtual |
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
Implements Garfield::ComponentBase.
Definition at line 822 of file ComponentAnsys123.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 815 of file ComponentAnsys123.cc.
Referenced by ElectricField().
|
overrideprotectedvirtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1156 of file ComponentAnsys123.cc.
|
overrideprotectedvirtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1138 of file ComponentAnsys123.cc.
|
overridevirtual |
Get the medium at a given location (x, y, z).
Reimplemented from Garfield::ComponentBase.
Definition at line 1091 of file ComponentAnsys123.cc.
bool Garfield::ComponentAnsys123::Initialise | ( | std::string | elist = "ELIST.lis" , |
std::string | nlist = "NLIST.lis" , |
||
std::string | mplist = "MPLIST.lis" , |
||
std::string | prnsol = "PRNSOL.lis" , |
||
std::string | unit = "cm" |
||
) |
Definition at line 14 of file ComponentAnsys123.cc.
bool Garfield::ComponentAnsys123::SetWeightingField | ( | std::string | prnsol, |
std::string | label | ||
) |
Definition at line 687 of file ComponentAnsys123.cc.
|
inlineoverrideprotectedvirtual |
Verify periodicities.
Implements Garfield::ComponentBase.
Definition at line 41 of file ComponentAnsys123.hh.
Referenced by Initialise().
|
overridevirtual |
Calculate the weighting field at a given point and for a given electrode.
x,y,z | coordinates [cm]. |
wx,wy,wz | components of the weighting field [1/cm]. |
label | name of the electrode |
Reimplemented from Garfield::ComponentBase.
Definition at line 931 of file ComponentAnsys123.cc.
|
overridevirtual |
Calculate the weighting potential at a given point.
x,y,z | coordinates [cm]. |
label | name of the electrode. |
Reimplemented from Garfield::ComponentBase.
Definition at line 1032 of file ComponentAnsys123.cc.