13void PrintNotImplemented(
const std::string& cls,
const std::string& fcn) {
15 std::cerr << cls <<
"::" << fcn <<
": Function is not implemented.\n";
25 : m_className(
"Medium"),
28 m_temperature(293.15),
99 SetFieldGrid(100., 100000., 20,
true, 0., 0., 1, 0., 0., 1);
108 std::cerr <<
" Temperature [K] must be greater than zero.\n";
119 std::cerr <<
" Pressure [Torr] must be greater than zero.\n";
129 std::cerr <<
m_className <<
"::SetDielectricConstant:\n";
130 std::cerr <<
" Dielectric constant must be >= 1.\n";
143 std::string& label,
double& f) {
147 std::cerr <<
" Index out of range.\n";
157 std::cerr <<
m_className <<
"::SetAtomicNumber:\n";
158 std::cerr <<
" Atomic number must be >= 1.\n";
168 std::cerr <<
m_className <<
"::SetAtomicWeight:\n";
169 std::cerr <<
" Atomic weight must be greater than zero.\n";
179 std::cerr <<
m_className <<
"::SetNumberDensity:\n";
180 std::cerr <<
" Density [cm-3] must be greater than zero.\n";
191 std::cerr <<
" Density [g/cm3] must be greater than zero.\n";
197 std::cerr <<
" Atomic weight is not defined.\n";
205 const double bx,
const double by,
const double bz,
206 double& vx,
double& vy,
double& vz) {
213 const double e = sqrt(ex * ex + ey * ey + ez * ez);
215 if (e < Small || e0 < Small)
return false;
218 const double b = sqrt(bx * bx + by * by + bz * bz);
221 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
232 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
233 std::cerr <<
" Interpolation of velocity along E failed.\n";
240 const double q = -1.;
241 const double mu = q * ve / e;
250 double ue[3] = {ex / e, ey / e, ez / e};
251 double uexb[3] = {ey * bz - ez * by, ez * bx - ex * bz, ex * by - ey * bx};
253 sqrt(uexb[0] * uexb[0] + uexb[1] * uexb[1] + uexb[2] * uexb[2]);
264 double ubt[3] = {uexb[1] * ez - uexb[2] * ey, uexb[2] * ex - uexb[0] * ez,
265 uexb[0] * ey - uexb[1] * ex};
266 const double bt = sqrt(ubt[0] * ubt[0] + ubt[1] * ubt[1] + ubt[2] * ubt[2]);
279 std::cout << std::setprecision(5);
280 std::cout <<
m_className <<
"::ElectronVelocity:\n";
281 std::cout <<
" unit vector along E: (" << ue[0] <<
", " << ue[1]
282 <<
", " << ue[2] <<
")\n";
283 std::cout <<
" unit vector along E x B: (" << uexb[0] <<
", "
284 << uexb[1] <<
", " << uexb[2] <<
")\n";
285 std::cout <<
" unit vector along Bt: (" << ubt[0] <<
", " << ubt[1]
286 <<
", " << ubt[2] <<
")\n";
290 double ve = 0., vbt = 0., vexb = 0.;
295 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
296 std::cerr <<
" Interpolation of velocity along E failed.\n";
302 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
303 std::cerr <<
" Interpolation of velocity along ExB failed.\n";
309 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
310 std::cerr <<
" Interpolation of velocity along Bt failed.\n";
324 const double q = -1.;
325 if (ex * bx + ey * by + ez * bz > 0.) vbt = fabs(vbt);
326 else vbt = -fabs(vbt);
327 vx = q * (ve * ue[0] + q * q * vbt * ubt[0] + q * vexb * uexb[0]);
328 vy = q * (ve * ue[1] + q * q * vbt * ubt[1] + q * vexb * uexb[1]);
329 vz = q * (ve * ue[2] + q * q * vbt * ubt[2] + q * vexb * uexb[2]);
340 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
341 std::cerr <<
" Interpolation of velocity along E failed.\n";
350 const double q = -1.;
351 const double mu = q * ve / e;
352 const double eb = bx * ex + by * ey + bz * ez;
353 const double nom = 1. + pow(mu * b, 2);
354 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
355 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
356 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
363 const double ez,
const double bx,
364 const double by,
const double bz,
double& dl,
369 const double e = sqrt(ex * ex + ey * ey + ez * ez);
371 if (e < Small || e0 < Small)
return true;
375 const double b = sqrt(bx * bx + by * by + bz * bz);
377 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
410 const double d = sqrt(2. * BoltzmannConstant *
m_temperature / e);
415 if (dl < 0.) dl = 0.;
416 if (dt < 0.) dt = 0.;
424 const double ez,
const double bx,
425 const double by,
const double bz,
429 cov[0][0] = cov[0][1] = cov[0][2] = 0.;
430 cov[1][0] = cov[1][1] = cov[1][2] = 0.;
431 cov[2][0] = cov[2][1] = cov[2][2] = 0.;
436 const double e = sqrt(ex * ex + ey * ey + ez * ez);
438 if (e < Small || e0 < Small)
return true;
442 const double b = sqrt(bx * bx + by * by + bz * bz);
444 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
448 for (
int l = 0; l < 6; ++l) {
459 cov[0][1] = cov[1][0] = diff;
461 cov[0][2] = cov[2][0] = diff;
463 cov[1][2] = cov[2][1] = diff;
468 for (
int l = 0; l < 6; ++l) {
478 cov[0][1] = cov[1][0] = diff;
480 cov[0][2] = cov[2][0] = diff;
482 cov[1][2] = cov[2][1] = diff;
491 const double bx,
const double by,
const double bz,
497 const double e = sqrt(ex * ex + ey * ey + ez * ez);
499 if (e < Small || e0 < Small)
return true;
503 const double b = sqrt(bx * bx + by * by + bz * bz);
505 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
545 const double ez,
const double bx,
546 const double by,
const double bz,
double& eta) {
551 const double e = sqrt(ex * ex + ey * ey + ez * ez);
553 if (e < Small || e0 < Small)
return true;
557 const double b = sqrt(bx * bx + by * by + bz * bz);
559 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
600 const double ez,
const double bx,
601 const double by,
const double bz,
607 const double e = sqrt(ex * ex + ey * ey + ez * ez);
609 if (e < Small || e0 < Small)
return true;
613 const double b = sqrt(bx * bx + by * by + bz * bz);
615 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
636 const double pz,
double& vx,
double& vy,
637 double& vz,
const int band) {
640 std::cerr <<
m_className <<
"::GetElectronEnergy:\n";
641 std::cerr <<
" Unknown band index.\n";
644 vx = SpeedOfLight * px / ElectronMass;
645 vy = SpeedOfLight * py / ElectronMass;
646 vz = SpeedOfLight * pz / ElectronMass;
648 return 0.5 * (px * px + py * py + pz * pz) / ElectronMass;
652 double& pz,
int& band) {
654 const double p = sqrt(2. * ElectronMass * e) / SpeedOfLight;
673 double& e1,
double& dx,
double& dy,
674 double& dz,
int& nion,
int& ndxc,
int& band) {
678 nion = ndxc = band = 0;
686 int& type,
double& energy)
const {
695 double& t,
double& s,
696 int& type,
double& energy)
const {
705 const double bx,
const double by,
const double bz,
706 double& vx,
double& vy,
double& vz) {
713 const double e = sqrt(ex * ex + ey * ey + ez * ez);
715 if (e < Small || e0 < Small)
return true;
718 const double b = sqrt(bx * bx + by * by + bz * bz);
721 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
732 std::cerr <<
" Interpolation of velocity along E failed.\n";
740 const double mu = q * ve / e;
749 double ue[3] = {ex / e, ey / e, ez / e};
750 double uexb[3] = {ey * bz - ez * by, ez * bx - ex * bz, ex * by - ey * bx};
752 sqrt(uexb[0] * uexb[0] + uexb[1] * uexb[1] + uexb[2] * uexb[2]);
763 double ubt[3] = {uexb[1] * ez - uexb[2] * ey, uexb[2] * ex - uexb[0] * ez,
764 uexb[0] * ey - uexb[1] * ex};
765 const double bt = sqrt(ubt[0] * ubt[0] + ubt[1] * ubt[1] + ubt[2] * ubt[2]);
778 double ve = 0., vbt = 0., vexb = 0.;
784 std::cerr <<
" Interpolation of velocity along E failed.\n";
791 std::cerr <<
" Interpolation of velocity along ExB failed.\n";
798 std::cerr <<
" Interpolation of velocity along Bt failed.\n";
810 if (ex * bx + ey * by + ez * bz > 0.) vbt = fabs(vbt);
811 else vbt = -fabs(vbt);
812 vx = q * (ve * ue[0] + q * q * vbt * ubt[0] + q * vexb * uexb[0]);
813 vy = q * (ve * ue[1] + q * q * vbt * ubt[1] + q * vexb * uexb[1]);
814 vz = q * (ve * ue[2] + q * q * vbt * ubt[2] + q * vexb * uexb[2]);
826 std::cerr <<
" Interpolation of velocity along E failed.\n";
835 const double mu = q * ve / e;
836 const double eb = bx * ex + by * ey + bz * ez;
837 const double nom = 1. + pow(mu * b, 2);
838 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
839 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
840 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
847 const double bx,
const double by,
const double bz,
848 double& dl,
double& dt) {
852 const double e = sqrt(ex * ex + ey * ey + ez * ez);
854 if (e < Small || e0 < Small)
return true;
858 const double b = sqrt(bx * bx + by * by + bz * bz);
860 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
898 if (dl < 0.) dl = 0.;
899 if (dt < 0.) dt = 0.;
907 const double bx,
const double by,
const double bz,
911 cov[0][0] = cov[0][1] = cov[0][2] = 0.;
912 cov[1][0] = cov[1][1] = cov[1][2] = 0.;
913 cov[2][0] = cov[2][1] = cov[2][2] = 0.;
918 const double e = sqrt(ex * ex + ey * ey + ez * ez);
920 if (e < Small || e0 < Small)
return true;
924 const double b = sqrt(bx * bx + by * by + bz * bz);
926 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
930 for (
int l = 0; l < 6; ++l) {
941 cov[0][1] = cov[1][0] = diff;
943 cov[0][2] = cov[2][0] = diff;
945 cov[1][2] = cov[2][1] = diff;
950 for (
int l = 0; l < 6; ++l) {
959 cov[0][1] = cov[1][0] = diff;
961 cov[0][2] = cov[2][0] = diff;
963 cov[1][2] = cov[2][1] = diff;
972 const double bx,
const double by,
const double bz,
978 const double e = sqrt(ex * ex + ey * ey + ez * ez);
980 if (e < Small || e0 < Small)
return true;
984 const double b = sqrt(bx * bx + by * by + bz * bz);
986 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
1024 const double bx,
const double by,
const double bz,
1030 const double e = sqrt(ex * ex + ey * ey + ez * ez);
1032 if (e < Small || e0 < Small)
return true;
1036 const double b = sqrt(bx * bx + by * by + bz * bz);
1038 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
1078 const double bx,
const double by,
const double bz,
1079 double& vx,
double& vy,
double& vz) {
1084 const double e = sqrt(ex * ex + ey * ey + ez * ez);
1086 if (e < Small || e0 < Small)
return true;
1088 const double b = sqrt(bx * bx + by * by + bz * bz);
1093 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
1105 const double q = 1.;
1112 const double eb = bx * ex + by * ey + bz * ez;
1113 const double nom = 1. + pow(mu * b, 2);
1114 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
1115 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
1116 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
1123 const double bx,
const double by,
const double bz,
1124 double& dl,
double& dt) {
1128 const double e = sqrt(ex * ex + ey * ey + ez * ez);
1130 if (e < Small || e0 < Small)
return true;
1134 const double b = sqrt(bx * bx + by * by + bz * bz);
1136 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
1177 const double bx,
const double by,
const double bz,
1183 const double e = sqrt(ex * ex + ey * ey + ez * ez);
1185 if (e < Small || e0 < Small)
return true;
1189 const double b = sqrt(bx * bx + by * by + bz * bz);
1191 const double ebang =
GetAngle(ex, ey, ez, bx, by, bz, e, b);
1230 const unsigned int i) {
1233 std::cerr <<
m_className <<
"::GetOpticalDataRange:\n";
1234 std::cerr <<
" Component " << i <<
" does not exist.\n";
1244 const unsigned int i) {
1247 std::cerr <<
m_className <<
"::GetDielectricFunction:\n";
1248 std::cerr <<
" Component " << i <<
" does not exist.\n";
1253 std::cerr <<
m_className <<
"::GetDielectricFunction:\n";
1254 std::cerr <<
" Energy must be > 0.\n";
1265 const unsigned int i) {
1268 std::cerr <<
m_className <<
"::GetPhotoAbsorptionCrossSection:\n";
1269 std::cerr <<
" Component " << i <<
" does not exist.\n";
1274 std::cerr <<
m_className <<
"::GetPhotoAbsorptionCrossSection:\n";
1275 std::cerr <<
" Energy must be > 0.\n";
1280 PrintNotImplemented(
m_className,
"GetPhotoAbsorptionCrossSection");
1291 return sigma *
m_density * SpeedOfLight;
1295 double& e1,
double& ctheta,
int& nsec,
1396 double bmin,
double bmax,
int nb,
double amin,
1397 double amax,
int na) {
1402 std::cerr <<
" Number of E-fields must be > 0.\n";
1406 if (emin < 0. || emax < 0.) {
1408 std::cerr <<
" Electric fields must be positive.\n";
1414 std::cerr <<
" Swapping min./max. E-field.\n";
1415 const double etemp = emin;
1425 std::cerr <<
" Min. E-field must be non-zero for log. scale.\n";
1430 std::cerr <<
" Number of E-fields must be > 1 for log. scale.\n";
1433 estep = pow(emax / emin, 1. / (ne - 1.));
1436 if (ne > 1) estep = (emax - emin) / (ne - 1.);
1442 std::cerr <<
" Number of B-fields must be > 0.\n";
1445 if (bmax < 0. || bmin < 0.) {
1447 std::cerr <<
" Magnetic fields must be positive.\n";
1452 std::cerr <<
" Swapping min./max. B-field.\n";
1453 const double btemp = bmin;
1459 if (nb > 1) bstep = (bmax - bmin) / (nb - 1.);
1464 std::cerr <<
" Number of angles must be > 0.\n";
1467 if (amax < 0. || amin < 0.) {
1469 std::cerr <<
" Angles must be positive.\n";
1474 std::cerr <<
" Swapping min./max. angle.\n";
1475 const double atemp = amin;
1480 if (na > 1) astep = (amax - amin) / (na - 1.);
1483 std::vector<double> eFieldsNew(ne);
1484 std::vector<double> bFieldsNew(nb);
1485 std::vector<double> bAnglesNew(na);
1486 for (
int i = 0; i < ne; ++i) {
1488 eFieldsNew[i] = emin * pow(estep, i);
1490 eFieldsNew[i] = emin + i * estep;
1493 for (
int i = 0; i < nb; ++i) {
1494 bFieldsNew[i] = bmin + i * bstep;
1496 if (na == 1 && nb == 1 && fabs(bmin) < 1.e-4) {
1497 bAnglesNew[0] = HalfPi;
1499 for (
int i = 0; i < na; ++i) {
1500 bAnglesNew[i] = amin + i * astep;
1507 const std::vector<double>& bfields,
1508 const std::vector<double>& angles) {
1510 if (efields.empty()) {
1512 std::cerr <<
" Number of E-fields must be > 0.\n";
1515 if (bfields.empty()) {
1517 std::cerr <<
" Number of B-fields must be > 0.\n";
1520 if (angles.empty()) {
1522 std::cerr <<
" Number of angles must be > 0.\n";
1527 if (efields[0] < 0.) {
1529 std::cerr <<
" E-fields must be >= 0.\n";
1531 if (bfields[0] < 0.) {
1533 std::cerr <<
" B-fields must be >= 0.\n";
1535 if (angles[0] < 0.) {
1537 std::cerr <<
" Angles must be >= 0.\n";
1540 const unsigned int nEfieldsNew = efields.size();
1541 const unsigned int nBfieldsNew = bfields.size();
1542 const unsigned int nAnglesNew = angles.size();
1544 if (nEfieldsNew > 1) {
1545 for (
unsigned int i = 1; i < nEfieldsNew; ++i) {
1546 if (efields[i] <= efields[i - 1]) {
1548 std::cerr <<
" E-fields are not in ascending order.\n";
1553 if (nBfieldsNew > 1) {
1554 for (
unsigned int i = 1; i < nBfieldsNew; ++i) {
1555 if (bfields[i] <= bfields[i - 1]) {
1557 std::cerr <<
" B-fields are not in ascending order.\n";
1562 if (nAnglesNew > 1) {
1563 for (
unsigned int i = 1; i < nAnglesNew; ++i) {
1564 if (angles[i] <= angles[i - 1]) {
1566 std::cerr <<
" Angles are not in ascending order.\n";
1574 std::cout <<
" E-fields:\n";
1575 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
1576 std::cout <<
" " << efields[i] <<
"\n";
1578 std::cout <<
" B-fields:\n";
1579 for (
unsigned int i = 0; i < nBfieldsNew; ++i) {
1580 std::cout <<
" " << bfields[i] <<
"\n";
1582 std::cout <<
" Angles:\n";
1583 for (
unsigned int i = 0; i < nAnglesNew; ++i) {
1584 std::cout <<
" " << angles[i] <<
"\n";
1592 "electron velocity along E");
1595 "electron velocity along Bt");
1598 "electron velocity along ExB");
1601 "electron longitudinal diffusion");
1604 "electron transverse diffusion");
1607 "electron Townsend coefficient");
1610 "electron attachment coefficient");
1613 "electron attachment coefficient");
1617 "electron diffusion tensor");
1623 "hole velocity along E");
1626 "hole velocity along Bt");
1629 "hole velocity along ExB");
1632 "hole longitudinal diffusion");
1635 "hole transverse diffusion");
1638 "hole Townsend coefficient");
1641 "hole attachment coefficient");
1645 "hole diffusion tensor");
1654 "ion longitudinal diffusion");
1657 "ion transverse diffusion");
1660 "ion dissociation");
1662 if (nBfieldsNew > 1 || nAnglesNew > 1)
m_map2d =
true;
1672 std::vector<double>& bfields,
1673 std::vector<double>& angles) {
1681 const unsigned int ib,
1682 const unsigned int ia,
double& v) {
1685 std::cerr <<
m_className <<
"::GetElectronVelocityE:\n";
1686 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1687 <<
") out of range.\n";
1693 std::cerr <<
m_className <<
"::GetElectronVelocityE:\n";
1694 std::cerr <<
" Data not available.\n";
1705 const unsigned int ib,
1706 const unsigned int ia,
double& v) {
1709 std::cerr <<
m_className <<
"::GetElectronVelocityExB:\n";
1710 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1711 <<
") out of range.\n";
1717 std::cerr <<
m_className <<
"::GetElectronVelocityExB:\n";
1718 std::cerr <<
" Data not available.\n";
1729 const unsigned int ib,
1730 const unsigned int ia,
double& v) {
1733 std::cerr <<
m_className <<
"::GetElectronVelocityB:\n";
1734 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1735 <<
") out of range.\n";
1741 std::cerr <<
m_className <<
"::GetElectronVelocityB:\n";
1742 std::cerr <<
" Data not available.\n";
1753 const unsigned int ib,
1754 const unsigned int ia,
1758 std::cerr <<
m_className <<
"::GetElectronLongitudinalDiffusion:\n";
1759 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1760 <<
") out of range.\n";
1766 std::cerr <<
m_className <<
"::GetElectronLongitudinalDiffusion:\n";
1767 std::cerr <<
" Data not available.\n";
1778 const unsigned int ib,
1779 const unsigned int ia,
1783 std::cerr <<
m_className <<
"::GetElectronTransverseDiffusion:\n";
1784 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1785 <<
") out of range.\n";
1791 std::cerr <<
m_className <<
"::GetElectronTransverseDiffusion:\n";
1792 std::cerr <<
" Data not available.\n";
1803 const unsigned int ib,
1804 const unsigned int ia,
double& alpha) {
1807 std::cerr <<
m_className <<
"::GetElectronTownsend:\n";
1808 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1809 <<
") out of range.\n";
1815 std::cerr <<
m_className <<
"::GetElectronTownsend:\n";
1816 std::cerr <<
" Data not available.\n";
1827 const unsigned int ib,
1828 const unsigned int ia,
double& eta) {
1831 std::cerr <<
m_className <<
"::GetElectronAttachment:\n";
1832 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1833 <<
") out of range.\n";
1839 std::cerr <<
m_className <<
"::GetElectronAttachment:\n";
1840 std::cerr <<
" Data not available.\n";
1851 const unsigned int ib,
1852 const unsigned int ia,
double& lor) {
1855 std::cerr <<
m_className <<
"::GetElectronLorentzAngle:\n";
1856 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1857 <<
") out of range.\n";
1863 std::cerr <<
m_className <<
"::GetElectronLorentzAngle:\n";
1864 std::cerr <<
" Data not available.\n";
1875 const unsigned int ib,
1876 const unsigned int ia,
double& v) {
1879 std::cerr <<
m_className <<
"::GetHoleVelocityE:\n";
1880 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1881 <<
") out of range.\n";
1887 std::cerr <<
m_className <<
"::GetHoleVelocityE:\n";
1888 std::cerr <<
" Data not available.\n";
1899 const unsigned int ib,
1900 const unsigned int ia,
double& v) {
1903 std::cerr <<
m_className <<
"::GetHoleVelocityExB:\n";
1904 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1905 <<
") out of range.\n";
1911 std::cerr <<
m_className <<
"::GetHoleVelocityExB:\n";
1912 std::cerr <<
" Data not available.\n";
1923 const unsigned int ib,
1924 const unsigned int ia,
double& v) {
1927 std::cerr <<
m_className <<
"::GetHoleVelocityB:\n";
1928 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1929 <<
") out of range.\n";
1935 std::cerr <<
m_className <<
"::GetHoleVelocityB:\n";
1936 std::cerr <<
" Data not available.\n";
1947 const unsigned int ib,
1948 const unsigned int ia,
double& dl) {
1951 std::cerr <<
m_className <<
"::GetHoleLongitudinalDiffusion:\n";
1952 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1953 <<
") out of range.\n";
1959 std::cerr <<
m_className <<
"::GetHoleLongitudinalDiffusion:\n";
1960 std::cerr <<
" Data not available.\n";
1971 const unsigned int ib,
1972 const unsigned int ia,
double& dt) {
1975 std::cerr <<
m_className <<
"::GetHoleTransverseDiffusion:\n";
1976 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1977 <<
") out of range.\n";
1983 std::cerr <<
m_className <<
"::GetHoleTransverseDiffusion:\n";
1984 std::cerr <<
" Data not available.\n";
1995 const unsigned int ib,
1996 const unsigned int ia,
double& alpha) {
1999 std::cerr <<
m_className <<
"::GetHoleTownsend:\n";
2000 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2001 <<
") out of range.\n";
2007 std::cerr <<
m_className <<
"::GetHoleTownsend:\n";
2008 std::cerr <<
" Data not available.\n";
2019 const unsigned int ib,
2020 const unsigned int ia,
double& eta) {
2023 std::cerr <<
m_className <<
"::GetHoleAttachment:\n";
2024 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2025 <<
") out of range.\n";
2031 std::cerr <<
m_className <<
"::GetHoleAttachment:\n";
2032 std::cerr <<
" Data not available.\n";
2043 const unsigned int ia,
double& mu) {
2046 std::cerr <<
m_className <<
"::GetIonMobility:\n";
2047 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2048 <<
") out of range.\n";
2054 std::cerr <<
m_className <<
"::GetIonMobility:\n";
2055 std::cerr <<
" Data not available.\n";
2066 const unsigned int ib,
2067 const unsigned int ia,
double& dl) {
2070 std::cerr <<
m_className <<
"::GetIonLongitudinalDiffusion:\n";
2071 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2072 <<
") out of range.\n";
2078 std::cerr <<
m_className <<
"::GetIonLongitudinalDiffusion:\n";
2079 std::cerr <<
" Data not available.\n";
2090 const unsigned int ib,
2091 const unsigned int ia,
double& dt) {
2094 std::cerr <<
m_className <<
"::GetIonTransverseDiffusion:\n";
2095 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2096 <<
") out of range.\n";
2102 std::cerr <<
m_className <<
"::GetIonTransverseDiffusion:\n";
2103 std::cerr <<
" Data not available.\n";
2114 const unsigned int ib,
2115 const unsigned int ia,
double& diss) {
2118 std::cerr <<
m_className <<
"::GetIonDissociation:\n";
2119 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2120 <<
") out of range.\n";
2126 std::cerr <<
m_className <<
"::GetIonDissociation:\n";
2127 std::cerr <<
" Data not available.\n";
2138 const std::vector<double>& efields,
2139 const std::vector<double>& bfields,
2140 const std::vector<double>& angles,
2141 const unsigned int intp,
2142 const unsigned int extrLow,
2143 const unsigned int extrHigh,
2144 const double init,
const std::string& label) {
2148 std::cout <<
" Copying values of " << label <<
" to new grid.\n";
2152 if (
m_debug) std::cout <<
" Table is empty.\n";
2156 const int nEfieldsNew = efields.size();
2157 const int nBfieldsNew = bfields.size();
2158 const int nAnglesNew = angles.size();
2161 std::vector<std::vector<std::vector<double> > > tabClone;
2162 InitParamArrays(nEfieldsNew, nBfieldsNew, nAnglesNew, tabClone, init);
2165 for (
int i = 0; i < nEfieldsNew; ++i) {
2166 for (
int j = 0; j < nBfieldsNew; ++j) {
2167 for (
int k = 0; k < nAnglesNew; ++k) {
2172 efields[i], val, intp)) {
2174 std::cerr <<
" Interpolation of " << label <<
" failed.\n";
2175 std::cerr <<
" Cannot copy value to new grid at: \n";
2176 std::cerr <<
" E = " << efields[i] <<
"\n";
2177 std::cerr <<
" B = " << bfields[j] <<
"\n";
2178 std::cerr <<
" angle: " << angles[k] <<
"\n";
2180 tabClone[k][j][i] = val;
2185 tabClone[k][j][i] = val;
2193 for (
int i = 0; i < nEfieldsNew; ++i) {
2194 for (
int j = 0; j < nBfieldsNew; ++j) {
2195 for (
int k = 0; k < nAnglesNew; ++k) {
2196 tab[k][j][i] = tabClone[k][j][i];
2204 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
2205 const unsigned int n,
2206 const std::vector<double>& efields,
const std::vector<double>& bfields,
2207 const std::vector<double>& angles,
2208 const unsigned int intp,
2209 const unsigned int extrLow,
const unsigned int extrHigh,
2211 const std::string& label) {
2214 if (tab.empty())
return;
2217 const unsigned int nEfieldsNew = efields.size();
2218 const unsigned int nBfieldsNew = bfields.size();
2219 const unsigned int nAnglesNew = angles.size();
2222 std::vector<std::vector<std::vector<std::vector<double> > > > tabClone;
2224 InitParamTensor(nEfieldsNew, nBfieldsNew, nAnglesNew, n, tabClone, init);
2227 for (
unsigned int l = 0; l < n; ++l) {
2228 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
2229 for (
unsigned int j = 0; j < nBfieldsNew; ++j) {
2230 for (
unsigned int k = 0; k < nAnglesNew; ++k) {
2235 efields[i], val, intp)) {
2237 std::cerr <<
" Interpolation of " << label <<
" failed.\n";
2238 std::cerr <<
" Cannot copy value to new grid at: \n";
2239 std::cerr <<
" Index: " << l <<
"\n";
2240 std::cerr <<
" E = " << efields[i] <<
"\n";
2241 std::cerr <<
" B = " << bfields[j] <<
"\n";
2242 std::cerr <<
" angle: " << angles[k] <<
"\n";
2244 tabClone[l][k][j][i] = val;
2249 tabClone[l][k][j][i] = val;
2258 for (
unsigned int l = 0; l < n; ++l) {
2259 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
2260 for (
unsigned int j = 0; j < nBfieldsNew; ++j) {
2261 for (
unsigned int k = 0; k < nAnglesNew; ++k) {
2262 tab[l][k][j][i] = tabClone[l][k][j][i];
2270 const unsigned int ia,
const double mu) {
2275 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2276 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2277 <<
") out of range.\n";
2282 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2283 std::cerr <<
" Ion mobility table not initialised.\n";
2288 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2289 std::cerr <<
" Zero value not permitted.\n";
2295 std::cout <<
m_className <<
"::SetIonMobility:\n";
2296 std::cout <<
" Ion mobility at E = " <<
m_eFields[ie]
2298 <<
" set to " << mu <<
" cm2/(V ns).\n";
2304 const std::vector<double>& mobilities) {
2306 const int ne = efields.size();
2307 const int nm = mobilities.size();
2309 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2310 std::cerr <<
" E-field and mobility arrays have different sizes.\n";
2315 const unsigned int nEfields =
m_eFields.size();
2316 const unsigned int nBfields =
m_bFields.size();
2317 const unsigned int nAngles =
m_bAngles.size();
2319 for (
unsigned int i = 0; i < nEfields; ++i) {
2327 for (
unsigned int i = 0; i < nAngles; ++i) {
2328 for (
unsigned int j = 0; j< nBfields; ++j) {
2329 for (
unsigned int k = 0; k < nEfields; ++k) {
2341 const std::string& extrHigh) {
2343 unsigned int iExtr = 0;
2347 std::cerr <<
m_className <<
"::SetExtrapolationMethodVelocity:\n";
2348 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2354 std::cerr <<
m_className <<
"::SetExtrapolationMethodVelocity:\n";
2355 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2360 const std::string& extrHigh) {
2362 unsigned int iExtr = 0;
2366 std::cerr <<
m_className <<
"::SetExtrapolationMethodDiffusion:\n";
2367 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2373 std::cerr <<
m_className <<
"::SetExtrapolationMethodDiffusion:\n";
2374 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2379 const std::string& extrHigh) {
2381 unsigned int iExtr = 0;
2385 std::cerr <<
m_className <<
"::SetExtrapolationMethodTownsend:\n";
2386 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2392 std::cerr <<
m_className <<
"::SetExtrapolationMethodTownsend:\n";
2393 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2398 const std::string& extrHigh) {
2400 unsigned int iExtr = 0;
2404 std::cerr <<
m_className <<
"::SetExtrapolationMethodAttachment:\n";
2405 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2411 std::cerr <<
m_className <<
"::SetExtrapolationMethodAttachment:\n";
2412 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2417 const std::string& extrHigh) {
2419 unsigned int iExtr = 0;
2423 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonMobility:\n";
2424 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2429 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonMobility:\n";
2430 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2435 const std::string& extrHigh) {
2437 unsigned int iExtr = 0;
2441 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonDissociation:\n";
2442 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2448 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonDissociation:\n";
2449 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2456 for (
unsigned int i = 0; i < extrStr.length(); ++i) {
2457 extrStr[i] = toupper(extrStr[i]);
2460 if (extrStr ==
"CONST" || extrStr ==
"CONSTANT") {
2462 }
else if (extrStr ==
"LIN" || extrStr ==
"LINEAR") {
2464 }
else if (extrStr ==
"EXP" || extrStr ==
"EXPONENTIAL") {
2504 const double bx,
const double by,
const double bz,
2505 const double e,
const double b)
const {
2555 const double eb = fabs(ex * bx + ey * by + ez * bz);
2556 if (eb > 0.2 * e * b) {
2557 const double ebxy = ex * by - ey * bx;
2558 const double ebxz = ex * bz - ez * bx;
2559 const double ebzy = ez * by - ey * bz;
2560 return asin(std::min(1., sqrt(ebxy * ebxy + ebxz * ebxz + ebzy * ebzy) / (e * b)));
2562 return acos(std::min(1., eb / (e * b)));
2566 const std::vector<double>& fields,
2567 const unsigned int intpMeth,
const int extrLow,
2568 const int extrHigh) {
2574 const int nSizeTable = fields.size();
2576 if (e < 0. || nSizeTable < 1)
return 0.;
2580 if (nSizeTable == 1) {
2583 }
else if (e < fields[0]) {
2585 if (fields[0] >= fields[1]) {
2588 std::cerr <<
" First two field values coincide.\n";
2589 std::cerr <<
" No extrapolation to lower fields.\n";
2592 }
else if (extrLow == 1) {
2594 const double extr4 = (table[1] - table[0]) / (fields[1] - fields[0]);
2595 const double extr3 = table[0] - extr4 * fields[0];
2596 result = extr3 + extr4 * e;
2597 }
else if (extrLow == 2) {
2599 const double extr4 = log(table[1] / table[0]) / (fields[1] - fields[0]);
2600 const double extr3 = log(table[0] - extr4 * fields[0]);
2601 result = std::exp(std::min(50., extr3 + extr4 * e));
2605 }
else if (e > fields[nSizeTable - 1]) {
2607 if (fields[nSizeTable - 1] <= fields[nSizeTable - 2]) {
2610 std::cerr <<
" Last two field values coincide.\n";
2611 std::cerr <<
" No extrapolation to higher fields.\n";
2613 result = table[nSizeTable - 1];
2614 }
else if (extrHigh == 1) {
2616 const double extr2 = (table[nSizeTable - 1] - table[nSizeTable - 2]) /
2617 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
2618 const double extr1 =
2619 table[nSizeTable - 1] - extr2 * fields[nSizeTable - 1];
2620 result = extr1 + extr2 * e;
2621 }
else if (extrHigh == 2) {
2623 const double extr2 = log(table[nSizeTable - 1] / table[nSizeTable - 2]) /
2624 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
2625 const double extr1 =
2626 log(table[nSizeTable - 1]) - extr2 * fields[nSizeTable - 1];
2627 result = exp(std::min(50., extr1 + extr2 * e));
2629 result = table[nSizeTable - 1];
2641 const unsigned int eRes,
const unsigned int bRes,
2642 const unsigned int aRes,
2643 std::vector<std::vector<std::vector<double> > >& tab,
const double val) {
2645 if (eRes == 0 || bRes == 0 || aRes == 0) {
2646 std::cerr <<
m_className <<
"::InitParamArrays:\n";
2647 std::cerr <<
" Invalid grid.\n";
2651 tab.assign(aRes, std::vector<std::vector<double> >(bRes, std::vector<double>(eRes, val)));
2664 const unsigned int eRes,
const unsigned int bRes,
2665 const unsigned int aRes,
const unsigned int tRes,
2666 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
2669 if (eRes == 0 || bRes == 0 || aRes == 0 || tRes == 0) {
2670 std::cerr <<
m_className <<
"::InitParamArrays: Invalid grid.\n";
2675 for (
unsigned int l = 0; l < tRes; ++l) {
2676 tab[l].resize(aRes);
2677 for (
unsigned int i = 0; i < aRes; ++i) {
2678 tab[l][i].resize(bRes);
2679 for (
unsigned int j = 0; j < bRes; ++j) {
2680 tab[l][i][j].assign(eRes, val);
void ResetHoleAttachment()
virtual void GetComponent(const unsigned int i, std::string &label, double &f)
bool m_hasElectronDiffTens
virtual bool GetPhotonCollision(const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)
bool SetIonMobility(const unsigned int ie, const unsigned int ib, const unsigned int ia, const double mu)
void ResetElectronAttachment()
virtual double GetMassDensity() const
unsigned int m_extrLowMobility
std::vector< double > m_bFields
bool GetIonDissociation(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &diss)
virtual void GetElectronMomentum(const double e, double &px, double &py, double &pz, int &band)
void SetTemperature(const double t)
unsigned int m_intpDiffusion
bool GetElectronVelocityB(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
std::vector< std::vector< std::vector< double > > > tabHoleVelocityE
unsigned int m_extrLowDiffusion
bool GetElectronVelocityE(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
void ResetElectronLorentzAngle()
void CloneTensor(std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const unsigned int n, const std::vector< double > &efields, const std::vector< double > &bfields, const std::vector< double > &angles, const unsigned int intp, const unsigned int extrLow, const unsigned int extrHigh, const double init, const std::string &label)
virtual bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
bool m_hasElectronDiffTrans
virtual double ScaleAttachment(const double eta) const
unsigned int m_extrLowLorentzAngle
virtual bool GetElectronCollision(const double e, int &type, int &level, double &e1, double &dx, double &dy, double &dz, int &nion, int &ndxc, int &band)
void SetExtrapolationMethodIonDissociation(const std::string &extrLow, const std::string &extrHigh)
void SetInterpolationMethodIonDissociation(const unsigned int intrp)
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
std::vector< std::vector< std::vector< double > > > tabElectronVelocityB
unsigned int m_extrHighAttachment
virtual double ScaleDiffusion(const double d) const
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)
unsigned int m_intpMobility
virtual double ScaleLorentzAngle(const double lor) const
unsigned int m_intpAttachment
virtual bool ElectronLorentzAngle(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &lor)
bool GetIonLongitudinalDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
bool m_hasElectronVelocityB
bool GetHoleAttachment(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &eta)
bool GetHoleVelocityExB(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
bool GetExtrapolationIndex(std::string extrStr, unsigned int &extrNb)
void ResetIonDissociation()
bool GetElectronAttachment(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &eta)
unsigned int m_extrHighDiffusion
virtual bool GetDielectricFunction(const double e, double &eps1, double &eps2, const unsigned int i=0)
std::vector< std::vector< std::vector< double > > > tabIonDissociation
unsigned int m_extrHighMobility
std::vector< std::vector< std::vector< double > > > tabElectronVelocityE
void SetFieldGrid(double emin, double emax, int ne, bool logE, double bmin=0., double bmax=0., int nb=1, double amin=0., double amax=0., int na=1)
virtual void SetNumberDensity(const double n)
unsigned int m_intpTownsend
unsigned int m_extrLowAttachment
unsigned int m_extrHighDissociation
void InitParamArrays(const unsigned int eRes, const unsigned int bRes, const unsigned int aRes, std::vector< std::vector< std::vector< double > > > &tab, const double val)
double Interpolate1D(const double e, const std::vector< double > &table, const std::vector< double > &fields, const unsigned int intpMeth, const int jExtr, const int iExtr)
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)
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)
bool GetIonMobility(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &mu)
unsigned int m_intpVelocity
void SetExtrapolationMethodTownsend(const std::string &extrLow, const std::string &extrHigh)
std::vector< std::vector< std::vector< double > > > tabElectronDiffLong
virtual void SetAtomicNumber(const double z)
std::vector< std::vector< std::vector< double > > > tabElectronLorentzAngle
unsigned int m_extrHighLorentzAngle
void SetExtrapolationMethodIonMobility(const std::string &extrLow, const std::string &extrHigh)
virtual double ScaleElectricField(const double e) const
std::vector< std::vector< std::vector< double > > > tabElectronAttachment
virtual double ScaleDiffusionTensor(const double d) const
virtual double GetElectronNullCollisionRate(const int band=0)
bool GetElectronTownsend(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &alpha)
bool GetElectronLorentzAngle(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &lor)
virtual bool GetIonisationProduct(const unsigned int i, int &type, double &energy) const
unsigned int m_extrLowVelocity
virtual double ScaleTownsend(const double alpha) const
virtual double GetPhotonCollisionRate(const double e)
void SetDielectricConstant(const double eps)
unsigned int m_extrHighTownsend
virtual bool GetDeexcitationProduct(const unsigned int i, double &t, double &s, int &type, double &energy) const
virtual double GetElectronCollisionRate(const double e, const int band=0)
bool GetHoleTownsend(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &alpha)
void SetInterpolationMethodVelocity(const unsigned int intrp)
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)
unsigned int m_extrHighVelocity
void SetInterpolationMethodDiffusion(const unsigned int intrp)
std::vector< std::vector< std::vector< double > > > tabHoleTownsend
unsigned int m_extrLowTownsend
void SetExtrapolationMethodDiffusion(const std::string &extrLow, const std::string &extrHigh)
std::vector< double > m_eFields
void GetFieldGrid(std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles)
std::vector< std::vector< std::vector< std::vector< double > > > > tabHoleDiffTens
virtual bool ElectronTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
void ResetElectronDiffusion()
std::vector< std::vector< std::vector< double > > > tabIonDiffTrans
virtual bool GetOpticalDataRange(double &emin, double &emax, const unsigned int i=0)
virtual void SetMassDensity(const double rho)
void CloneTable(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 unsigned int extrLow, const unsigned int extrHigh, const double init, const std::string &label)
virtual double ScaleDissociation(const double diss) const
bool GetElectronVelocityExB(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
unsigned int m_extrLowDissociation
std::vector< std::vector< std::vector< std::vector< double > > > > tabElectronDiffTens
std::vector< double > m_bAngles
void InitParamTensor(const unsigned int eRes, const unsigned int bRes, const unsigned int aRes, const unsigned int tRes, std::vector< std::vector< std::vector< std::vector< double > > > > &tab, const double val)
bool GetElectronTransverseDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
virtual double GetElectronEnergy(const double px, const double py, const double pz, double &vx, double &vy, double &vz, const int band=0)
void SetInterpolationMethodIonMobility(const unsigned int intrp)
std::vector< std::vector< std::vector< double > > > tabHoleVelocityExB
void SetExtrapolationMethodVelocity(const std::string &extrLow, const std::string &extrHigh)
virtual bool ElectronAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
bool m_hasElectronVelocityExB
std::vector< std::vector< std::vector< double > > > tabIonMobility
bool m_hasElectronLorentzAngle
void SetPressure(const double p)
bool GetHoleVelocityE(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
int thrElectronAttachment
bool GetHoleVelocityB(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &v)
bool m_hasElectronDiffLong
std::vector< std::vector< std::vector< double > > > tabHoleDiffTrans
virtual void SetAtomicWeight(const double a)
void SetExtrapolationMethodAttachment(const std::string &extrLow, const std::string &extrHigh)
unsigned int m_intpLorentzAngle
std::vector< std::vector< std::vector< double > > > tabHoleVelocityB
std::vector< std::vector< std::vector< double > > > tabHoleDiffLong
unsigned int m_nComponents
std::vector< std::vector< std::vector< double > > > tabIonDiffLong
bool GetHoleTransverseDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
bool GetElectronLongitudinalDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
void SetInterpolationMethodAttachment(const unsigned int intrp)
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)
bool GetHoleLongitudinalDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dl)
std::vector< std::vector< std::vector< double > > > tabHoleAttachment
virtual bool IonDissociation(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &diss)
bool m_hasIonDissociation
unsigned int m_intpDissociation
void ResetHoleDiffusion()
bool m_hasHoleVelocityExB
bool m_hasElectronVelocityE
std::vector< std::vector< std::vector< double > > > tabElectronTownsend
bool m_hasElectronAttachment
void ResetElectronTownsend()
virtual bool HoleAttachment(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &eta)
void ResetElectronVelocity()
void SetInterpolationMethodTownsend(const unsigned int intrp)
virtual bool GetPhotoAbsorptionCrossSection(const double e, double &sigma, const unsigned int i=0)
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)
std::vector< std::vector< std::vector< double > > > tabElectronDiffTrans
std::vector< std::vector< std::vector< double > > > tabElectronVelocityExB
bool GetIonTransverseDiffusion(const unsigned int ie, const unsigned int ib, const unsigned int ia, double &dt)
bool Boxin3(const std::vector< std::vector< std::vector< double > > > &value, const std::vector< double > &xAxis, const std::vector< double > &yAxis, const std::vector< double > &zAxis, const int nx, const int ny, const int nz, const double xx, const double yy, const double zz, double &f, const int iOrder)
double Divdif(const std::vector< double > &f, const std::vector< double > &a, int nn, double x, int mm)
void RndmDirection(double &dx, double &dy, double &dz, const double length=1.)
Draw a random (isotropic) direction vector.