![]() |
Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
|
Component for interpolating field maps stored in a mesh generated by neBEM. More...
#include <ComponentNeBem3dMap.hh>
Classes | |
struct | Element |
Public Member Functions | |
ComponentNeBem3dMap () | |
Constructor. | |
~ComponentNeBem3dMap () | |
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 |
void | ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override |
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 | MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) override |
void | SetWeightingFieldOffset (const double x, const double y, const double z) |
Offset coordinates in the weighting field, such that the same numerical weighting field map can be used for electrodes at different positions. | |
Medium * | GetMedium (const double x, const double y, const double z) override |
bool | GetVoltageRange (double &vmin, double &vmax) override |
bool | GetElectricFieldRange (double &exmin, double &exmax, double &eymin, double &eymax, double &ezmin, double &ezmax) |
bool | GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override |
bool | LoadMapInfo (const std::string &MapInfoFile, std::string &MapVersion, int &OptMap, int &OptStaggerMap, unsigned int &NbOfXCells, unsigned int &NbOfYCells, unsigned int &NbOfZCells, double &Xmin, double &Xmax, double &Ymin, double &Ymax, double &Zmin, double &Zmax, double &XStagger, double &YStagger, double &ZStagger, std::string &MapDataFile) |
Map related information. | |
void | SetMesh (const unsigned int nx, const unsigned int ny, const unsigned int nz, const double xmin, const double xmax, const double ymin, const double ymax, const double zmin, const double zmax) |
Define the grid. | |
bool | LoadElectricField (const std::string &filename, const std::string &format, const bool withPotential, const bool withRegion, const double scaleX=1., const double scaleE=1., const double scaleP=1.) |
Import electric field and potential values from a file. | |
bool | LoadMagneticField (const std::string &filename, const std::string &format, const double scaleX=1., const double scaleB=1.) |
Import magnetic field values from a file. | |
bool | GetElement (const double xi, const double yi, const double zi, unsigned int &i, unsigned int &j, unsigned int &k, bool &xMirrored, bool &yMirrored, bool &zMirrored) const |
Return the indices of the element at a given point. | |
bool | GetElement (const unsigned int i, const unsigned int j, const unsigned int k, double &v, double &ex, double &ey, double &ez) const |
Return the field for an element with given index. | |
void | SetMedium (const unsigned int i, Medium *m) |
Set the medium in region i. | |
Medium * | GetMedium (const unsigned int i) const |
Get the medium in region i. | |
void | PrintRegions () const |
Print all regions. |
Private Member Functions | |
bool | LoadData (const std::string &filename, std::string format, const bool withPotential, const bool withRegion, const double scaleX, const double scaleF, const double scaleP, const char field) |
Read data from file. | |
void | Reset () override |
void | UpdatePeriodicity () override |
double | Reduce (const double xin, const double xmin, const double xmax, const bool simplePeriodic, const bool mirrorPeriodic, bool &isMirrored) const |
Reduce a coordinate to the basic cell (in case of periodicity). | |
double | TriLinInt (const double xd, const double yd, const double zd, const double c000, const double c100, const double c010, const double c001, const double c110, const double c101, const double c011, const double c111) |
Interpolate tri-linear. |
Private Attributes | |
std::vector< Medium * > | m_media |
std::vector< std::vector< std::vector< Element > > > | m_efields |
Electric field values and potentials at each mesh element. | |
std::vector< std::vector< std::vector< Element > > > | m_bfields |
Magnetic field values at each mesh element. | |
std::vector< std::vector< std::vector< int > > > | m_regions |
Region indices. | |
unsigned int | m_nX = 0 |
unsigned int | m_nY = 0 |
unsigned int | m_nZ = 0 |
double | m_xMin = 0. |
double | m_yMin = 0. |
double | m_zMin = 0. |
double | m_xMax = 0. |
double | m_yMax = 0. |
double | m_zMax = 0. |
bool | m_hasMesh = false |
bool | m_hasPotential = false |
bool | m_hasEfield = false |
bool | m_hasBfield = false |
double | m_wField_xOffset = 0. |
double | m_wField_yOffset = 0. |
double | m_wField_zOffset = 0. |
double | m_pMin = 0. |
double | m_pMax = 0. |
Component for interpolating field maps stored in a mesh generated by neBEM.
Definition at line 10 of file ComponentNeBem3dMap.hh.
Garfield::ComponentNeBem3dMap::ComponentNeBem3dMap | ( | ) |
Constructor.
|
inline |
|
override |
|
override |
|
override |
bool Garfield::ComponentNeBem3dMap::GetElectricFieldRange | ( | double & | exmin, |
double & | exmax, | ||
double & | eymin, | ||
double & | eymax, | ||
double & | ezmin, | ||
double & | ezmax ) |
bool Garfield::ComponentNeBem3dMap::GetElement | ( | const double | xi, |
const double | yi, | ||
const double | zi, | ||
unsigned int & | i, | ||
unsigned int & | j, | ||
unsigned int & | k, | ||
bool & | xMirrored, | ||
bool & | yMirrored, | ||
bool & | zMirrored ) const |
Return the indices of the element at a given point.
bool Garfield::ComponentNeBem3dMap::GetElement | ( | const unsigned int | i, |
const unsigned int | j, | ||
const unsigned int | k, | ||
double & | v, | ||
double & | ex, | ||
double & | ey, | ||
double & | ez ) const |
Return the field for an element with given index.
|
override |
Medium * Garfield::ComponentNeBem3dMap::GetMedium | ( | const unsigned int | i | ) | const |
Get the medium in region i.
|
override |
|
private |
Read data from file.
bool Garfield::ComponentNeBem3dMap::LoadElectricField | ( | const std::string & | filename, |
const std::string & | format, | ||
const bool | withPotential, | ||
const bool | withRegion, | ||
const double | scaleX = 1., | ||
const double | scaleE = 1., | ||
const double | scaleP = 1. ) |
Import electric field and potential values from a file.
The file is supposed to contain one line for each mesh point starting with
followed by
Format types are:
bool Garfield::ComponentNeBem3dMap::LoadMagneticField | ( | const std::string & | filename, |
const std::string & | format, | ||
const double | scaleX = 1., | ||
const double | scaleB = 1. ) |
Import magnetic field values from a file.
bool Garfield::ComponentNeBem3dMap::LoadMapInfo | ( | const std::string & | MapInfoFile, |
std::string & | MapVersion, | ||
int & | OptMap, | ||
int & | OptStaggerMap, | ||
unsigned int & | NbOfXCells, | ||
unsigned int & | NbOfYCells, | ||
unsigned int & | NbOfZCells, | ||
double & | Xmin, | ||
double & | Xmax, | ||
double & | Ymin, | ||
double & | Ymax, | ||
double & | Zmin, | ||
double & | Zmax, | ||
double & | XStagger, | ||
double & | YStagger, | ||
double & | ZStagger, | ||
std::string & | MapDataFile ) |
Map related information.
|
override |
void Garfield::ComponentNeBem3dMap::PrintRegions | ( | ) | const |
Print all regions.
|
private |
Reduce a coordinate to the basic cell (in case of periodicity).
|
overrideprivate |
void Garfield::ComponentNeBem3dMap::SetMedium | ( | const unsigned int | i, |
Medium * | m ) |
Set the medium in region i.
void Garfield::ComponentNeBem3dMap::SetMesh | ( | const unsigned int | nx, |
const unsigned int | ny, | ||
const unsigned int | nz, | ||
const double | xmin, | ||
const double | xmax, | ||
const double | ymin, | ||
const double | ymax, | ||
const double | zmin, | ||
const double | zmax ) |
Define the grid.
nx,ny,nz | number of bins along x, y, z. |
xmin,xmax | range along ![]() |
ymin,ymax | range along ![]() |
zmin,zmax | range along ![]() |
void Garfield::ComponentNeBem3dMap::SetWeightingFieldOffset | ( | const double | x, |
const double | y, | ||
const double | z ) |
Offset coordinates in the weighting field, such that the same numerical weighting field map can be used for electrodes at different positions.
|
private |
Interpolate tri-linear.
|
overrideprivate |
|
override |
|
override |
|
private |
Magnetic field values at each mesh element.
Definition at line 112 of file ComponentNeBem3dMap.hh.
|
private |
Electric field values and potentials at each mesh element.
Definition at line 110 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 123 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 122 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 120 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 121 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 104 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 116 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 116 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 116 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 131 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 131 of file ComponentNeBem3dMap.hh.
|
private |
Region indices.
Definition at line 114 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 126 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 127 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 128 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 118 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 117 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 118 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 117 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 118 of file ComponentNeBem3dMap.hh.
|
private |
Definition at line 117 of file ComponentNeBem3dMap.hh.