Garfield 0.3
Toolkit for the detailed simulation of particle detectors based on ionization measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ComponentTcad3d Class Reference

Interpolation in a three-dimensional field map created by Sentaurus Device. More...

#include <ComponentTcad3d.hh>

Inheritance diagram for Garfield::ComponentTcad3d:
Garfield::ComponentTcadBase< 3 >

Public Member Functions

 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
void ElectricField (const double x, const double y, const double z, double &ex, double &ey, double &ez, Medium *&m, int &status) override
Medium * GetMedium (const double x, const double y, const double z) override
void DelayedWeightingPotentials (const double x, const double y, const double z, const std::string &label, std::vector< double > &dwp) override
bool GetBoundingBox (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
bool GetElementaryCell (double &xmin, double &ymin, double &zmin, double &xmax, double &ymax, double &zmax) override
Public Member Functions inherited from Garfield::ComponentTcadBase< 3 >
 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
bool GetElementNodes (const size_t i, std::vector< size_t > &nodes) const override
bool GetElementRegion (const size_t i, size_t &region, bool &active) const override
size_t GetNumberOfNodes () const override
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
double WeightingPotential (const double x, const double y, const double z, const std::string &label) override
const std::vector< double > & DelayedSignalTimes (const std::string &label) override
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
double DelayedWeightingPotential (const double x, const double y, const double z, const double t, const std::string &label) override
bool GetVoltageRange (double &vmin, double &vmax) override
bool HasVelocityMap () const override
bool ElectronVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
bool HoleVelocity (const double x, const double y, const double z, double &vx, double &vy, double &vz) override
bool HasTownsendMap () const override
bool HasAttachmentMap () const override
bool HasMobilityMap () const override
bool ElectronAttachment (const double x, const double y, const double z, double &eta) override
bool HoleAttachment (const double x, const double y, const double z, double &eta) override
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
bool ElectronTownsend (const double x, const double y, const double z, double &alpha) override
bool HoleTownsend (const double x, const double y, const double z, double &alpha) override

Private Member Functions

void Reset () override
size_t FindElement (const double x, const double y, const double z, std::array< double, nMaxVertices > &w) const
bool InElement (const double x, const double y, const double z, const Element &element, std::array< double, nMaxVertices > &w) const
bool InTetrahedron (const double x, const double y, const double z, const Element &element, std::array< double, nMaxVertices > &w) const
bool InTriangle (const double x, const double y, const double z, const Element &element, std::array< double, nMaxVertices > &w) const
bool Interpolate (const double x, const double y, const double z, const std::vector< double > &field, double &f) override
bool Interpolate (const double x, const double y, const double z, const std::vector< std::array< double, 3 > > &field, double &fx, double &fy, double &fz) override
void FillTree () override

Private Attributes

std::unique_ptr< TetrahedralTree > m_tree

Additional Inherited Members

Protected Member Functions inherited from Garfield::ComponentTcadBase< 3 >
void UpdatePeriodicity () override
void Cleanup ()
size_t FindRegion (const std::string &name) const
void MapCoordinates (std::array< double, N > &x, std::array< bool, N > &mirr) const
bool InBoundingBox (const std::array< double, N > &x) const
void UpdateAttachment ()
void ComputeEtaFromLifetime ()
void ComputeEtaFromTraps ()
bool GetOffset (const std::string &label, double &dx, double &dy, double &dz) const
bool LoadGrid (const std::string &gridfilename)
bool LoadData (const std::string &datafilename)
bool ReadDataset (std::ifstream &datafile, const std::string &dataset)
bool LoadWeightingField (const std::string &datafilename, std::vector< std::array< double, N > > &wf, std::vector< double > &wp)
Static Protected Member Functions inherited from Garfield::ComponentTcadBase< 3 >
static unsigned int ElementVertices (const Element &element)
Protected Attributes inherited from Garfield::ComponentTcadBase< 3 >
std::vector< Region > m_regions
std::vector< std::array< double, N > > m_vertices
std::vector< Element > m_elements
std::vector< double > m_epot
std::vector< std::array< double, N > > m_efield
std::map< std::string, std::vector< std::array< double, N > > > m_wfield
std::map< std::string, std::vector< double > > m_wpot
std::map< std::string, std::vector< double > > m_wshift
std::map< std::string, std::vector< std::vector< std::array< double, N > > > > m_dwf
std::map< std::string, std::vector< std::vector< double > > > m_dwp
std::map< std::string, std::vector< double > > m_dwtf
std::map< std::string, std::vector< double > > m_dwtp
std::vector< std::array< double, N > > m_eVelocity
std::vector< std::array< double, N > > m_hVelocity
std::vector< double > m_eMobility
std::vector< double > m_hMobility
std::vector< double > m_eAlpha
std::vector< double > m_hAlpha
std::vector< double > m_eLifetime
std::vector< double > m_hLifetime
std::vector< std::vector< float > > m_donorOcc
std::vector< std::vector< float > > m_acceptorOcc
std::vector< double > m_eEta
std::vector< double > m_hEta
std::vector< Defect > m_donors
std::vector< Defect > m_acceptors
bool m_useVelocityMap
bool m_useTrapOccMap
bool m_useLifetimeMap
bool m_useAlphaMap
std::array< double, 3 > m_bbMin
std::array< double, 3 > m_bbMax
double m_pMin
double m_pMax
Static Protected Attributes inherited from Garfield::ComponentTcadBase< 3 >
static constexpr size_t nMaxVertices

Detailed Description

Interpolation in a three-dimensional field map created by Sentaurus Device.

Definition at line 15 of file ComponentTcad3d.hh.

Constructor & Destructor Documentation

◆ ComponentTcad3d()

Garfield::ComponentTcad3d::ComponentTcad3d ( )

Constructor.

◆ ~ComponentTcad3d()

Garfield::ComponentTcad3d::~ComponentTcad3d ( )
inline

Destructor.

Definition at line 20 of file ComponentTcad3d.hh.

20{}

Member Function Documentation

◆ DelayedWeightingPotentials()

void Garfield::ComponentTcad3d::DelayedWeightingPotentials ( const double x,
const double y,
const double z,
const std::string & label,
std::vector< double > & dwp )
override

◆ ElectricField() [1/2]

void Garfield::ComponentTcad3d::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
double & v,
Medium *& m,
int & status )
override

