ComponentChargedRing ()
Constructor.
~ComponentChargedRing ()
Destructor.
void SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax)
Set the limits of the active area explicitly (instead of using a Geometry object).
void UnsetArea ()
Remove the explicit limits of the active area.
void SetMedium (Medium *medium)
Set the medium in the active area.
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
Calculate the drift field at given point.
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].
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
bool AddChargedRing (const double x, const double y, const double z, const double N)
Add a ring of charge N*e at x,y,z.
void SetSpacingTolerance (const double spacing_tolerance)
function to set the tolerance below which two rings are considered the same.
void SetSelfFieldTolerance (const double self_field_tolerance)
function to set the tolerance below which divergences are caught
void UpdateCentre (double x, double y)
Set the axis of symmetry.
void EnableDebugging ()
void ClearActiveRings ()
std::size_t GetNumberOfRings () const
const std::vector< Ring > & GetRings () const
std::array< double, 3 > ElectricField (const double x, const double y, const double z)
Calculate the drift field [V/cm] at (x, y, z).
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 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.
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 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.
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.
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.