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
Calculate the drift field [V/cm] and potential [V] at (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
Calculate the drift field at given point.
void WeightingField (const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
Calculate the weighting field at a given point and for a given electrode.
double WeightingPotential (const double x, const double y, const double z, const std::string &label) override
Calculate the weighting potential at a given point.
void MagneticField (const double x, const double y, const double z, double &bx, double &by, double &bz, int &status) override
Calculate the magnetic field at a given point.
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
Get the medium at a given location (x, y, z).
bool GetVoltageRange (double &vmin, double &vmax) override
Calculate the voltage range [V].
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
Get the bounding box coordinates.
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.
Component ()=delete
Default constructor.
Component (const std::string &name)
Constructor.
virtual ~Component ()=default
Destructor.
virtual void SetGeometry (Geometry *geo)
Define the geometry.
virtual void Clear ()
Reset.
std::array< double, 3 > ElectricField (const double x, const double y, const double z)
Calculate the drift field [V/cm] at (x, y, z).
virtual double ElectricPotential (const double x, const double y, const double z)
Calculate the (drift) electrostatic potential [V] at (x, y, z).
virtual const std::vector< double > & DelayedSignalTimes (const std::string &)
Return the time steps at which the delayed weighting potential/field are stored/evaluated.
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)
Calculate the delayed weighting field at a given point and time and for a given electrode.
virtual double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label)
Calculate the delayed weighting potential at a given point and time and for a given electrode.
virtual void DelayedWeightingPotentials (const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp)
Calculate the delayed weighting potentials at a given point and for a given electrode, for a set of pre-defined times.
void SetMagneticField (const double bx, const double by, const double bz)
Set a constant magnetic field.
virtual bool IsReady ()
Ready for use?
virtual bool Is3d ()
Does the component have a 3D field (map)?
virtual bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
Get the coordinates of the elementary cell.
double CellSizeX ()
double CellSizeY ()
double CellSizeZ ()
virtual size_t GetNumberOfElements () const
Return the number of mesh elements.
virtual bool GetElementNodes (const size_t, std::vector< size_t > &) const
Get the indices of the nodes constituting a given element.
virtual bool GetElementRegion (const size_t, size_t &, bool &) const
Get the region/material of a mesh element and a flag whether it is associated to an active medium.
virtual size_t GetNumberOfNodes () const
Return the number of mesh nodes.
virtual bool GetNode (const size_t i, double &x, double &y, double &z) const
Get the coordinates of a mesh node.
double IntegrateFluxCircle (const double xc, const double yc, const double r, const unsigned int nI=50)
Integrate the normal component of the electric field over a circle.
double IntegrateFluxSphere (const double xc, const double yc, const double zc, const double r, const unsigned int nI=20)
Integrate the normal component of the electric field over a sphere.
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)
Integrate the normal component of the electric field over a parallelogram.
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)
Integrate the normal component of the weighting field over a parallelogram.
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)
Integrate the electric field flux through a line from (x0,y0,z0) to (x1,y1,z1) along a direction (xp,yp,zp).
virtual bool CrossedWire (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)
Determine whether the line between two points crosses a wire.
virtual bool InTrapRadius (const double q0, const double x0, const double y0, const double z0, double &xw, double &yw, double &rw)
Determine whether a particle is inside the trap radius of a wire.
virtual bool CrossedPlane (const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, double &xc, double &yc, double &zc)
Determine whether the line between two points crosses a plane.
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 EnableTriangleSymmetricXY (const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
void EnableTriangleSymmetricXZ (const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
void EnableTriangleSymmetricYZ (const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
void EnableDebugging (const bool on=true)
Switch on debugging messages.
void DisableDebugging ()
Switch off debugging messages.
virtual bool HasMagneticField () const
Does the component have a non-zero magnetic field?
virtual bool HasTownsendMap () const
Does the component have maps of the Townsend coefficient?
virtual bool HasAttachmentMap () const
Does the component have maps of the attachment coefficient?
virtual bool HasMobilityMap () const
Does the component have maps of the low-field mobility?
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 ElectronMobility (const double, const double, const double, double &mu)
virtual bool HoleMobility (const double, const double, const double, double &mu)
Get the hole Mobility coefficient.
virtual bool ElectronTownsend (const double, const double, const double, double &alpha)
Get the electron Townsend coefficient.
virtual bool HoleTownsend (const double, const double, const double, double &alpha)
Get the hole Townsend 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 double StepSizeHint ()
virtual double CreateGPUTransferObject (ComponentGPU *&comp_gpu)
Create and initialise GPU Transfer class.