ComponentTcad3d ()
Constructor.
~ComponentTcad3d ()
Destructor.
bool GetElement (const size_t i, double &vol, double &dmin, double &dmax, int &type) const
Retrieve the properties of an element.
bool GetNode (const size_t i, double &x, double &y, double &z) const override
Get the coordinates of a mesh node.
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.
Medium * GetMedium (const double x, const double y, const double z) override
Get the medium at a given location (x, y, z).
void DelayedWeightingPotentials (const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp) override
Calculate the delayed weighting potentials at a given point and for a given electrode, for a set of pre-defined times.
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the bounding box coordinates.
bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Get the coordinates of the elementary cell.
std::array< double, 3 > ElectricField (const double x, const double y, const double z)
Calculate the drift field [V/cm] at (x, y, z).
ComponentTcadBase ()=delete
Default constructor.
virtual ~ComponentTcadBase ()
Destructor.
bool Initialise (const std::string &gridfilename, const std::string &datafilename)
Import mesh and field map from files.
bool SetWeightingField (const std::string &datfile1, const std::string &datfile2, const double dv, const std::string &label)
Import field maps defining the prompt weighting field and potential.
bool SetWeightingPotential (const std::string &datfile1, const std::string &datfile2, const double dv, const std::string &label)
Import field maps defining the prompt weighting field and potential.
bool SetWeightingFieldShift (const std::string &label, const double x, const double y, const double z)
Shift the maps of weighting field/potential for a given electrode with respect to the original mesh.
bool SetDynamicWeightingPotential (const std::string &datfile1, const std::string &datfile2, const double dv, const double t, const std::string &label)
Import time-dependent weighting potentials at t >= 0.
bool SetDynamicWeightingField (const std::string &datfile1, const std::string &datfile2, const double dv, const double t, const std::string &label)
Import time-dependent weighting fields at t >= 0.
void PrintRegions () const
List all currently defined regions.
size_t GetNumberOfRegions () const
Get the number of regions in the device.
void GetRegion (const size_t ireg, std::string &name, bool &active) const
Get the name and "active volume" flag of a region.
void SetDriftRegion (const size_t ireg)
Make a region active ("driftable").
void UnsetDriftRegion (const size_t ireg)
Make a region inactive.
void SetMedium (const size_t ireg, Medium *m)
Set the medium to be associated to a given region.
size_t GetNumberOfElements () const override
Return the number of mesh elements.
bool GetElementNodes (const size_t i, std::vector< size_t > &nodes) const override
Get the indices of the nodes constituting a given element.
bool GetElementRegion (const size_t i, size_t ®ion, bool &active) const override
Get the region/material of a mesh element and a flag whether it is associated to an active medium.
size_t GetNumberOfNodes () const override
Return the number of mesh nodes.
void EnableVelocityMap (const bool on)
Switch use of the imported velocity map on/off.
size_t GetNumberOfDonors ()
Get the number of donor states found in the map.
size_t GetNumberOfAcceptors ()
Get the number of acceptor states found in the map.
bool SetDonor (const size_t donorNumber, const double exsec, const double hxsec, const double concentration)
Set the properties of a donor-type defect state.
bool SetAcceptor (const size_t acceptorNumber, const double exsec, const double hxsec, const double concentration)
Set the properties of an acceptor-type defect state.
void EnableAlphaMap (const bool on=true)
Use the imported impact ionisation map or not.
void EnableTrapOccupationMap (const bool on=true)
Use the imported trapping map or not.
void EnableLifetimeMap (const bool on=true)
Use the imported lifetime map or not.
bool GetElectronMobility (const double x, const double y, const double z, double &mob)
Get the electron mobility at a given point in the mesh.
bool GetHoleMobility (const double x, const double y, const double z, double &mob)
Get the hole mobility at a given point in the mesh.
double ElectronLifetime (const double x, const double y, const double z)
double HoleLifetime (const double x, const double y, const double z)
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.
const std::vector< double > & DelayedSignalTimes (const std::string &label) override
Return the time steps at which the delayed weighting potential/field are stored/evaluated.
void DelayedWeightingField (const double x, const double y, const double z, const double t, double &wx, double &wy, double &wz, const std::string &label) override
Calculate the delayed weighting field at a given point and time and for a given electrode.
double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label) override
Calculate the delayed weighting potential at a given point and time and for a given electrode.
bool GetVoltageRange (double &vmin, double &vmax) override
Calculate the voltage range [V].
bool HasVelocityMap () const override
Does the component have velocity maps?
bool ElectronVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
Get the electron drift velocity.
bool HoleVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
Get the hole drift velocity.
bool HasTownsendMap () const override
Does the component have maps of the Townsend coefficient?
bool HasAttachmentMap () const override
Does the component have maps of the attachment coefficient?
bool HasMobilityMap () const override
Does the component have maps of the low-field mobility?
bool ElectronAttachment (const double x, const double y, const double z, double &eta) override
Get the electron attachment coefficient.
bool HoleAttachment (const double x, const double y, const double z, double &eta) override
Get the hole attachment coefficient.
bool ElectronMobility (const double x, const double y, const double z, double &mu) override
bool HoleMobility (const double x, const double y, const double z, double &mu) override
Get the hole Mobility coefficient.
bool ElectronTownsend (const double x, const double y, const double z, double &alpha) override
Get the electron Townsend coefficient.
bool HoleTownsend (const double x, const double y, const double z, double &alpha) override
Get the hole Townsend coefficient.
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 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)?
double CellSizeX ()
double CellSizeY ()
double CellSizeZ ()
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 double StepSizeHint ()
virtual double CreateGPUTransferObject (ComponentGPU *&comp_gpu)
Create and initialise GPU Transfer class.