Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Medium.hh
Go to the documentation of this file.
1#ifndef G_MEDIUM_H
2#define G_MEDIUM_H
3
4#include <string>
5#include <vector>
6
8
9namespace Garfield {
10
11/// Abstract base class for media.
12
13class Medium {
14 public:
15 /// Constructor
16 Medium();
17 /// Destructor
18 virtual ~Medium();
19
20 /// Return the id number of the class instance.
21 int GetId() const { return m_id; }
22 /// Get the medium name/identifier.
23 const std::string& GetName() const { return m_name; }
24 /// Is this medium a gas?
25 virtual bool IsGas() const { return false; }
26 /// Is this medium a semiconductor?
27 virtual bool IsSemiconductor() const { return false; }
28 /// Is this medium a conductor?
29 virtual bool IsConductor() const { return false; }
30
31 /// Set the temperature [K].
32 void SetTemperature(const double t);
33 /// Get the temperature [K].
34 double GetTemperature() const { return m_temperature; }
35 // Set the pressure [Torr].
36 void SetPressure(const double p);
37 // Get the pressure [Torr].
38 double GetPressure() const { return m_pressure; }
39 /// Set the relative static dielectric constant.
40 void SetDielectricConstant(const double eps);
41 /// Get the relative static dielectric constant.
42 double GetDielectricConstant() const { return m_epsilon; }
43
44 /// Get number of components of the medium.
45 unsigned int GetNumberOfComponents() const { return m_nComponents; }
46 /// Get the name and fraction of a given component.
47 virtual void GetComponent(const unsigned int i, std::string& label,
48 double& f);
49 /// Set the effective atomic number.
50 virtual void SetAtomicNumber(const double z);
51 /// Get the effective atomic number.
52 virtual double GetAtomicNumber() const { return m_z; }
53 /// Set the effective atomic weight.
54 virtual void SetAtomicWeight(const double a);
55 /// Get the effective atomic weight.
56 virtual double GetAtomicWeight() const { return m_a; }
57 /// Set the number density [cm-3].
58 virtual void SetNumberDensity(const double n);
59 /// Get the number density [cm-3].
60 virtual double GetNumberDensity() const { return m_density; }
61 /// Set the mass density [g/cm3].
62 virtual void SetMassDensity(const double rho);
63 /// Get the mass density [g/cm3].
64 virtual double GetMassDensity() const;
65
66 /// Switch electron/ion/hole on/off.
67 virtual void EnableDrift(const bool on = true) { m_driftable = on; }
68 /// Make the medium ionisable or non-ionisable.
69 virtual void EnablePrimaryIonisation(const bool on = true) {
70 m_ionisable = on;
71 }
72
73 /// Is charge carrier transport enabled in this medium?
74 bool IsDriftable() const { return m_driftable; }
75 /// Does the medium have electron scattering rates?
76 bool IsMicroscopic() const { return m_microscopic; }
77 /// Is charge deposition by charged particles/photon enabled in this medium?
78 bool IsIonisable() const { return m_ionisable; }
79
80 /// Set the W value (average energy to produce an electron/ion or e/h pair).
81 void SetW(const double w) { m_w = w; }
82 /// Get the W value.
83 double GetW() { return m_w; }
84 /// Set the Fano factor.
85 void SetFanoFactor(const double f) { m_fano = f; }
86 /// Get the Fano factor.
87 double GetFanoFactor() { return m_fano; }
88
89 // Transport parameters for electrons
90 /// Drift velocity [cm / ns]
91 virtual bool ElectronVelocity(const double ex, const double ey,
92 const double ez, const double bx,
93 const double by, const double bz, double& vx,
94 double& vy, double& vz);
95 /// Longitudinal and transverse diffusion coefficients [cm1/2]
96 virtual bool ElectronDiffusion(const double ex, const double ey,
97 const double ez, const double bx,
98 const double by, const double bz, double& dl,
99 double& dt);
100 /// Diffusion tensor: diagonal elements are the diffusion
101 /// coefficients [cm] along e, btrans, e x b,
102 /// off-diagonal elements are the covariances
103 virtual bool ElectronDiffusion(const double ex, const double ey,
104 const double ez, const double bx,
105 const double by, const double bz,
106 double cov[3][3]);
107 /// Ionisation coefficient [cm-1]
108 virtual bool ElectronTownsend(const double ex, const double ey,
109 const double ez, const double bx,
110 const double by, const double bz,
111 double& alpha);
112 /// Attachment coefficient [cm-1]
113 virtual bool ElectronAttachment(const double ex, const double ey,
114 const double ez, const double bx,
115 const double by, const double bz,
116 double& eta);
117 /// Lorentz angle
118 virtual bool ElectronLorentzAngle(const double ex, const double ey,
119 const double ez, const double bx,
120 const double by, const double bz,
121 double& lor);
122 /// Low-field mobility [cm2 V-1 ns-1]
123 virtual double ElectronMobility();
124 // Microscopic electron transport properties
125
126 /// Dispersion relation (energy vs. wave vector)
127 virtual double GetElectronEnergy(const double px, const double py,
128 const double pz, double& vx, double& vy,
129 double& vz, const int band = 0);
130 /// Sample the momentum vector for a given energy
131 /// (only meaningful in semiconductors).
132 virtual void GetElectronMomentum(const double e, double& px, double& py,
133 double& pz, int& band);
134
135 /// Null-collision rate [ns-1]
136 virtual double GetElectronNullCollisionRate(const int band = 0);
137 /// Collision rate [ns-1] for given electron energy
138 virtual double GetElectronCollisionRate(const double e, const int band = 0);
139 /// Sample the collision type. Update energy and direction vector.
140 virtual bool GetElectronCollision(
141 const double e, int& type, int& level, double& e1, double& dx, double& dy,
142 double& dz, std::vector<std::pair<int, double> >& secondaries, int& ndxc,
143 int& band);
144 virtual unsigned int GetNumberOfDeexcitationProducts() const { return 0; }
145 virtual bool GetDeexcitationProduct(const unsigned int i, double& t,
146 double& s, int& type,
147 double& energy) const;
148
149 // Transport parameters for holes
150 /// Drift velocity [cm / ns]
151 virtual bool HoleVelocity(const double ex, const double ey, const double ez,
152 const double bx, const double by, const double bz,
153 double& vx, double& vy, double& vz);
154 /// Longitudinal and transverse diffusion coefficients [cm1/2]
155 virtual bool HoleDiffusion(const double ex, const double ey, const double ez,
156 const double bx, const double by, const double bz,
157 double& dl, double& dt);
158 /// Diffusion tensor
159 virtual bool HoleDiffusion(const double ex, const double ey, const double ez,
160 const double bx, const double by, const double bz,
161 double cov[3][3]);
162 /// Ionisation coefficient [cm-1]
163 virtual bool HoleTownsend(const double ex, const double ey, const double ez,
164 const double bx, const double by, const double bz,
165 double& alpha);
166 /// Attachment coefficient [cm-1]
167 virtual bool HoleAttachment(const double ex, const double ey, const double ez,
168 const double bx, const double by, const double bz,
169 double& eta);
170 /// Low-field mobility [cm2 V-1 ns-1]
171 virtual double HoleMobility();
172
173 // Transport parameters for ions
174 /// Drift velocity [cm / ns]
175 virtual bool IonVelocity(const double ex, const double ey, const double ez,
176 const double bx, const double by, const double bz,
177 double& vx, double& vy, double& vz);
178 /// Longitudinal and transverse diffusion coefficients [cm1/2]
179 virtual bool IonDiffusion(const double ex, const double ey, const double ez,
180 const double bx, const double by, const double bz,
181 double& dl, double& dt);
182 /// Dissociation coefficient
183 virtual bool IonDissociation(const double ex, const double ey,
184 const double ez, const double bx,
185 const double by, const double bz, double& diss);
186 /// Low-field mobility [cm2 V-1 ns-1]
187 virtual double IonMobility();
188
189 /// Set the range of fields to be covered by the transport tables.
190 void SetFieldGrid(double emin, double emax, const size_t ne, bool logE,
191 double bmin = 0., double bmax = 0., const size_t nb = 1,
192 double amin = HalfPi, double amax = HalfPi,
193 const size_t na = 1);
194 /// Set the fields and E-B angles to be used in the transport tables.
195 void SetFieldGrid(const std::vector<double>& efields,
196 const std::vector<double>& bfields,
197 const std::vector<double>& angles);
198 /// Get the fields and E-B angles used in the transport tables.
199 void GetFieldGrid(std::vector<double>& efields, std::vector<double>& bfields,
200 std::vector<double>& angles);
201
202 /// Set an entry in the table of drift speeds along E.
203 bool SetElectronVelocityE(const size_t ie, const size_t ib,
204 const size_t ia, const double v) {
205 return SetEntry(ie, ib, ia, "ElectronVelocityE", m_eVelE, v);
206 }
207 /// Get an entry in the table of drift speeds along E.
208 bool GetElectronVelocityE(const size_t ie, const size_t ib,
209 const size_t ia, double& v) {
210 return GetEntry(ie, ib, ia, "ElectronVelocityE", m_eVelE, v);
211 }
212 /// Set an entry in the table of drift speeds along ExB.
213 bool SetElectronVelocityExB(const size_t ie, const size_t ib,
214 const size_t ia, const double v) {
215 return SetEntry(ie, ib, ia, "ElectronVelocityExB", m_eVelX, v);
216 }
217 /// Get an entry in the table of drift speeds along ExB.
218 bool GetElectronVelocityExB(const size_t ie, const size_t ib,
219 const size_t ia, double& v) {
220 return GetEntry(ie, ib, ia, "ElectronVelocityExB", m_eVelX, v);
221 }
222 /// Set an entry in the table of drift speeds along Btrans.
223 bool SetElectronVelocityB(const size_t ie, const size_t ib,
224 const size_t ia, const double v) {
225 return SetEntry(ie, ib, ia, "ElectronVelocityB", m_eVelB, v);
226 }
227 /// Get an entry in the table of drift speeds along Btrans.
228 bool GetElectronVelocityB(const size_t ie, const size_t ib,
229 const size_t ia, double& v) {
230 return GetEntry(ie, ib, ia, "ElectronVelocityB", m_eVelB, v);
231 }
232 /// Set an entry in the table of longitudinal diffusion coefficients.
233 bool SetElectronLongitudinalDiffusion(const size_t ie, const size_t ib,
234 const size_t ia, const double dl) {
235 return SetEntry(ie, ib, ia, "ElectronLongitudinalDiffusion", m_eDifL, dl);
236 }
237 /// Get an entry in the table of longitudinal diffusion coefficients.
238 bool GetElectronLongitudinalDiffusion(const size_t ie, const size_t ib,
239 const size_t ia, double& dl) {
240 return GetEntry(ie, ib, ia, "ElectronLongitudinalDiffusion", m_eDifL, dl);
241 }
242 /// Set an entry in the table of transverse diffusion coefficients.
243 bool SetElectronTransverseDiffusion(const size_t ie, const size_t ib,
244 const size_t ia, const double dt) {
245 return SetEntry(ie, ib, ia, "ElectronTransverseDiffusion", m_eDifT, dt);
246 }
247 /// Get an entry in the table of transverse diffusion coefficients.
248 bool GetElectronTransverseDiffusion(const size_t ie, const size_t ib,
249 const size_t ia, double& dt) {
250 return GetEntry(ie, ib, ia, "ElectronTransverseDiffusion", m_eDifT, dt);
251 }
252 /// Set an entry in the table of Townsend coefficients.
253 bool SetElectronTownsend(const size_t ie, const size_t ib,
254 const size_t ia, const double alpha) {
255 return SetEntry(ie, ib, ia, "ElectronTownsend", m_eAlp, alpha);
256 }
257 /// Get an entry in the table of Townsend coefficients.
258 bool GetElectronTownsend(const size_t ie, const size_t ib,
259 const size_t ia, double& alpha) {
260 return GetEntry(ie, ib, ia, "ElectronTownsend", m_eAlp, alpha);
261 }
262 /// Set an entry in the table of attachment coefficients.
263 bool SetElectronAttachment(const size_t ie, const size_t ib,
264 const size_t ia, const double eta) {
265 return SetEntry(ie, ib, ia, "ElectronAttachment", m_eAtt, eta);
266 }
267 /// Get an entry in the table of attachment coefficients.
268 bool GetElectronAttachment(const size_t ie, const size_t ib,
269 const size_t ia, double& eta) {
270 return GetEntry(ie, ib, ia, "ElectronAttachment", m_eAtt, eta);
271 }
272
273 /// Set an entry in the table of Lorentz angles.
274 bool SetElectronLorentzAngle(const size_t ie, const size_t ib,
275 const size_t ia, const double lor) {
276 return SetEntry(ie, ib, ia, "ElectronLorentzAngle", m_eLor, lor);
277 }
278 /// Get an entry in the table of Lorentz angles.
279 bool GetElectronLorentzAngle(const size_t ie, const size_t ib,
280 const size_t ia, double& lor) {
281 return GetEntry(ie, ib, ia, "ElectronLorentzAngle", m_eLor, lor);
282 }
283
284 /// Set an entry in the table of drift speeds along E.
285 bool SetHoleVelocityE(const size_t ie, const size_t ib,
286 const size_t ia, const double v) {
287 return SetEntry(ie, ib, ia, "HoleVelocityE", m_hVelE, v);
288 }
289 /// Get an entry in the table of drift speeds along E.
290 bool GetHoleVelocityE(const size_t ie, const size_t ib,
291 const size_t ia, double& v) {
292 return GetEntry(ie, ib, ia, "HoleVelocityE", m_hVelE, v);
293 }
294 /// Set an entry in the table of drift speeds along ExB.
295 bool SetHoleVelocityExB(const size_t ie, const size_t ib,
296 const size_t ia, const double v) {
297 return SetEntry(ie, ib, ia, "HoleVelocityExB", m_hVelX, v);
298 }
299 /// Get an entry in the table of drift speeds along ExB.
300 bool GetHoleVelocityExB(const size_t ie, const size_t ib,
301 const size_t ia, double& v) {
302 return GetEntry(ie, ib, ia, "HoleVelocityExB", m_hVelX, v);
303 }
304 /// Set an entry in the table of drift speeds along Btrans.
305 bool SetHoleVelocityB(const size_t ie, const size_t ib,
306 const size_t ia, const double v) {
307 return SetEntry(ie, ib, ia, "HoleVelocityB", m_hVelB, v);
308 }
309 /// Get an entry in the table of drift speeds along Btrans.
310 bool GetHoleVelocityB(const size_t ie, const size_t ib,
311 const size_t ia, double& v) {
312 return GetEntry(ie, ib, ia, "HoleVelocityB", m_hVelB, v);
313 }
314
315 /// Set an entry in the table of longitudinal diffusion coefficients.
316 bool SetHoleLongitudinalDiffusion(const size_t ie, const size_t ib,
317 const size_t ia, const double dl) {
318 return SetEntry(ie, ib, ia, "HoleLongitudinalDiffusion", m_hDifL, dl);
319 }
320 /// Get an entry in the table of longitudinal diffusion coefficients.
321 bool GetHoleLongitudinalDiffusion(const size_t ie, const size_t ib,
322 const size_t ia, double& dl) {
323 return GetEntry(ie, ib, ia, "HoleLongitudinalDiffusion", m_hDifL, dl);
324 }
325 /// Set an entry in the table of transverse diffusion coefficients.
326 bool SetHoleTransverseDiffusion(const size_t ie, const size_t ib,
327 const size_t ia, const double dt) {
328 return SetEntry(ie, ib, ia, "HoleTransverseDiffusion", m_hDifT, dt);
329 }
330 /// Get an entry in the table of transverse diffusion coefficients.
331 bool GetHoleTransverseDiffusion(const size_t ie, const size_t ib,
332 const size_t ia, double& dt) {
333 return GetEntry(ie, ib, ia, "HoleTransverseDiffusion", m_hDifT, dt);
334 }
335 /// Set an entry in the table of Townsend coefficients.
336 bool SetHoleTownsend(const size_t ie, const size_t ib,
337 const size_t ia, const double alpha) {
338 return SetEntry(ie, ib, ia, "HoleTownsend", m_hAlp, alpha);
339 }
340 /// Get an entry in the table of Townsend coefficients.
341 bool GetHoleTownsend(const size_t ie, const size_t ib,
342 const size_t ia, double& alpha) {
343 return GetEntry(ie, ib, ia, "HoleTownsend", m_hAlp, alpha);
344 }
345 /// Set an entry in the table of attachment coefficients.
346 bool SetHoleAttachment(const size_t ie, const size_t ib,
347 const size_t ia, const double eta) {
348 return SetEntry(ie, ib, ia, "HoleAttachment", m_hAtt, eta);
349 }
350 /// Get an entry in the table of attachment coefficients.
351 bool GetHoleAttachment(const size_t ie, const size_t ib,
352 const size_t ia, double& eta) {
353 return GetEntry(ie, ib, ia, "HoleAttachment", m_hAtt, eta);
354 }
355
356 /// Initialise the table of ion mobilities from a list of
357 /// electric fields and corresponding mobilities.
358 /// The mobilities will be interpolated at the electric fields
359 /// of the currently set grid.
360 bool SetIonMobility(const std::vector<double>& fields,
361 const std::vector<double>& mobilities);
362 /// Set an entry in the table of ion mobilities.
363 bool SetIonMobility(const size_t ie, const size_t ib,
364 const size_t ia, const double mu);
365 /// Get an entry in the table of ion mobilities.
366 bool GetIonMobility(const size_t ie, const size_t ib,
367 const size_t ia, double& mu) {
368 return GetEntry(ie, ib, ia, "IonMobility", m_iMob, mu);
369 }
370
371 /// Set an entry in the table of longitudinal diffusion coefficients.
372 bool SetIonLongitudinalDiffusion(const size_t ie, const size_t ib,
373 const size_t ia, const double dl) {
374 return SetEntry(ie, ib, ia, "IonLongitudinalDiffusion", m_iDifL, dl);
375 }
376 /// Get an entry in the table of longitudinal diffusion coefficients.
377 bool GetIonLongitudinalDiffusion(const size_t ie, const size_t ib,
378 const size_t ia, double& dl) {
379 return GetEntry(ie, ib, ia, "IonLongitudinalDiffusion", m_iDifL, dl);
380 }
381 /// Set an entry in the table of transverse diffusion coefficients.
382 bool SetIonTransverseDiffusion(const size_t ie, const size_t ib,
383 const size_t ia, const double dt) {
384 return SetEntry(ie, ib, ia, "IonTransverseDiffusion", m_iDifT, dt);
385 }
386 /// Get an entry in the table of transverse diffusion coefficients.
387 bool GetIonTransverseDiffusion(const size_t ie, const size_t ib,
388 const size_t ia, double& dt) {
389 return GetEntry(ie, ib, ia, "IonTransverseDiffusion", m_iDifT, dt);
390 }
391 /// Set an entry in the table of dissociation coefficients.
392 bool SetIonDissociation(const size_t ie, const size_t ib,
393 const size_t ia, const double diss) {
394 return SetEntry(ie, ib, ia, "IonDissociation", m_iDis, diss);
395 }
396 /// Get an entry in the table of dissociation coefficients.
397 bool GetIonDissociation(const size_t ie, const size_t ib,
398 const size_t ia, double& diss) {
399 return GetEntry(ie, ib, ia, "IonDissociation", m_iDis, diss);
400 }
401
402 /// Reset all tables of transport parameters.
403 virtual void ResetTables();
404
406 m_eVelE.clear();
407 m_eVelB.clear();
408 m_eVelX.clear();
409 }
411 m_eDifL.clear();
412 m_eDifT.clear();
413 m_eDifM.clear();
414 }
415 void ResetElectronTownsend() { m_eAlp.clear(); }
416 void ResetElectronAttachment() { m_eAtt.clear(); }
418
420 m_hVelE.clear();
421 m_hVelB.clear();
422 m_hVelX.clear();
423 }
425 m_hDifL.clear();
426 m_hDifT.clear();
427 m_hDifM.clear();
428 }
429 void ResetHoleTownsend() { m_hAlp.clear(); }
430 void ResetHoleAttachment() { m_hAtt.clear(); }
431
432 void ResetIonMobility() { m_iMob.clear(); }
434 m_iDifL.clear();
435 m_iDifT.clear();
436 }
437 void ResetIonDissociation() { m_iDis.clear(); }
438
439 /// Select the extrapolation method for fields below/above the table range.
440 /// Possible options are "constant", "linear", and "exponential".
441 void SetExtrapolationMethodVelocity(const std::string& extrLow,
442 const std::string& extrHigh);
443 void SetExtrapolationMethodDiffusion(const std::string& extrLow,
444 const std::string& extrHigh);
445 void SetExtrapolationMethodTownsend(const std::string& extrLow,
446 const std::string& extrHigh);
447 void SetExtrapolationMethodAttachment(const std::string& extrLow,
448 const std::string& extrHigh);
449 void SetExtrapolationMethodIonMobility(const std::string& extrLow,
450 const std::string& extrHigh);
451 void SetExtrapolationMethodIonDissociation(const std::string& extrLow,
452 const std::string& extrHigh);
453
454 /// Set the degree of polynomial interpolation (usually 2).
455 void SetInterpolationMethodVelocity(const unsigned int intrp);
456 void SetInterpolationMethodDiffusion(const unsigned int intrp);
457 void SetInterpolationMethodTownsend(const unsigned int intrp);
458 void SetInterpolationMethodAttachment(const unsigned int intrp);
459 void SetInterpolationMethodIonMobility(const unsigned int intrp);
460 void SetInterpolationMethodIonDissociation(const unsigned int intrp);
461
462 // Scaling of fields and transport parameters.
463 virtual double ScaleElectricField(const double e) const { return e; }
464 virtual double UnScaleElectricField(const double e) const { return e; }
465 virtual double ScaleVelocity(const double v) const { return v; }
466 virtual double ScaleDiffusion(const double d) const { return d; }
467 virtual double ScaleDiffusionTensor(const double d) const { return d; }
468 virtual double ScaleTownsend(const double alpha) const { return alpha; }
469 virtual double ScaleAttachment(const double eta) const { return eta; }
470 virtual double ScaleLorentzAngle(const double lor) const { return lor; }
471 virtual double ScaleDissociation(const double diss) const { return diss; }
472
473 // Optical properties
474 /// Get the energy range [eV] of the available optical data.
475 virtual bool GetOpticalDataRange(double& emin, double& emax,
476 const unsigned int i = 0);
477 /// Get the complex dielectric function at a given energy.
478 virtual bool GetDielectricFunction(const double e, double& eps1, double& eps2,
479 const unsigned int i = 0);
480 // Get the photoabsorption cross-section [cm2] at a given energy.
481 virtual bool GetPhotoAbsorptionCrossSection(const double e, double& sigma,
482 const unsigned int i = 0);
483 virtual double GetPhotonCollisionRate(const double e);
484 virtual bool GetPhotonCollision(const double e, int& type, int& level,
485 double& e1, double& ctheta, int& nsec,
486 double& esec);
487
488 /// Switch on/off debugging messages
489 void EnableDebugging() { m_debug = true; }
490 void DisableDebugging() { m_debug = false; }
491
492 protected:
493 std::string m_className = "Medium";
494
495 static int m_idCounter;
496
497 // Id number
498 int m_id;
499 // Number of components
500 unsigned int m_nComponents = 1;
501 // Name
502 std::string m_name = "";
503 // Temperature [K]
504 double m_temperature = 293.15;
505 // Pressure [Torr]
506 double m_pressure = 760.;
507 // Static dielectric constant
508 double m_epsilon = 1.;
509 // (Effective) atomic number Z
510 double m_z = 1.;
511 // Atomic weight A
512 double m_a = 0.;
513 // Number density [cm-3]
514 double m_density = 0.;
515
516 // W value
517 double m_w = 0.;
518 // Fano factor
519 double m_fano = 0.;
520
521 // Transport flags
522 bool m_driftable = false;
523 bool m_microscopic = false;
524 bool m_ionisable = false;
525
526 // Update flag
527 bool m_isChanged = true;
528
529 // Switch on/off debugging messages
530 bool m_debug = false;
531
532 // Tables of transport parameters
533 bool m_tab2d = false;
534
535 // Field grids
536 std::vector<double> m_eFields;
537 std::vector<double> m_bFields;
538 std::vector<double> m_bAngles;
539
540 // Electrons
541 std::vector<std::vector<std::vector<double> > > m_eVelE;
542 std::vector<std::vector<std::vector<double> > > m_eVelX;
543 std::vector<std::vector<std::vector<double> > > m_eVelB;
544 std::vector<std::vector<std::vector<double> > > m_eDifL;
545 std::vector<std::vector<std::vector<double> > > m_eDifT;
546 std::vector<std::vector<std::vector<double> > > m_eAlp;
547 std::vector<std::vector<std::vector<double> > > m_eAtt;
548 std::vector<std::vector<std::vector<double> > > m_eLor;
549
550 std::vector<std::vector<std::vector<std::vector<double> > > > m_eDifM;
551
552 // Holes
553 std::vector<std::vector<std::vector<double> > > m_hVelE;
554 std::vector<std::vector<std::vector<double> > > m_hVelX;
555 std::vector<std::vector<std::vector<double> > > m_hVelB;
556 std::vector<std::vector<std::vector<double> > > m_hDifL;
557 std::vector<std::vector<std::vector<double> > > m_hDifT;
558 std::vector<std::vector<std::vector<double> > > m_hAlp;
559 std::vector<std::vector<std::vector<double> > > m_hAtt;
560
561 std::vector<std::vector<std::vector<std::vector<double> > > > m_hDifM;
562
563 // Ions
564 std::vector<std::vector<std::vector<double> > > m_iMob;
565 std::vector<std::vector<std::vector<double> > > m_iDifL;
566 std::vector<std::vector<std::vector<double> > > m_iDifT;
567 std::vector<std::vector<std::vector<double> > > m_iDis;
568
569 // Thresholds for Townsend, attachment and dissociation coefficients.
570 unsigned int m_eThrAlp = 0;
571 unsigned int m_eThrAtt = 0;
572 unsigned int m_hThrAlp = 0;
573 unsigned int m_hThrAtt = 0;
574 unsigned int m_iThrDis = 0;
575
576 // Extrapolation methods (TODO: enum).
577 std::pair<unsigned int, unsigned int> m_extrVel = {0, 1};
578 std::pair<unsigned int, unsigned int> m_extrDif = {0, 1};
579 std::pair<unsigned int, unsigned int> m_extrAlp = {0, 1};
580 std::pair<unsigned int, unsigned int> m_extrAtt = {0, 1};
581 std::pair<unsigned int, unsigned int> m_extrLor = {0, 1};
582 std::pair<unsigned int, unsigned int> m_extrMob = {0, 1};
583 std::pair<unsigned int, unsigned int> m_extrDis = {0, 1};
584
585 // Interpolation methods
586 unsigned int m_intpVel = 2;
587 unsigned int m_intpDif = 2;
588 unsigned int m_intpAlp = 2;
589 unsigned int m_intpAtt = 2;
590 unsigned int m_intpLor = 2;
591 unsigned int m_intpMob = 2;
592 unsigned int m_intpDis = 2;
593
594 bool Velocity(const double ex, const double ey, const double ez,
595 const double bx, const double by, const double bz,
596 const std::vector<std::vector<std::vector<double> > >& velE,
597 const std::vector<std::vector<std::vector<double> > >& velB,
598 const std::vector<std::vector<std::vector<double> > >& velX,
599 const double q, double& vx, double& vy, double& vz) const;
600 bool Diffusion(const double ex, const double ey, const double ez,
601 const double bx, const double by, const double bz,
602 const std::vector<std::vector<std::vector<double> > >& difL,
603 const std::vector<std::vector<std::vector<double> > >& difT,
604 double& dl, double& dt) const;
605 bool Diffusion(const double ex, const double ey, const double ez,
606 const double bx, const double by, const double bz,
607 const std::vector<std::vector<std::vector<std::vector<double> > > >& diff,
608 double cov[3][3]) const;
609 bool Alpha(const double ex, const double ey, const double ez,
610 const double bx, const double by, const double bz,
611 const std::vector<std::vector<std::vector<double> > >& tab,
612 unsigned int intp, const unsigned int thr,
613 const std::pair<unsigned int, unsigned int>& extr,
614 double& alpha) const;
615 double GetAngle(const double ex, const double ey, const double ez,
616 const double bx, const double by, const double bz,
617 const double e, const double b) const;
618 bool Interpolate(const double e, const double b, const double a,
619 const std::vector<std::vector<std::vector<double> > >& table,
620 double& y, const unsigned int intp,
621 const std::pair<unsigned int, unsigned int>& extr) const;
622
623 double Interpolate1D(const double e, const std::vector<double>& table,
624 const std::vector<double>& fields,
625 const unsigned int intpMeth,
626 const std::pair<unsigned int, unsigned int>& extr) const;
627
628 bool SetEntry(const size_t i, const size_t j, const size_t k,
629 const std::string& fcn,
630 std::vector<std::vector<std::vector<double> > >& tab,
631 const double val);
632 bool GetEntry(const size_t i, const size_t j, const size_t k,
633 const std::string& fcn,
634 const std::vector<std::vector<std::vector<double> > >& tab,
635 double& val) const;
636
637 void SetExtrapolationMethod(const std::string& low, const std::string& high,
638 std::pair<unsigned int, unsigned int>& extr,
639 const std::string& fcn);
640 bool GetExtrapolationIndex(std::string str, unsigned int& nb) const;
641 size_t SetThreshold(
642 const std::vector<std::vector<std::vector<double> > >& tab) const;
643
644 void Clone(std::vector<std::vector<std::vector<double> > >& tab,
645 const std::vector<double>& efields,
646 const std::vector<double>& bfields,
647 const std::vector<double>& angles, const unsigned int intp,
648 const std::pair<unsigned int, unsigned int>& extr,
649 const double init, const std::string& label);
650 void Clone(
651 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
652 const size_t n, const std::vector<double>& efields,
653 const std::vector<double>& bfields, const std::vector<double>& angles,
654 const unsigned int intp,
655 const std::pair<unsigned int, unsigned int>& extr, const double init,
656 const std::string& label);
657
658 void Init(const size_t nE, const size_t nB, const size_t nA,
659 std::vector<std::vector<std::vector<double> > >& tab,
660 const double val);
661 void Init(
662 const size_t nE, const size_t nB, const size_t nA, const size_t nT,
663 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
664 const double val);
665};
666}
667
668#endif
Abstract base class for media.
Definition: Medium.hh:13
virtual double IonMobility()
Low-field mobility [cm2 V-1 ns-1].
Definition: Medium.cc:620
void ResetHoleAttachment()
Definition: Medium.hh:430
virtual void GetComponent(const unsigned int i, std::string &label, double &f)
Get the name and fraction of a given component.
Definition: Medium.cc:105
bool Interpolate(const double e, const double b, const double a, const std::vector< std::vector< std::vector< double > > > &table, double &y, const unsigned int intp, const std::pair< unsigned int, unsigned int > &extr) const
Definition: Medium.cc:1201
double m_density
Definition: Medium.hh:514
void ResetIonMobility()
Definition: Medium.hh:432
virtual bool GetPhotonCollision(const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)
Definition: Medium.cc:682
virtual double UnScaleElectricField(const double e) const
Definition: Medium.hh:464
bool GetHoleLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dl)
Get an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:321
virtual double ScaleVelocity(const double v) const
Definition: Medium.hh:465
bool GetHoleTownsend(const size_t ie, const size_t ib, const size_t ia, double &alpha)
Get an entry in the table of Townsend coefficients.
Definition: Medium.hh:341
void ResetElectronAttachment()
Definition: Medium.hh:416
virtual double GetMassDensity() const
Get the mass density [g/cm3].
Definition: Medium.cc:101
double GetFanoFactor()
Get the Fano factor.
Definition: Medium.hh:87
std::vector< double > m_bFields
Definition: Medium.hh:537
void ResetIonDiffusion()
Definition: Medium.hh:433
virtual void GetElectronMomentum(const double e, double &px, double &py, double &pz, int &band)
Definition: Medium.cc:473
bool IsMicroscopic() const
Does the medium have electron scattering rates?
Definition: Medium.hh:76
void SetTemperature(const double t)
Set the temperature [K].
Definition: Medium.cc:71
bool m_microscopic
Definition: Medium.hh:523
void ResetElectronLorentzAngle()
Definition: Medium.hh:417
double m_pressure
Definition: Medium.hh:506
void SetFanoFactor(const double f)
Set the Fano factor.
Definition: Medium.hh:85
virtual bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Ionisation coefficient [cm-1].
Definition: Medium.cc:534
double m_fano
Definition: Medium.hh:519
bool GetElectronLorentzAngle(const size_t ie, const size_t ib, const size_t ia, double &lor)
Get an entry in the table of Lorentz angles.
Definition: Medium.hh:279
double GetW()
Get the W value.
Definition: Medium.hh:83
unsigned int m_intpMob
Definition: Medium.hh:591
virtual double ScaleAttachment(const double eta) const
Definition: Medium.hh:469
bool GetEntry(const size_t i, const size_t j, const size_t k, const std::string &fcn, const std::vector< std::vector< std::vector< double > > > &tab, double &val) const
Definition: Medium.cc:884
void SetExtrapolationMethodIonDissociation(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1095
void SetInterpolationMethodIonDissociation(const unsigned int intrp)
Definition: Medium.cc:1181
bool SetElectronLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dl)
Set an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:233
double Interpolate1D(const double e, const std::vector< double > &table, const std::vector< double > &fields, const unsigned int intpMeth, const std::pair< unsigned int, unsigned int > &extr) const
Definition: Medium.cc:1221
double GetAngle(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const double e, const double b) const
Definition: Medium.cc:1185
virtual double ScaleDiffusion(const double d) const
Definition: Medium.hh:466
virtual double ElectronMobility()
Low-field mobility [cm2 V-1 ns-1].
Definition: Medium.cc:453
virtual double GetNumberDensity() const
Get the number density [cm-3].
Definition: Medium.hh:60
bool GetHoleAttachment(const size_t ie, const size_t ib, const size_t ia, double &eta)
Get an entry in the table of attachment coefficients.
Definition: Medium.hh:351
virtual unsigned int GetNumberOfDeexcitationProducts() const
Definition: Medium.hh:144
virtual bool HoleVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
Drift velocity [cm / ns].
Definition: Medium.cc:513
bool SetElectronVelocityB(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along Btrans.
Definition: Medium.hh:223
virtual double ScaleLorentzAngle(const double lor) const
Definition: Medium.hh:470
unsigned int m_intpDis
Definition: Medium.hh:592
virtual bool ElectronLorentzAngle(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &lor)
Lorentz angle.
Definition: Medium.cc:429
bool GetIonTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dt)
Get an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:387
bool Diffusion(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &difL, const std::vector< std::vector< std::vector< double > > > &difT, double &dl, double &dt) const
Definition: Medium.cc:269
std::vector< std::vector< std::vector< double > > > m_eAlp
Definition: Medium.hh:546
bool GetElectronTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dt)
Get an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:248
void ResetHoleVelocity()
Definition: Medium.hh:419
std::vector< std::vector< std::vector< double > > > m_hAlp
Definition: Medium.hh:558
void ResetIonDissociation()
Definition: Medium.hh:437
virtual bool GetDielectricFunction(const double e, double &eps1, double &eps2, const unsigned int i=0)
Get the complex dielectric function at a given energy.
Definition: Medium.cc:636
bool SetElectronAttachment(const size_t ie, const size_t ib, const size_t ia, const double eta)
Set an entry in the table of attachment coefficients.
Definition: Medium.hh:263
virtual void EnableDrift(const bool on=true)
Switch electron/ion/hole on/off.
Definition: Medium.hh:67
bool SetHoleVelocityE(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along E.
Definition: Medium.hh:285
double GetDielectricConstant() const
Get the relative static dielectric constant.
Definition: Medium.hh:42
bool SetHoleLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dl)
Set an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:316
virtual void SetNumberDensity(const double n)
Set the number density [cm-3].
Definition: Medium.cc:134
std::string m_name
Definition: Medium.hh:502
double GetPressure() const
Definition: Medium.hh:38
unsigned int m_intpDif
Definition: Medium.hh:587
bool m_driftable
Definition: Medium.hh:522
virtual bool ElectronVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
Drift velocity [cm / ns].
Definition: Medium.cc:379
virtual bool IonVelocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &vx, double &vy, double &vz)
Drift velocity [cm / ns].
Definition: Medium.cc:565
virtual void EnablePrimaryIonisation(const bool on=true)
Make the medium ionisable or non-ionisable.
Definition: Medium.hh:69
std::pair< unsigned int, unsigned int > m_extrAtt
Definition: Medium.hh:580
int GetId() const
Return the id number of the class instance.
Definition: Medium.hh:21
void SetExtrapolationMethodTownsend(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1080
virtual void SetAtomicNumber(const double z)
Set the effective atomic number.
Definition: Medium.cc:114
bool SetHoleAttachment(const size_t ie, const size_t ib, const size_t ia, const double eta)
Set an entry in the table of attachment coefficients.
Definition: Medium.hh:346
bool SetElectronTownsend(const size_t ie, const size_t ib, const size_t ia, const double alpha)
Set an entry in the table of Townsend coefficients.
Definition: Medium.hh:253
virtual double GetAtomicWeight() const
Get the effective atomic weight.
Definition: Medium.hh:56
bool GetHoleTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dt)
Get an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:331
virtual bool GetElectronCollision(const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, std::vector< std::pair< int, double > > &secondaries, int &ndxc, int &band)
Sample the collision type. Update energy and direction vector.
Definition: Medium.cc:491
std::vector< std::vector< std::vector< double > > > m_iDifT
Definition: Medium.hh:566
void SetExtrapolationMethodIonMobility(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1090
unsigned int m_hThrAtt
Definition: Medium.hh:573
std::pair< unsigned int, unsigned int > m_extrVel
Definition: Medium.hh:577
virtual double ScaleElectricField(const double e) const
Definition: Medium.hh:463
virtual double ScaleDiffusionTensor(const double d) const
Definition: Medium.hh:467
unsigned int GetNumberOfComponents() const
Get number of components of the medium.
Definition: Medium.hh:45
std::vector< std::vector< std::vector< double > > > m_hDifL
Definition: Medium.hh:556
virtual double GetElectronNullCollisionRate(const int band=0)
Null-collision rate [ns-1].
Definition: Medium.cc:480
virtual double GetAtomicNumber() const
Get the effective atomic number.
Definition: Medium.hh:52
size_t SetThreshold(const std::vector< std::vector< std::vector< double > > > &tab) const
Definition: Medium.cc:1137
std::vector< std::vector< std::vector< double > > > m_eVelE
Definition: Medium.hh:541
std::vector< std::vector< std::vector< double > > > m_eVelX
Definition: Medium.hh:542
std::vector< std::vector< std::vector< double > > > m_eDifL
Definition: Medium.hh:544
void Init(const size_t nE, const size_t nB, const size_t nA, std::vector< std::vector< std::vector< double > > > &tab, const double val)
Definition: Medium.cc:1295
bool GetHoleVelocityExB(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along ExB.
Definition: Medium.hh:300
virtual double ScaleTownsend(const double alpha) const
Definition: Medium.hh:468
unsigned int m_intpVel
Definition: Medium.hh:586
virtual double GetPhotonCollisionRate(const double e)
Definition: Medium.cc:675
void SetDielectricConstant(const double eps)
Set the relative static dielectric constant.
Definition: Medium.cc:91
bool GetElectronAttachment(const size_t ie, const size_t ib, const size_t ia, double &eta)
Get an entry in the table of attachment coefficients.
Definition: Medium.hh:268
virtual bool GetDeexcitationProduct(const unsigned int i, double &t, double &s, int &type, double &energy) const
Definition: Medium.cc:504
virtual double GetElectronCollisionRate(const double e, const int band=0)
Collision rate [ns-1] for given electron energy.
Definition: Medium.cc:485
bool GetExtrapolationIndex(std::string str, unsigned int &nb) const
Definition: Medium.cc:1120
void SetInterpolationMethodVelocity(const unsigned int intrp)
Set the degree of polynomial interpolation (usually 2).
Definition: Medium.cc:1161
virtual bool ElectronDiffusion(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
Longitudinal and transverse diffusion coefficients [cm1/2].
Definition: Medium.cc:387
void SetInterpolationMethodDiffusion(const unsigned int intrp)
Definition: Medium.cc:1165
bool SetHoleVelocityB(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along Btrans.
Definition: Medium.hh:305
double m_epsilon
Definition: Medium.hh:508
void SetExtrapolationMethodDiffusion(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1075
std::vector< double > m_eFields
Definition: Medium.hh:536
bool GetElectronVelocityE(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along E.
Definition: Medium.hh:208
void GetFieldGrid(std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles)
Get the fields and E-B angles used in the transport tables.
Definition: Medium.cc:860
static int m_idCounter
Definition: Medium.hh:495
std::vector< std::vector< std::vector< double > > > m_hDifT
Definition: Medium.hh:557
void DisableDebugging()
Definition: Medium.hh:490
virtual bool ElectronTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
Ionisation coefficient [cm-1].
Definition: Medium.cc:403
void ResetElectronDiffusion()
Definition: Medium.hh:410
virtual bool IsSemiconductor() const
Is this medium a semiconductor?
Definition: Medium.hh:27
void SetFieldGrid(double emin, double emax, const size_t ne, bool logE, double bmin=0., double bmax=0., const size_t nb=1, double amin=HalfPi, double amax=HalfPi, const size_t na=1)
Set the range of fields to be covered by the transport tables.
Definition: Medium.cc:693
virtual bool GetOpticalDataRange(double &emin, double &emax, const unsigned int i=0)
Get the energy range [eV] of the available optical data.
Definition: Medium.cc:624
bool SetElectronLorentzAngle(const size_t ie, const size_t ib, const size_t ia, const double lor)
Set an entry in the table of Lorentz angles.
Definition: Medium.hh:274
std::vector< std::vector< std::vector< double > > > m_eAtt
Definition: Medium.hh:547
virtual void SetMassDensity(const double rho)
Set the mass density [g/cm3].
Definition: Medium.cc:144
bool GetHoleVelocityB(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along Btrans.
Definition: Medium.hh:310
bool GetElectronTownsend(const size_t ie, const size_t ib, const size_t ia, double &alpha)
Get an entry in the table of Townsend coefficients.
Definition: Medium.hh:258
bool SetElectronVelocityExB(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along ExB.
Definition: Medium.hh:213
bool SetIonLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dl)
Set an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:372
virtual double ScaleDissociation(const double diss) const
Definition: Medium.hh:471
bool Alpha(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &tab, unsigned int intp, const unsigned int thr, const std::pair< unsigned int, unsigned int > &extr, double &alpha) const
Definition: Medium.cc:348
const std::string & GetName() const
Get the medium name/identifier.
Definition: Medium.hh:23
std::vector< double > m_bAngles
Definition: Medium.hh:538
Medium()
Constructor.
Definition: Medium.cc:60
std::vector< std::vector< std::vector< double > > > m_iDifL
Definition: Medium.hh:565
std::vector< std::vector< std::vector< double > > > m_hVelE
Definition: Medium.hh:553
virtual bool IsGas() const
Is this medium a gas?
Definition: Medium.hh:25
std::vector< std::vector< std::vector< double > > > m_eLor
Definition: Medium.hh:548
std::vector< std::vector< std::vector< double > > > m_eDifT
Definition: Medium.hh:545
virtual double GetElectronEnergy(const double px, const double py, const double pz, double &vx, double &vy, double &vz, const int band=0)
Dispersion relation (energy vs. wave vector)
Definition: Medium.cc:458
void SetInterpolationMethodIonMobility(const unsigned int intrp)
Definition: Medium.cc:1177
unsigned int m_intpAtt
Definition: Medium.hh:589
void SetExtrapolationMethodVelocity(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1070
bool GetIonMobility(const size_t ie, const size_t ib, const size_t ia, double &mu)
Get an entry in the table of ion mobilities.
Definition: Medium.hh:366
virtual bool ElectronAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Attachment coefficient [cm-1].
Definition: Medium.cc:416
bool GetElectronVelocityExB(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along ExB.
Definition: Medium.hh:218
virtual double HoleMobility()
Low-field mobility [cm2 V-1 ns-1].
Definition: Medium.cc:560
bool SetElectronTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dt)
Set an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:243
std::pair< unsigned int, unsigned int > m_extrDis
Definition: Medium.hh:583
std::vector< std::vector< std::vector< double > > > m_hAtt
Definition: Medium.hh:559
void SetPressure(const double p)
Definition: Medium.cc:81
void SetExtrapolationMethod(const std::string &low, const std::string &high, std::pair< unsigned int, unsigned int > &extr, const std::string &fcn)
Definition: Medium.cc:1100
std::pair< unsigned int, unsigned int > m_extrAlp
Definition: Medium.hh:579
void EnableDebugging()
Switch on/off debugging messages.
Definition: Medium.hh:489
std::vector< std::vector< std::vector< double > > > m_eVelB
Definition: Medium.hh:543
unsigned int m_eThrAtt
Definition: Medium.hh:571
bool IsIonisable() const
Is charge deposition by charged particles/photon enabled in this medium?
Definition: Medium.hh:78
bool m_ionisable
Definition: Medium.hh:524
bool GetIonDissociation(const size_t ie, const size_t ib, const size_t ia, double &diss)
Get an entry in the table of dissociation coefficients.
Definition: Medium.hh:397
virtual void SetAtomicWeight(const double a)
Set the effective atomic weight.
Definition: Medium.cc:124
void SetExtrapolationMethodAttachment(const std::string &extrLow, const std::string &extrHigh)
Definition: Medium.cc:1085
bool GetElectronVelocityB(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along Btrans.
Definition: Medium.hh:228
std::pair< unsigned int, unsigned int > m_extrLor
Definition: Medium.hh:581
bool GetIonLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dl)
Get an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:377
unsigned int m_nComponents
Definition: Medium.hh:500
virtual bool IsConductor() const
Is this medium a conductor?
Definition: Medium.hh:29
unsigned int m_intpLor
Definition: Medium.hh:590
std::string m_className
Definition: Medium.hh:493
bool SetHoleVelocityExB(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along ExB.
Definition: Medium.hh:295
std::pair< unsigned int, unsigned int > m_extrDif
Definition: Medium.hh:578
void SetInterpolationMethodAttachment(const unsigned int intrp)
Definition: Medium.cc:1173
virtual bool HoleDiffusion(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
Longitudinal and transverse diffusion coefficients [cm1/2].
Definition: Medium.cc:521
double GetTemperature() const
Get the temperature [K].
Definition: Medium.hh:34
unsigned int m_iThrDis
Definition: Medium.hh:574
virtual bool IonDissociation(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &diss)
Dissociation coefficient.
Definition: Medium.cc:607
virtual void ResetTables()
Reset all tables of transport parameters.
Definition: Medium.cc:901
bool GetElectronLongitudinalDiffusion(const size_t ie, const size_t ib, const size_t ia, double &dl)
Get an entry in the table of longitudinal diffusion coefficients.
Definition: Medium.hh:238
std::vector< std::vector< std::vector< double > > > m_hVelX
Definition: Medium.hh:554
virtual ~Medium()
Destructor.
Definition: Medium.cc:69
std::pair< unsigned int, unsigned int > m_extrMob
Definition: Medium.hh:582
void Clone(std::vector< std::vector< std::vector< double > > > &tab, const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles, const unsigned int intp, const std::pair< unsigned int, unsigned int > &extr, const double init, const std::string &label)
Definition: Medium.cc:918
void ResetHoleDiffusion()
Definition: Medium.hh:424
std::vector< std::vector< std::vector< std::vector< double > > > > m_eDifM
Definition: Medium.hh:550
std::vector< std::vector< std::vector< double > > > m_hVelB
Definition: Medium.hh:555
bool m_isChanged
Definition: Medium.hh:527
bool Velocity(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, const std::vector< std::vector< std::vector< double > > > &velE, const std::vector< std::vector< std::vector< double > > > &velB, const std::vector< std::vector< std::vector< double > > > &velX, const double q, double &vx, double &vy, double &vz) const
Definition: Medium.cc:160
bool SetHoleTownsend(const size_t ie, const size_t ib, const size_t ia, const double alpha)
Set an entry in the table of Townsend coefficients.
Definition: Medium.hh:336
std::vector< std::vector< std::vector< std::vector< double > > > > m_hDifM
Definition: Medium.hh:561
unsigned int m_hThrAlp
Definition: Medium.hh:572
void SetW(const double w)
Set the W value (average energy to produce an electron/ion or e/h pair).
Definition: Medium.hh:81
std::vector< std::vector< std::vector< double > > > m_iMob
Definition: Medium.hh:564
bool SetEntry(const size_t i, const size_t j, const size_t k, const std::string &fcn, std::vector< std::vector< std::vector< double > > > &tab, const double val)
Definition: Medium.cc:868
bool SetIonDissociation(const size_t ie, const size_t ib, const size_t ia, const double diss)
Set an entry in the table of dissociation coefficients.
Definition: Medium.hh:392
bool SetHoleTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dt)
Set an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:326
void ResetElectronTownsend()
Definition: Medium.hh:415
unsigned int m_eThrAlp
Definition: Medium.hh:570
bool GetHoleVelocityE(const size_t ie, const size_t ib, const size_t ia, double &v)
Get an entry in the table of drift speeds along E.
Definition: Medium.hh:290
virtual bool HoleAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
Attachment coefficient [cm-1].
Definition: Medium.cc:547
bool IsDriftable() const
Is charge carrier transport enabled in this medium?
Definition: Medium.hh:74
void ResetHoleTownsend()
Definition: Medium.hh:429
void ResetElectronVelocity()
Definition: Medium.hh:405
void SetInterpolationMethodTownsend(const unsigned int intrp)
Definition: Medium.cc:1169
virtual bool GetPhotoAbsorptionCrossSection(const double e, double &sigma, const unsigned int i=0)
Definition: Medium.cc:654
bool SetElectronVelocityE(const size_t ie, const size_t ib, const size_t ia, const double v)
Set an entry in the table of drift speeds along E.
Definition: Medium.hh:203
virtual bool IonDiffusion(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &dl, double &dt)
Longitudinal and transverse diffusion coefficients [cm1/2].
Definition: Medium.cc:600
double m_temperature
Definition: Medium.hh:504
bool SetIonTransverseDiffusion(const size_t ie, const size_t ib, const size_t ia, const double dt)
Set an entry in the table of transverse diffusion coefficients.
Definition: Medium.hh:382
std::vector< std::vector< std::vector< double > > > m_iDis
Definition: Medium.hh:567
bool SetIonMobility(const std::vector< double > &fields, const std::vector< double > &mobilities)
Definition: Medium.cc:1039
unsigned int m_intpAlp
Definition: Medium.hh:588