◆ ElectricField() [2/2]

void Garfield::ComponentTcad3d::ElectricField ( const double x,
const double y,
const double z,
double & ex,
double & ey,
double & ez,
Medium *& m,
int & status )
override

◆ FillTree()

void Garfield::ComponentTcad3d::FillTree ( )
overrideprivatevirtual

◆ FindElement()

size_t Garfield::ComponentTcad3d::FindElement ( const double x,
const double y,
const double z,
std::array< double, nMaxVertices > & w ) const
private

◆ GetBoundingBox()

bool Garfield::ComponentTcad3d::GetBoundingBox ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
override

◆ GetElement()

bool Garfield::ComponentTcad3d::GetElement ( const size_t i,
double & vol,
double & dmin,
double & dmax,
int & type ) const

Retrieve the properties of an element.

Parameters
iindex of the element
volvolume
dminsmallest length in the element
dmaxlargest length in the element
typeelement type

◆ GetElementaryCell()

bool Garfield::ComponentTcad3d::GetElementaryCell ( double & xmin,
double & ymin,
double & zmin,
double & xmax,
double & ymax,
double & zmax )
override

◆ GetMedium()

Medium * Garfield::ComponentTcad3d::GetMedium ( const double x,
const double y,
const double z )
override

◆ GetNode()

bool Garfield::ComponentTcad3d::GetNode ( const size_t i,
double & x,
double & y,
double & z ) const
override

Get the coordinates of a mesh node.

◆ InElement()

bool Garfield::ComponentTcad3d::InElement ( const double x,
const double y,
const double z,
const Element & element,
std::array< double, nMaxVertices > & w ) const
inlineprivate

Definition at line 61 of file ComponentTcad3d.hh.

63 {
64 if (x < element.bbMin[0] || x > element.bbMax[0] || y < element.bbMin[1] ||
65 y > element.bbMax[1] || z < element.bbMin[2] || z > element.bbMax[2]) {
66 return false;
67 }
68 bool inside = false;
69 switch (element.type) {
70 case 2:
71 if (InTriangle(x, y, z, element, w)) inside = true;
72 break;
73 case 5:
74 if (InTetrahedron(x, y, z, element, w)) inside = true;
75 break;
76 default:
77 std::cerr << m_className << "::InElement:\n"
78 << " Invalid element type (" << element.type << ").\n";
79 break;
80 }
81 return inside;
82 }
bool InTetrahedron(const double x, const double y, const double z, const Element &element, std::array< double, nMaxVertices > &w) const
bool InTriangle(const double x, const double y, const double z, const Element &element, std::array< double, nMaxVertices > &w) const

◆ Interpolate() [1/2]

bool Garfield::ComponentTcad3d::Interpolate ( const double x,
const double y,
const double z,
const std::vector< double > & field,
double & f )
overrideprivatevirtual

◆ Interpolate() [2/2]

bool Garfield::ComponentTcad3d::Interpolate ( const double x,
const double y,
const double z,
const std::vector< std::array< double, 3 > > & field,
double & fx,
double & fy,
double & fz )
overrideprivate

◆ InTetrahedron()

bool Garfield::ComponentTcad3d::InTetrahedron ( const double x,
const double y,
const double z,
const Element & element,
std::array< double, nMaxVertices > & w ) const
private

◆ InTriangle()

bool Garfield::ComponentTcad3d::InTriangle ( const double x,
const double y,
const double z,
const Element & element,
std::array< double, nMaxVertices > & w ) const
private

◆ Reset()

void Garfield::ComponentTcad3d::Reset ( )
inlineoverrideprivate

Definition at line 54 of file ComponentTcad3d.hh.

54 {
55 Cleanup();
56 m_ready = false;
57 }

Member Data Documentation

◆ m_tree

std::unique_ptr<TetrahedralTree> Garfield::ComponentTcad3d::m_tree
private

Definition at line 52 of file ComponentTcad3d.hh.


The documentation for this class was generated from the following file: