50 virtual void ElectricField(
const double x,
const double y,
const double z,
51 double& ex,
double& ey,
double& ez,
Medium*& m,
54 virtual void ElectricField(
const double x,
const double y,
const double z,
55 double& ex,
double& ey,
double& ez,
double& v,
56 Medium*& m,
int& status) = 0;
73 double& wx,
double& wy,
double& wz,
74 const std::string& label);
81 const double z,
const std::string& label);
86 const std::string& ) {
97 const double z,
const double t,
double& wx,
98 double& wy,
double& wz,
99 const std::string& label);
108 const double z,
const double t,
109 const std::string& label);
115 const std::string& label,
116 std::vector<double>& dwp);
124 double& bx,
double& by,
double& bz,
int& status);
131 virtual bool Is3d() {
return true; }
135 double& xmax,
double& ymax,
double& zmax);
139 double& xmax,
double& ymax,
double& zmax);
151 std::vector<size_t>& )
const {
163 virtual bool GetNode(
const size_t i,
double& x,
double& y,
double& z)
const;
173 const unsigned int nI = 50);
182 const double r,
const unsigned int nI = 20);
193 const double x0,
const double y0,
const double z0,
const double dx1,
194 const double dy1,
const double dz1,
const double dx2,
const double dy2,
195 const double dz2,
const unsigned int nU = 20,
const unsigned int nV = 20);
200 const std::string& label,
const double x0,
const double y0,
201 const double z0,
const double dx1,
const double dy1,
const double dz1,
202 const double dx2,
const double dy2,
const double dz2,
203 const unsigned int nU = 20,
const unsigned int nV = 20);
215 const double x1,
const double y1,
const double z1,
216 const double xp,
const double yp,
const double zp,
217 const unsigned int nI,
const int isign = 0);
228 virtual bool CrossedWire(
const double x0,
const double y0,
const double z0,
229 const double x1,
const double y1,
const double z1,
230 double& xc,
double& yc,
double& zc,
231 const bool centre,
double& rc);
238 virtual bool InTrapRadius(
const double q0,
const double x0,
const double y0,
239 const double z0,
double& xw,
double& yw,
242 virtual bool CrossedPlane(
const double x0,
const double y0,
const double z0,
243 const double x1,
const double y1,
const double z1,
244 double& xc,
double& yc,
double& zc);
375 const double ,
double& eta) {
381 const double ,
double& eta) {
388 const double ,
double& mu) {
394 const double ,
double& mu) {
401 const double ,
double& alpha) {
407 const double ,
double& alpha) {
413 const double ,
double& vx,
double& vy,
420 const double ,
double& vx,
double& vy,
439 std::array<double, 3>
m_b0 = {{0., 0., 0.}};
471 const double z0,
const double dx1,
472 const double dy1,
const double dz1,
473 const double dx2,
const double dy2,
474 const double dz2,
const unsigned int nU,
475 const unsigned int nV,
const bool wfield,
476 const std::string& label);
virtual double CreateGPUTransferObject(ComponentGPU *&comp_gpu)
Create and initialise GPU Transfer class.
virtual size_t GetNumberOfNodes() const
Return the number of mesh nodes.
Component(const std::string &name)
Constructor.
virtual void UpdatePeriodicity()=0
Verify periodicities.
void IsAxiallyPeriodic(bool &perx, bool &pery, bool &perz)
Return axial periodicity flags.
virtual double WeightingPotential(const double x, const double y, const double z, const std::string &label)
Calculate the weighting potential at a given point.
virtual bool GetNode(const size_t i, double &x, double &y, double &z) const
Get the coordinates of a mesh node.
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, const unsigned int nV, const bool wfield, const std::string &label)
virtual bool HasMagneticField() const
Does the component have a non-zero magnetic field?
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.
std::array< bool, 3 > m_rotationSymmetric
Rotation symmetry around x-axis, y-axis, z-axis.
void EnableMirrorPeriodicityX(const bool on=true)
Enable mirror periodicity in the direction.
virtual bool GetBoundingBox(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
Get the bounding box coordinates.
std::array< bool, 3 > m_mirrorPeriodic
Mirror periodicity in x, y, z.
virtual bool ElectronMobility(const double, const double, const double, double &mu)
const std::array< int, 4 > m_triangleOctRules
Octants where |x| >= |y|.
int m_triangleSymmetricOct
Triangle symmetric octant of imported map (0 < phi < Pi/4 --> octant 1).
virtual void Reset()=0
Reset the component.
void DisableDebugging()
Switch off debugging messages.
void EnableTriangleSymmetricXZ(const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
void EnablePeriodicityX(const bool on=true)
Enable simple periodicity in the direction.
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.
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.
void IsRotationSymmetric(bool &rotx, bool &roty, bool &rotz)
Return rotation symmetry flags.
virtual bool GetElementNodes(const size_t, std::vector< size_t > &) const
Get the indices of the nodes constituting a given element.
virtual void ElectricField(const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status)=0
Calculate the drift field at given point.
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 ElectronVelocity(const double, const double, const double, double &vx, double &vy, double &vz)
Get the electron drift velocity.
void EnablePeriodicityY(const bool on=true)
Enable simple periodicity in the direction.
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,...
bool m_debug
Switch on/off debugging messages.
virtual bool Is3d()
Does the component have a 3D field (map)?
virtual void Clear()
Reset.
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.
virtual bool ElectronAttachment(const double, const double, const double, double &eta)
Get the electron attachment coefficient.
void EnablePeriodicityZ(const bool on=true)
Enable simple periodicity in the direction.
virtual bool GetVoltageRange(double &vmin, double &vmax)=0
Calculate the voltage range [V].
Component()=delete
Default constructor.
void EnableRotationSymmetryY(const bool on=true)
Enable rotation symmetry around the axis.
std::array< bool, 3 > m_periodic
Simple periodicity in x, y, z.
void EnableAxialPeriodicityY(const bool on=true)
Enable axial periodicity in the direction.
virtual void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label)
Calculate the weighting field at a given point and for a given electrode.
void EnableTriangleSymmetricYZ(const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
virtual bool ElectronTownsend(const double, const double, const double, double &alpha)
Get the electron Townsend 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?
void EnableRotationSymmetryZ(const bool on=true)
Enable rotation symmetry around the axis.
std::vector< double > m_wdtimes
Time steps at which the delayed weighting potentials/fields are stored.
void EnableAxialPeriodicityX(const bool on=true)
Enable axial 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 EnableDebugging(const bool on=true)
Switch on debugging messages.
void EnableMirrorPeriodicityY(const bool on=true)
Enable mirror periodicity in the direction.
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 bool HasTownsendMap() const
Does the component have maps of the Townsend coefficient?
virtual bool HoleAttachment(const double, const double, const double, double &eta)
Get the hole attachment coefficient.
virtual bool GetElementaryCell(double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax)
Get the coordinates of the elementary cell.
virtual bool HoleMobility(const double, const double, const double, double &mu)
Get the hole Mobility coefficient.
std::string m_className
Class name.
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.
void EnableTriangleSymmetricXY(const bool on=true, const bool oct=2)
Enable triangular periodicity in the plane.
Geometry * m_geometry
Pointer to the geometry.
virtual bool HoleTownsend(const double, const double, const double, double &alpha)
Get the hole Townsend coefficient.
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.
void IsPeriodic(bool &perx, bool &pery, bool &perz)
Return periodicity flags.
bool m_ready
Ready for use?
void SetMagneticField(const double bx, const double by, const double bz)
Set a constant magnetic field.
virtual bool HoleVelocity(const double, const double, const double, double &vx, double &vy, double &vz)
Get the hole drift velocity.
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.
std::array< double, 3 > m_b0
Constant magnetic field.
std::array< bool, 3 > m_axiallyPeriodic
Axial periodicity in x, y, z.
virtual bool IsReady()
Ready for use?
std::array< bool, 3 > m_triangleSymmetric
Triangle symmetric in the xy, xz, and yz plane.
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 StepSizeHint()
virtual void MagneticField(const double x, const double y, const double z, double &bx, double &by, double &bz, int &status)
Calculate the magnetic field at a given point.
virtual bool HasAttachmentMap() const
Does the component have maps of the attachment coefficient?
void EnableAxialPeriodicityZ(const bool on=true)
Enable axial periodicity in the direction.
virtual Medium * GetMedium(const double x, const double y, const double z)
Get the medium at a given location (x, y, z).
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.
virtual ~Component()=default
Destructor.
virtual void SetGeometry(Geometry *geo)
Define the geometry.
virtual const std::vector< double > & DelayedSignalTimes(const std::string &)
Return the time steps at which the delayed weighting potential/field are stored/evaluated.
void EnableRotationSymmetryX(const bool on=true)
Enable rotation symmetry around the axis.
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,...
virtual size_t GetNumberOfElements() const
Return the number of mesh elements.
virtual double ElectricPotential(const double x, const double y, const double z)
Calculate the (drift) electrostatic potential [V] at (x, y, z).
Abstract base class for geometry classes.
Abstract base class for components.