1#ifndef G_COMPONENT_TCAD_BASE_H
2#define G_COMPONENT_TCAD_BASE_H
31 bool Initialise(
const std::string& gridfilename,
32 const std::string& datafilename);
45 const std::string& datfile2,
const double dv,
46 const std::string& label);
51 const double x,
const double y,
const double z);
54 const std::string& datfile2,
const double dv,
55 const double t,
const std::string& label);
58 const std::string& datfile2,
const double dv,
59 const double t,
const std::string& label);
66 void GetRegion(
const size_t ireg, std::string& name,
bool& active)
const;
95 bool SetDonor(
const size_t donorNumber,
const double exsec,
96 const double hxsec,
const double concentration);
98 bool SetAcceptor(
const size_t acceptorNumber,
const double exsec,
99 const double hxsec,
const double concentration);
114 void WeightingField(
const double x,
const double y,
const double z,
115 double& wx,
double& wy,
double& wz,
116 const std::string& label)
override;
118 const std::string& label)
override;
120 const double z,
const double t,
double& wx,
121 double& wy,
double& wz,
122 const std::string& label)
override;
124 const double z,
const double t,
125 const std::string& label)
override;
133 double& vx,
double& vy,
double& vz)
override;
134 bool HoleVelocity(
const double x,
const double y,
const double z,
135 double& vx,
double& vy,
double& vz)
override;
144 double& eta)
override;
145 bool HoleAttachment(
const double x,
const double y,
const double z,
146 double& eta)
override;
149 double& etau)
override;
151 double& htau)
override;
154 double& alpha)
override;
155 bool HoleTownsend(
const double x,
const double y,
const double z,
156 double& alpha)
override;
218 std::vector<std::vector<std::array<double, N> > >
m_dwf;
219 std::vector<std::vector<double> >
m_dwp;
262 std::array<double, 3>
m_bbMin = {{0., 0., 0.}};
263 std::array<double, 3>
m_bbMax = {{0., 0., 0.}};
274 return std::min(element.
type + 1, 4U);
276 virtual bool Interpolate(
const double x,
const double y,
const double z,
277 const std::vector<double>& field,
double& f) = 0;
278 virtual bool Interpolate(
const double x,
const double y,
const double z,
279 const std::vector<std::array<double, N> >& field,
280 double& fx,
double& fy,
double& fz) = 0;
283 size_t FindRegion(
const std::string& name)
const;
285 std::array<bool, N>& mirr)
const;
287 for (
size_t i = 0; i < N; ++i) {
294 bool LoadGrid(
const std::string& gridfilename);
295 bool LoadData(
const std::string& datafilename);
296 bool ReadDataset(std::ifstream& datafile,
const std::string& dataset);
298 std::vector<std::array<double, N> >& wf,
299 std::vector<double>& wp);
302 double& dx,
double& dy,
double& dz)
const;
bool GetElectronLifetime(const double x, const double y, const double z, double &etau) override
bool InBoundingBox(const std::array< double, N > &x) const
std::vector< double > m_hMobility
bool HasTownsendMap() const override
Does the component have maps of the Townsend coefficient?
bool LoadGrid(const std::string &gridfilename)
bool SetWeightingPotential(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.
void GetRegion(const size_t ireg, std::string &name, bool &active) const
Get the name and "active volume" flag of a region.
void UnsetDriftRegion(const size_t ireg)
Make a region inactive.
ComponentTcadBase(const std::string &name)
Constructor.
std::vector< Defect > m_acceptors
virtual void FillTree()=0
std::vector< double > m_dwtf
std::vector< std::vector< float > > m_acceptorOcc
double WeightingPotential(const double x, const double y, const double z, const std::string &label) override
std::vector< std::string > m_wlabel
size_t FindRegion(const std::string &name) const
std::vector< std::array< double, 3 > > m_wshift
virtual bool Interpolate(const double x, const double y, const double z, const std::vector< double > &field, double &f)=0
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 HasVelocityMap() const override
Does the component have velocity maps?
std::vector< std::vector< float > > m_donorOcc
std::vector< std::array< double, N > > m_vertices
bool GetHoleMobility(const double x, const double y, const double z, double &mob)
Get the hole mobility at a given point in the mesh.
bool SetWeightingField(const std::string &datfile1, const std::string &datfile2, const double dv, const std::string &label)
std::vector< Element > m_elements
void EnableVelocityMap(const bool on)
Switch use of the imported velocity map on/off.
bool GetVoltageRange(double &vmin, double &vmax) override
Calculate the voltage range [V].
bool HoleAttachment(const double x, const double y, const double z, double &eta) override
Get the hole attachment coefficient.
std::vector< std::vector< double > > m_dwp
std::vector< double > m_eAttachment
std::vector< double > m_hAlpha
std::vector< Region > m_regions
bool HoleTownsend(const double x, const double y, const double z, double &alpha) override
Get the hole Townsend coefficient.
std::vector< double > m_eAlpha
bool LoadWeightingField(const std::string &datafilename, std::vector< std::array< double, N > > &wf, std::vector< double > &wp)
std::vector< std::array< double, N > > m_hVelocity
static unsigned int ElementVertices(const Element &element)
std::array< double, 3 > m_bbMax
bool ReadDataset(std::ifstream &datafile, const std::string &dataset)
size_t GetNumberOfNodes() const
Get the number of vertices in the mesh.
static constexpr size_t nMaxVertices
size_t GetNumberOfRegions() const
Get the number of regions in the device.
std::vector< double > m_epot
bool LoadData(const std::string &datafilename)
std::vector< std::array< double, N > > m_efield
std::vector< std::array< double, N > > m_eVelocity
std::vector< double > m_hLifetime
size_t GetNumberOfDonors()
Get the number of donor states found in the map.
bool GetHoleLifetime(const double x, const double y, const double z, double &htau) override
bool GetOffset(const std::string &label, double &dx, double &dy, double &dz) const
void MapCoordinates(std::array< double, N > &x, std::array< bool, N > &mirr) const
void PrintRegions() const
List all currently defined regions.
std::vector< double > m_wpot
void EnableAttachmentMap(const bool on)
Switch use of the imported trapping map on/off.
virtual bool Interpolate(const double x, const double y, const double z, const std::vector< std::array< double, N > > &field, double &fx, double &fy, double &fz)=0
bool SetAcceptor(const size_t acceptorNumber, const double exsec, const double hxsec, const double concentration)
Set the properties of an acceptor-type defect state.
ComponentTcadBase()=delete
Default constructor.
bool ElectronAttachment(const double x, const double y, const double z, double &eta) override
Get the electron attachment coefficient.
std::vector< std::vector< std::array< double, N > > > m_dwf
void EnableAlphaMap(const bool on)
Switch use of the imported impact ionisation map on/off.
std::vector< Defect > m_donors
size_t GetNumberOfElements() const
Get the number of elements in the mesh.
size_t GetNumberOfAcceptors()
Get the number of acceptor states found in the map.
bool HasAttachmentMap() const override
Does the component have attachment maps?
bool SetWeightingFieldShift(const std::string &label, const double x, const double y, const double z)
bool Initialise(const std::string &gridfilename, const std::string &datafilename)
std::vector< double > m_eMobility
virtual ~ComponentTcadBase()
Destructor.
void UpdatePeriodicity() override
Verify periodicities.
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
bool ElectronVelocity(const double x, const double y, const double z, double &vx, double &vy, double &vz) override
Get the electron drift velocity.
double DelayedWeightingPotential(const double x, const double y, const double z, const double t, const std::string &label) override
void SetDriftRegion(const size_t ireg)
Make a region active ("driftable").
bool HoleVelocity(const double x, const double y, const double z, double &vx, double &vy, double &vz) override
Get the hole drift velocity.
std::vector< std::array< double, N > > m_wfield
std::vector< double > m_dwtp
bool SetDonor(const size_t donorNumber, const double exsec, const double hxsec, const double concentration)
void SetMedium(const size_t ireg, Medium *m)
Set the medium to be associated to a given region.
bool ElectronTownsend(const double x, const double y, const double z, double &alpha) override
Get the electron Townsend coefficient.
void WeightingField(const double x, const double y, const double z, double &wx, double &wy, double &wz, const std::string &label) override
std::vector< double > m_hAttachment
std::array< double, 3 > m_bbMin
std::vector< double > m_eLifetime
Component()=delete
Default constructor.
Abstract base class for media.
std::array< float, N > bbMin
std::array< float, N > bbMax
unsigned int vertex[nMaxVertices]