Garfield++ v1r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <ComponentCST.hh>
Public Member Functions | |
ComponentCST () | |
~ComponentCST () | |
void | ShiftComponent (const double xShift, const double yShift, const double zShift) |
Medium * | GetMedium (const double &x, const double &y, const double &z) |
void | GetNumberOfMeshLines (unsigned int &n_x, unsigned int &n_y, unsigned int &n_z) |
void | GetElementBoundaries (unsigned int element, double &xmin, double &xmax, double &ymin, double &ymax, double &zmin, double &zmax) |
int | GetElementMaterial (unsigned int element) |
void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) |
void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, double &v, Medium *&m, int &status) |
void | WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string label) |
double | WeightingPotential (const double x, const double y, const double z, const std::string label) |
bool | Initialise (std::string elist, std::string nlist, std::string mplist, std::string prnsol, std::string unit="cm") |
bool | Initialise (std::string dataFile, std::string unit="cm") |
bool | SetWeightingField (std::string prnsol, std::string label, bool isBinary=true) |
bool | IsInBoundingBox (const double x, const double y, const double z) |
void | SetRange () |
void | SetRangeZ (const double zmin, const double zmax) |
void | DisableXField () |
void | DisableYField () |
void | DisableZField () |
void | EnableShaping () |
void | DisableShaping () |
int | Index2Element (const unsigned int i, const unsigned int j, const unsigned int k) |
bool | Coordinate2Index (const double x, const double y, const double z, unsigned int &i, unsigned int &j, unsigned int &k) |
Public Member Functions inherited from Garfield::ComponentFieldMap | |
ComponentFieldMap () | |
virtual | ~ComponentFieldMap () |
virtual void | SetRange () |
void | PrintRange () |
virtual bool | IsInBoundingBox (const double x, const double y, const double z) |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) |
bool | GetVoltageRange (double &vmin, double &vmax) |
void | PrintMaterials () |
void | DriftMedium (int imat) |
void | NotDriftMedium (int imat) |
int | GetNumberOfMaterials () |
double | GetPermittivity (const int imat) |
double | GetConductivity (const int imat) |
void | SetMedium (const int imat, Medium *medium) |
Medium * | GetMedium (const unsigned int &i) const |
Medium * | GetMedium (const double &x, const double &y, const double &z)=0 |
int | GetNumberOfMedia () |
int | GetNumberOfElements () const |
bool | GetElement (const int i, double &vol, double &dmin, double &dmax) |
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 |
virtual void | WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string label)=0 |
virtual double | WeightingPotential (const double x, const double y, const double z, const std::string label)=0 |
void | EnableCheckMapIndices () |
void | DisableCheckMapIndices () |
void | EnableDeleteBackgroundElements () |
void | DisableDeleteBackgroundElements () |
Public Member Functions inherited from Garfield::ComponentBase | |
ComponentBase () | |
virtual | ~ComponentBase () |
virtual void | SetGeometry (GeometryBase *geo) |
virtual void | Clear () |
virtual Medium * | GetMedium (const double &x, const double &y, const double &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 |
virtual bool | GetVoltageRange (double &vmin, double &vmax)=0 |
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 | 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) |
virtual bool | IsReady () |
virtual bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) |
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) |
virtual bool | IsInTrapRadius (double x0, double y0, double z0, double &xw, double &yw, double &rw) |
void | EnablePeriodicityX () |
void | DisablePeriodicityX () |
void | EnablePeriodicityY () |
void | DisablePeriodicityY () |
void | EnablePeriodicityZ () |
void | DisablePeriodicityZ () |
void | EnableMirrorPeriodicityX () |
void | DisableMirrorPeriodicityX () |
void | EnableMirrorPeriodicityY () |
void | DisableMirrorPeriodicityY () |
void | EnableMirrorPeriodicityZ () |
void | DisableMirrorPeriodicityZ () |
void | EnableAxialPeriodicityX () |
void | DisableAxialPeriodicityX () |
void | EnableAxialPeriodicityY () |
void | DisableAxialPeriodicityY () |
void | EnableAxialPeriodicityZ () |
void | DisableAxialPeriodicityZ () |
void | EnableRotationSymmetryX () |
void | DisableRotationSymmetryX () |
void | EnableRotationSymmetryY () |
void | DisableRotationSymmetryY () |
void | EnableRotationSymmetryZ () |
void | DisableRotationSymmetryZ () |
void | EnableDebugging () |
void | DisableDebugging () |
Protected Member Functions | |
void | UpdatePeriodicity () |
double | GetElementVolume (const int i) |
void | GetAspectRatio (const int i, double &dmin, double &dmax) |
bool | Coordinate2Index (const double x, const double y, const double z, unsigned int &i, unsigned int &j, unsigned int &k, double *position_mapped, bool *mirrored, double &rcoordinate, double &rotation) |
Protected Member Functions inherited from Garfield::ComponentFieldMap | |
void | Reset () |
virtual void | UpdatePeriodicity ()=0 |
void | UpdatePeriodicity2d () |
void | UpdatePeriodicityCommon () |
int | Coordinates3 (double x, double y, double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, int imap) |
int | Coordinates4 (double x, double y, double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, int imap) |
int | Coordinates5 (double x, double y, double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, int imap) |
int | Coordinates12 (double x, double y, double z, double &t1, double &t2, double &t3, double &t4, int imap) |
int | Coordinates13 (double x, double y, double z, double &t1, double &t2, double &t3, double &t4, double jac[4][4], double &det, int imap) |
int | CoordinatesCube (double x, double y, double z, double &t1, double &t2, double &t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN, int imap) |
void | Jacobian3 (int i, double u, double v, double w, double &det, double jac[4][4]) |
void | Jacobian5 (int i, double u, double v, double &det, double jac[4][4]) |
void | Jacobian13 (int i, double t, double u, double v, double w, double &det, double jac[4][4]) |
void | JacobianCube (int i, double t1, double t2, double t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN) |
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) |
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) |
int | FindElementCube (const double x, const double y, const double z, double &t1, double &t2, double &t3, TMatrixD *&jac, std::vector< TMatrixD * > &dN) |
void | MapCoordinates (double &xpos, double &ypos, double &zpos, bool &xmirrored, bool &ymirrored, bool &zmirrored, double &rcoordinate, double &rotation) const |
void | UnmapFields (double &ex, double &ey, double &ez, double &xpos, double &ypos, double &zpos, bool &xmirrored, bool &ymirrored, bool &zmirrored, double &rcoordinate, double &rotation) |
int | ReadInteger (char *token, int def, bool &error) |
double | ReadDouble (char *token, double def, bool &error) |
virtual double | GetElementVolume (const int i)=0 |
virtual void | GetAspectRatio (const int i, double &dmin, double &dmax)=0 |
void | CalculateElementBoundingBoxes (void) |
virtual void | Reset ()=0 |
virtual void | UpdatePeriodicity ()=0 |
Definition at line 15 of file ComponentCST.hh.
Garfield::ComponentCST::ComponentCST | ( | ) |
Definition at line 20 of file ComponentCST.cc.
|
inline |
Definition at line 21 of file ComponentCST.hh.
bool Garfield::ComponentCST::Coordinate2Index | ( | const double | x, |
const double | y, | ||
const double | z, | ||
unsigned int & | i, | ||
unsigned int & | j, | ||
unsigned int & | k | ||
) |
Find the positions in the x/y/z position vectors (m_xlines, m_ylines, m_zlines) for a given point. The operator used for the comparison is <=. Therefore, the last entry in the vector will never be returned for a point inside the mesh.
Definition at line 1091 of file ComponentCST.cc.
Referenced by Coordinate2Index(), GetMedium(), WeightingField(), and WeightingPotential().
|
protected |
Calculate the index in the vectors m_xlines, m_ylines, m_zlines, which is before the given coordinate.
x | The x coordinate mapped to the basic cell. |
y | The y coordinate mapped to the basic cell. |
z | The z coordinate mapped to the basic cell. |
i | The index of the m_xlines vector, where m_xlines.at(i) < x < m_xlines.at(i+1). |
j | The index of the m_ylines vector, where m_ylines.at(j) < y < m_ylines.at(j+1). |
k | The index of the m_zlines vector, where m_zlines.at(k) < z < m_zlines.at(k+1). |
position_mapped | The calculated mapped position (x,y,z) -> (x_mapped, y_mapped, z_mapped) |
mirrored | Information if x, y, or z direction is mirrored. |
rcoordinate | Information about rotation of the component. See ComponentFieldMap::MapCoordinates. |
rotation | Information about rotation of the component. See ComponentFieldMap::MapCoordinates. |
Definition at line 1108 of file ComponentCST.cc.
|
inline |
Definition at line 166 of file ComponentCST.hh.
|
inline |
Use these functions to disable a certain field component. Is a field component is disabled ElectricField and WeightingField will return 0 for this component. This is useful if you want to have calculated global field distortions and you want to add the field of a GEM. If you would simply add both components the field component in drift direction would be added twice!
Definition at line 125 of file ComponentCST.hh.
|
inline |
Definition at line 128 of file ComponentCST.hh.
|
inline |
Definition at line 131 of file ComponentCST.hh.
|
virtual |
Implements Garfield::ComponentFieldMap.
Definition at line 889 of file ComponentCST.cc.
|
virtual |
Implements Garfield::ComponentFieldMap.
Definition at line 882 of file ComponentCST.cc.
|
inline |
If you calculate the electric field component in
direction along a line in x direction this field component will be constant inside mesh elements (by construction). This can be observed by plotting
in
direction. If you plot
in y direction the field will be smooth (also by construction). Yuri Piadyk proposed also to shape the electric field. This is done as follows. The field component calculated as described above is assumed to appear in the center of the mesh element.
| M1 P | M2 | x direction |-—x—x-|--—x---—|-->
__________ | ____________ |
element 1 element 2
Lets consider only the
direction and we want to calculate [E_x(P)]. The field in the center of the element containing
is
direction in everywhere in element 1. The idea of the shaping is to do a linear interpolation of the
between the field
and
. This results in a smooth electric field
also in
direction. If P would be left from
the field in the left neighboring element would be considered. In addition it is also checked if the material in both elements used for the interpolation is the same. Else no interpolation is done.
Definition at line 163 of file ComponentCST.hh.
|
protectedvirtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1160 of file ComponentCST.cc.
void Garfield::ComponentCST::GetElementBoundaries | ( | unsigned int | element, |
double & | xmin, | ||
double & | xmax, | ||
double & | ymin, | ||
double & | ymax, | ||
double & | zmin, | ||
double & | zmax | ||
) |
Definition at line 1022 of file ComponentCST.cc.
|
inline |
Definition at line 29 of file ComponentCST.hh.
|
protectedvirtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1177 of file ComponentCST.cc.
|
virtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1034 of file ComponentCST.cc.
void Garfield::ComponentCST::GetNumberOfMeshLines | ( | unsigned int & | n_x, |
unsigned int & | n_y, | ||
unsigned int & | n_z | ||
) |
Definition at line 1016 of file ComponentCST.cc.
int Garfield::ComponentCST::Index2Element | ( | const unsigned int | i, |
const unsigned int | j, | ||
const unsigned int | k | ||
) |
Calculate the element index from the position in the x/y/z position vectors (m_xlines, m_ylines, m_zlines). This is public since it is used in ViewFEMesh::DrawCST.
Definition at line 1100 of file ComponentCST.cc.
Referenced by GetMedium(), and WeightingField().
bool Garfield::ComponentCST::Initialise | ( | std::string | dataFile, |
std::string | unit = "cm" |
||
) |
Import of field data based on binary files. See http://www.desy.de/~zenker/garfieldpp.html to get information about the binary files export from CST.
dataFile | The binary file containing the field data exported from CST. |
unit | The units used in the binary file. They are not necessarily equal to CST units. |
Definition at line 492 of file ComponentCST.cc.
bool Garfield::ComponentCST::Initialise | ( | std::string | elist, |
std::string | nlist, | ||
std::string | mplist, | ||
std::string | prnsol, | ||
std::string | unit = "cm" |
||
) |
Deprecated version of the interface based on text file import of field data.
elist | Information about the element material of mesh cells. Each line contains the element number and the material index: 0 3
...
|
nlist | Information about the mesh like this: xmax 136 ymax 79 zmax 425
x−l i n e s
0
8 . 9 2 8 5 7 e −07
1 . 7 8 5 7 1 e −06
...
y−l i n e s
0
8 . 9 2 8 5 7 e −07
1 . 7 8 5 7 1 e −06
...
z−l i n e s
0.0027
0.00270674
...
|
mplist | Information about material properties used in the simulation: Materials 4
Material 1 PERX 1 . 0 0 0 0 0 0
Material 2 RSVX 0 . 0 0 0 0 0 0 PERX 0 . 1 0 0 0 0 0 0E+11
Material 3 PERX 3 . 5 0 0 0 0 0
Material 4 PERX 4 . 8 0 0 0 0 0
|
prnsol | Information about the node potentials. Each line contains the node number and the potential: 0 1000.00
...
|
unit | The units used in the nlist input file |
Definition at line 37 of file ComponentCST.cc.
|
inlinevirtual |
Reimplemented from Garfield::ComponentFieldMap.
Definition at line 107 of file ComponentCST.hh.
|
virtual |
Reimplemented from Garfield::ComponentFieldMap.
Definition at line 1050 of file ComponentCST.cc.
Referenced by Initialise(), and ShiftComponent().
void Garfield::ComponentCST::SetRangeZ | ( | const double | zmin, |
const double | zmax | ||
) |
Definition at line 1080 of file ComponentCST.cc.
bool Garfield::ComponentCST::SetWeightingField | ( | std::string | prnsol, |
std::string | label, | ||
bool | isBinary = true |
||
) |
Initialise a weighting field. This function can handle the deprecated text based file format (see Initialise( std::string elist...) for the expected file format, which is similar to prnsol. It also also handles binary files including the weighting field.
prnsol | The input file (binary/text file) |
label | The name of the weighting field to be added. If a weighting field with same name already exist it is replaced by the new one. |
isBinary | Depending on the file type you use, adapt this switch. |
Definition at line 689 of file ComponentCST.cc.
void Garfield::ComponentCST::ShiftComponent | ( | const double | xShift, |
const double | yShift, | ||
const double | zShift | ||
) |
Definition at line 869 of file ComponentCST.cc.
|
protectedvirtual |
Implements Garfield::ComponentFieldMap.
Definition at line 1154 of file ComponentCST.cc.
Referenced by Initialise(), and ShiftComponent().
|
virtual |
Implements Garfield::ComponentFieldMap.
Definition at line 895 of file ComponentCST.cc.
|
virtual |
Implements Garfield::ComponentFieldMap.
Definition at line 960 of file ComponentCST.cc.