Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <ComponentNeBem3d.hh>
Public Member Functions | |
ComponentNeBem3d () | |
Constructor. | |
~ComponentNeBem3d () | |
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]. | |
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 |
void | AddPlaneX (const double x, const double voltage) |
Add a plane at constant x. | |
void | AddPlaneY (const double y, const double voltage) |
Add a plane at constant y. | |
void | AddPlaneZ (const double z, const double voltage) |
Add a plane at constant z. | |
unsigned int | GetNumberOfPlanesX () const |
Get the number of equipotential planes at constant x. | |
unsigned int | GetNumberOfPlanesY () const |
Get the number of equipotential planes at constant y. | |
unsigned int | GetNumberOfPlanesZ () const |
Get the number of equipotential planes at constant z. | |
bool | GetPlaneX (const unsigned int i, double &x, double &v) const |
Retrieve the parameters of a plane at constant x. | |
bool | GetPlaneY (const unsigned int i, double &y, double &v) const |
Retrieve the parameters of a plane at constant y. | |
bool | GetPlaneZ (const unsigned int i, double &z, double &v) const |
Retrieve the parameters of a plane at constant z. | |
unsigned int | GetNumberOfPrimitives () const |
bool | GetPrimitive (const unsigned int i, double &a, double &b, double &c, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &interface, double &v, double &q, double &lambda) const |
bool | GetPrimitive (const unsigned int i, double &a, double &b, double &c, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &vol1, int &vol2) const |
bool | GetVolume (const unsigned int vol, int &shape, int &material, double &eps, double &potential, double &charge, int &bc) |
int | GetVolume (const double x, const double y, const double z) |
unsigned int | GetNumberOfElements () const |
bool | GetElement (const unsigned int i, std::vector< double > &xv, std::vector< double > &yv, std::vector< double > &zv, int &interface, double &bc, double &lambda) const |
bool | Initialise () |
void | SetTargetElementSize (const double length) |
void | SetMinMaxNumberOfElements (const unsigned int nmin, const unsigned int nmax) |
void | UseLUInversion () |
Invert the influence matrix using lower-upper (LU) decomposition. | |
void | UseSVDInversion () |
Invert the influence matrix using singular value decomposition. | |
void | SetPeriodicCopies (const unsigned int nx, const unsigned int ny, const unsigned int nz) |
void | GetPeriodicCopies (unsigned int &nx, unsigned int &ny, unsigned int &nz) const |
Retrieve the number of periodic copies used by neBEM. | |
void | SetPeriodicityX (const double s) |
Set the periodic length [cm] in the x-direction. | |
void | SetPeriodicityY (const double s) |
Set the periodic length [cm] in the y-direction. | |
void | SetPeriodicityZ (const double s) |
Set the periodic length [cm] in the z-direction. | |
void | SetMirrorPeriodicityX (const double s) |
Set the periodic length [cm] in the x-direction. | |
void | SetMirrorPeriodicityY (const double s) |
Set the periodic length [cm] in the y-direction. | |
void | SetMirrorPeriodicityZ (const double s) |
Set the periodic length [cm] in the z-direction. | |
bool | GetPeriodicityX (double &s) const |
Get the periodic length in the x-direction. | |
bool | GetPeriodicityY (double &s) const |
Get the periodic length in the y-direction. | |
bool | GetPeriodicityZ (double &s) const |
Get the periodic length in the z-direction. | |
void | SetNumberOfThreads (const unsigned int n) |
Set the number of threads to be used by neBEM. | |
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 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 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 direction. | |
void | EnablePeriodicityY (const bool on=true) |
Enable simple periodicity in the direction. | |
void | EnablePeriodicityZ (const bool on=true) |
Enable simple periodicity in the direction. | |
void | IsPeriodic (bool &perx, bool &pery, bool &perz) |
Return periodicity flags. | |
void | EnableMirrorPeriodicityX (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | EnableMirrorPeriodicityY (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | EnableMirrorPeriodicityZ (const bool on=true) |
Enable mirror periodicity in the direction. | |
void | IsMirrorPeriodic (bool &perx, bool &pery, bool &perz) |
Return mirror periodicity flags. | |
void | EnableAxialPeriodicityX (const bool on=true) |
Enable axial periodicity in the direction. | |
void | EnableAxialPeriodicityY (const bool on=true) |
Enable axial periodicity in the direction. | |
void | EnableAxialPeriodicityZ (const bool on=true) |
Enable axial periodicity in the direction. | |
void | IsAxiallyPeriodic (bool &perx, bool &pery, bool &perz) |
Return axial periodicity flags. | |
void | EnableRotationSymmetryX (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | EnableRotationSymmetryY (const bool on=true) |
Enable rotation symmetry around the axis. | |
void | EnableRotationSymmetryZ (const bool on=true) |
Enable rotation symmetry around the 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) |
Protected Member Functions | |
void | Reset () override |
Reset the component. | |
void | UpdatePeriodicity () override |
Verify periodicities. | |
virtual void | Reset ()=0 |
Reset the component. | |
virtual void | UpdatePeriodicity ()=0 |
Verify periodicities. | |
Additional Inherited Members | |
Protected Attributes inherited from Garfield::Component | |
std::string | m_className = "Component" |
Class name. | |
Geometry * | m_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. | |
Interface to neBEM.
Definition at line 12 of file ComponentNeBem3d.hh.
Garfield::ComponentNeBem3d::ComponentNeBem3d | ( | ) |
|
inline |
void Garfield::ComponentNeBem3d::AddPlaneX | ( | const double | x, |
const double | voltage | ||
) |
Add a plane at constant x.
Definition at line 480 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::AddPlaneY | ( | const double | y, |
const double | voltage | ||
) |
Add a plane at constant y.
Definition at line 506 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::AddPlaneZ | ( | const double | z, |
const double | voltage | ||
) |
Add a plane at constant z.
Definition at line 532 of file ComponentNeBem3d.cc.
|
overridevirtual |
Calculate the drift field [V/cm] and potential [V] at (x, y, z).
Implements Garfield::Component.
Definition at line 392 of file ComponentNeBem3d.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::Component.
Definition at line 432 of file ComponentNeBem3d.cc.
Referenced by ElectricField().
bool Garfield::ComponentNeBem3d::GetElement | ( | const unsigned int | i, |
std::vector< double > & | xv, | ||
std::vector< double > & | yv, | ||
std::vector< double > & | zv, | ||
int & | interface, | ||
double & | bc, | ||
double & | lambda | ||
) | const |
Definition at line 3214 of file ComponentNeBem3d.cc.
|
overridevirtual |
Get the medium at a given location (x, y, z).
Reimplemented from Garfield::Component.
Definition at line 386 of file ComponentNeBem3d.cc.
Referenced by ElectricField().
|
inline |
Definition at line 64 of file ComponentNeBem3d.hh.
unsigned int Garfield::ComponentNeBem3d::GetNumberOfPlanesX | ( | ) | const |
Get the number of equipotential planes at constant x.
Definition at line 558 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
unsigned int Garfield::ComponentNeBem3d::GetNumberOfPlanesY | ( | ) | const |
Get the number of equipotential planes at constant y.
Definition at line 567 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
unsigned int Garfield::ComponentNeBem3d::GetNumberOfPlanesZ | ( | ) | const |
Get the number of equipotential planes at constant z.
Definition at line 576 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
|
inline |
Definition at line 52 of file ComponentNeBem3d.hh.
Referenced by neBEM::neBEMGetNbPrimitives().
|
inline |
Retrieve the number of periodic copies used by neBEM.
Definition at line 93 of file ComponentNeBem3d.hh.
Referenced by neBEM::neBEMGetPeriodicities().
bool Garfield::ComponentNeBem3d::GetPeriodicityX | ( | double & | s | ) | const |
Get the periodic length in the x-direction.
Definition at line 720 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetPeriodicities().
bool Garfield::ComponentNeBem3d::GetPeriodicityY | ( | double & | s | ) | const |
Get the periodic length in the y-direction.
Definition at line 729 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetPeriodicities().
bool Garfield::ComponentNeBem3d::GetPeriodicityZ | ( | double & | s | ) | const |
Get the periodic length in the z-direction.
Definition at line 738 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetPeriodicities().
bool Garfield::ComponentNeBem3d::GetPlaneX | ( | const unsigned int | i, |
double & | x, | ||
double & | v | ||
) | const |
Retrieve the parameters of a plane at constant x.
Definition at line 585 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
bool Garfield::ComponentNeBem3d::GetPlaneY | ( | const unsigned int | i, |
double & | y, | ||
double & | v | ||
) | const |
Retrieve the parameters of a plane at constant y.
Definition at line 596 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
bool Garfield::ComponentNeBem3d::GetPlaneZ | ( | const unsigned int | i, |
double & | z, | ||
double & | v | ||
) | const |
Retrieve the parameters of a plane at constant z.
Definition at line 607 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMGetBoundingPlanes().
bool Garfield::ComponentNeBem3d::GetPrimitive | ( | const unsigned int | i, |
double & | a, | ||
double & | b, | ||
double & | c, | ||
std::vector< double > & | xv, | ||
std::vector< double > & | yv, | ||
std::vector< double > & | zv, | ||
int & | interface, | ||
double & | v, | ||
double & | q, | ||
double & | lambda | ||
) | const |
Definition at line 3119 of file ComponentNeBem3d.cc.
bool Garfield::ComponentNeBem3d::GetPrimitive | ( | const unsigned int | i, |
double & | a, | ||
double & | b, | ||
double & | c, | ||
std::vector< double > & | xv, | ||
std::vector< double > & | yv, | ||
std::vector< double > & | zv, | ||
int & | vol1, | ||
int & | vol2 | ||
) | const |
Definition at line 3143 of file ComponentNeBem3d.cc.
|
overridevirtual |
Calculate the voltage range [V].
Implements Garfield::Component.
Definition at line 439 of file ComponentNeBem3d.cc.
int Garfield::ComponentNeBem3d::GetVolume | ( | const double | x, |
const double | y, | ||
const double | z | ||
) |
Definition at line 3201 of file ComponentNeBem3d.cc.
bool Garfield::ComponentNeBem3d::GetVolume | ( | const unsigned int | vol, |
int & | shape, | ||
int & | material, | ||
double & | eps, | ||
double & | potential, | ||
double & | charge, | ||
int & | bc | ||
) |
Definition at line 3163 of file ComponentNeBem3d.cc.
Referenced by neBEM::neBEMVolumePoint().
bool Garfield::ComponentNeBem3d::Initialise | ( | ) |
Retrieve surface panels, remove contacts and cut polygons to rectangles and right-angle triangles.
Definition at line 747 of file ComponentNeBem3d.cc.
Referenced by ElectricField().
|
overrideprotectedvirtual |
Reset the component.
Implements Garfield::Component.
Definition at line 3234 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetMinMaxNumberOfElements | ( | const unsigned int | nmin, |
const unsigned int | nmax | ||
) |
Set the smallest and largest allowed number of elements along the lenght of a primitive.
Definition at line 628 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetMirrorPeriodicityX | ( | const double | s | ) |
Set the periodic length [cm] in the x-direction.
Definition at line 684 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetMirrorPeriodicityY | ( | const double | s | ) |
Set the periodic length [cm] in the y-direction.
Definition at line 696 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetMirrorPeriodicityZ | ( | const double | s | ) |
Set the periodic length [cm] in the z-direction.
Definition at line 708 of file ComponentNeBem3d.cc.
|
inline |
Set the number of threads to be used by neBEM.
Definition at line 119 of file ComponentNeBem3d.hh.
void Garfield::ComponentNeBem3d::SetPeriodicCopies | ( | const unsigned int | nx, |
const unsigned int | ny, | ||
const unsigned int | nz | ||
) |
Set the parameters defining the number of periodic copies that neBEM will use when dealing with periodic configurations. neBEM will use copies (default: ).
Definition at line 640 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetPeriodicityX | ( | const double | s | ) |
Set the periodic length [cm] in the x-direction.
Definition at line 648 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetPeriodicityY | ( | const double | s | ) |
Set the periodic length [cm] in the y-direction.
Definition at line 660 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetPeriodicityZ | ( | const double | s | ) |
Set the periodic length [cm] in the z-direction.
Definition at line 672 of file ComponentNeBem3d.cc.
void Garfield::ComponentNeBem3d::SetTargetElementSize | ( | const double | length | ) |
Set the default value of the target linear size of the elements produced by neBEM's discretisation process.
Definition at line 618 of file ComponentNeBem3d.cc.
|
overrideprotectedvirtual |
Verify periodicities.
Implements Garfield::Component.
Definition at line 3243 of file ComponentNeBem3d.cc.
Referenced by SetMirrorPeriodicityX(), SetMirrorPeriodicityY(), SetMirrorPeriodicityZ(), SetPeriodicityX(), SetPeriodicityY(), and SetPeriodicityZ().
|
inline |
Invert the influence matrix using lower-upper (LU) decomposition.
Definition at line 83 of file ComponentNeBem3d.hh.
|
inline |
Invert the influence matrix using singular value decomposition.
Definition at line 85 of file ComponentNeBem3d.hh.
|
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::Component.
Definition at line 445 of file ComponentNeBem3d.cc.
|
overridevirtual |
Calculate the weighting potential at a given point.
x,y,z | coordinates [cm]. |
label | name of the electrode. |
Reimplemented from Garfield::Component.
Definition at line 466 of file ComponentNeBem3d.cc.