16 : m_className(
"Medium"),
19 m_temperature(293.15),
114 SetFieldGrid(100., 100000., 20,
true, 0., 0., 1, 0., 0., 1);
121 std::cerr <<
" Temperature [K] must be greater than zero.\n";
132 std::cerr <<
" Pressure [Torr] must be greater than zero.\n";
142 std::cerr <<
m_className <<
"::SetDielectricConstant:\n";
143 std::cerr <<
" Dielectric constant must be >= 1.\n";
156 std::string& label,
double& f) {
160 std::cerr <<
" Index out of range.\n";
170 std::cerr <<
m_className <<
"::SetAtomicNumber:\n";
171 std::cerr <<
" Atomic number must be >= 1.\n";
181 std::cerr <<
m_className <<
"::SetAtomicWeight:\n";
182 std::cerr <<
" Atomic weight must be greater than zero.\n";
192 std::cerr <<
m_className <<
"::SetNumberDensity:\n";
193 std::cerr <<
" Density [cm-3] must be greater than zero.\n";
204 std::cerr <<
" Density [g/cm3] must be greater than zero.\n";
210 std::cerr <<
" Atomic weight is not defined.\n";
218 const double bx,
const double by,
const double bz,
219 double& vx,
double& vy,
double& vz) {
226 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
228 if (e < Small || e0 < Small)
return false;
231 const double b =
sqrt(bx * bx + by * by + bz * bz);
236 const double eb =
fabs(ex * bx + ey * by + ez * bz);
237 if (eb > 0.2 * e * b) {
238 ebang =
asin(std::min(
239 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
240 pow(ez * by - ey * bz, 2)) /
243 ebang =
acos(std::min(1., eb / (e * b)));
258 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
259 std::cerr <<
" Interpolation of velocity along E failed.\n";
266 const double q = -1.;
267 const double mu = q * ve / e;
276 double ue[3] = {ex / e, ey / e, ez / e};
277 double uexb[3] = {ey * bz - ez * by, ez * bx - ex * bz, ex * by - ey * bx};
279 sqrt(uexb[0] * uexb[0] + uexb[1] * uexb[1] + uexb[2] * uexb[2]);
290 double ubt[3] = {uexb[1] * ez - uexb[2] * ey, uexb[2] * ex - uexb[0] * ez,
291 uexb[0] * ey - uexb[1] * ex};
292 const double bt =
sqrt(ubt[0] * ubt[0] + ubt[1] * ubt[1] + ubt[2] * ubt[2]);
305 std::cout << std::setprecision(5);
306 std::cout <<
m_className <<
"::ElectronVelocity:\n";
307 std::cout <<
" unit vector along E: (" << ue[0] <<
", " << ue[1]
308 <<
", " << ue[2] <<
")\n";
309 std::cout <<
" unit vector along E x B: (" << uexb[0] <<
", "
310 << uexb[1] <<
", " << uexb[2] <<
")\n";
311 std::cout <<
" unit vector along Bt: (" << ubt[0] <<
", " << ubt[1]
312 <<
", " << ubt[2] <<
")\n";
316 double ve = 0., vbt = 0., vexb = 0.;
321 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
322 std::cerr <<
" Interpolation of velocity along E failed.\n";
328 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
329 std::cerr <<
" Interpolation of velocity along ExB failed.\n";
335 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
336 std::cerr <<
" Interpolation of velocity along Bt failed.\n";
350 const double q = -1.;
351 if (ex * bx + ey * by + ez * bz > 0.) vbt =
fabs(vbt);
352 else vbt = -
fabs(vbt);
353 vx = q * (ve * ue[0] + q * q * vbt * ubt[0] + q * vexb * uexb[0]);
354 vy = q * (ve * ue[1] + q * q * vbt * ubt[1] + q * vexb * uexb[1]);
355 vz = q * (ve * ue[2] + q * q * vbt * ubt[2] + q * vexb * uexb[2]);
366 std::cerr <<
m_className <<
"::ElectronVelocity:\n";
367 std::cerr <<
" Interpolation of velocity along E failed.\n";
376 const double q = -1.;
377 const double mu = q * ve / e;
378 const double eb = bx * ex + by * ey + bz * ez;
379 const double nom = 1. +
pow(mu * b, 2);
380 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
381 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
382 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
389 const double ez,
const double bx,
390 const double by,
const double bz,
double& dl,
395 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
397 if (e < Small || e0 < Small)
return true;
401 const double b =
sqrt(bx * bx + by * by + bz * bz);
405 const double eb =
fabs(ex * bx + ey * by + ez * bz);
406 if (eb > 0.2 * e * b) {
407 ebang =
asin(std::min(
408 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
409 pow(ez * by - ey * bz, 2)) /
412 ebang =
acos(std::min(1., eb / (e * b)));
454 if (dl < 0.) dl = 0.;
455 if (dt < 0.) dt = 0.;
463 const double ez,
const double bx,
464 const double by,
const double bz,
468 cov[0][0] = cov[0][1] = cov[0][2] = 0.;
469 cov[1][0] = cov[1][1] = cov[1][2] = 0.;
470 cov[2][0] = cov[2][1] = cov[2][2] = 0.;
475 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
477 if (e < Small || e0 < Small)
return true;
481 const double b =
sqrt(bx * bx + by * by + bz * bz);
486 const double eb =
fabs(ex * bx + ey * by + ez * bz);
487 if (eb > 0.2 * e * b) {
488 ebang =
asin(std::min(
489 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
490 pow(ez * by - ey * bz, 2)) /
493 ebang =
acos(std::min(1., eb / (e * b)));
500 for (
int l = 0; l < 6; ++l) {
511 cov[0][1] = cov[1][0] = diff;
513 cov[0][2] = cov[2][0] = diff;
515 cov[1][2] = cov[2][1] = diff;
520 for (
int l = 0; l < 6; ++l) {
530 cov[0][1] = cov[1][0] = diff;
532 cov[0][2] = cov[2][0] = diff;
534 cov[1][2] = cov[2][1] = diff;
543 const double bx,
const double by,
const double bz,
549 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
551 if (e < Small || e0 < Small)
return true;
555 const double b =
sqrt(bx * bx + by * by + bz * bz);
560 const double eb =
fabs(ex * bx + ey * by + ez * bz);
561 if (eb > 0.2 * e * b) {
562 ebang =
asin(std::min(
563 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
564 pow(ez * by - ey * bz, 2)) /
567 ebang =
acos(std::min(1., eb / (e * b)));
610 const double ez,
const double bx,
611 const double by,
const double bz,
double& eta) {
616 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
618 if (e < Small || e0 < Small)
return true;
622 const double b =
sqrt(bx * bx + by * by + bz * bz);
627 const double eb =
fabs(ex * bx + ey * by + ez * bz);
628 if (eb > 0.2 * e * b) {
629 ebang =
asin(std::min(
630 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
631 pow(ez * by - ey * bz, 2)) /
634 ebang =
acos(std::min(1., eb / (e * b)));
678 const double pz,
double& vx,
double& vy,
679 double& vz,
const int band) {
682 std::cerr <<
m_className <<
"::GetElectronEnergy:\n";
683 std::cerr <<
" Unknown band index.\n";
686 vx = SpeedOfLight * px / ElectronMass;
687 vy = SpeedOfLight * py / ElectronMass;
688 vz = SpeedOfLight * pz / ElectronMass;
690 return 0.5 * (px * px + py * py + pz * pz) / ElectronMass;
694 double& pz,
int& band) {
696 const double p =
sqrt(2. * ElectronMass * e) / SpeedOfLight;
698 const double stheta =
sqrt(1. - ctheta * ctheta);
701 px = p * stheta *
cos(phi);
702 py = p * stheta *
sin(phi);
711 std::cerr <<
m_className <<
"::GetElectronNullCollisionRate:\n";
712 std::cerr <<
" Function is not implemented.\n";
721 std::cerr <<
m_className <<
"::GetElectronCollisionRate:\n";
722 std::cerr <<
" Function is not implemented.\n";
728 double& e1,
double& dx,
double& dy,
729 double& dz,
int& nion,
int& ndxc,
int& band) {
733 nion = ndxc = band = 0;
735 const double stheta =
sqrt(1. - ctheta * ctheta);
737 dx =
cos(phi) * stheta;
738 dy =
sin(phi) * stheta;
742 std::cerr <<
m_className <<
"::GetElectronCollision:\n";
743 std::cerr <<
" Function is not implemented.\n";
751 std::cerr <<
m_className <<
"::GetIonisationProduct:\n";
752 std::cerr <<
" Ionisation product " << i <<
" requested.\n";
753 std::cerr <<
" Not supported. Program bug!\n";
761 int& type,
double& energy) {
764 std::cerr <<
m_className <<
"::GetDeexcitationProduct:\n";
765 std::cerr <<
" Deexcitation product " << i <<
" requested.\n";
766 std::cerr <<
" Not supported. Program bug!\n";
774 const double bx,
const double by,
const double bz,
775 double& vx,
double& vy,
double& vz) {
782 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
784 if (e < Small || e0 < Small)
return true;
787 const double b =
sqrt(bx * bx + by * by + bz * bz);
792 const double eb =
fabs(ex * bx + ey * by + ez * bz);
793 if (eb > 0.2 * e * b) {
794 ebang =
asin(std::min(
795 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
796 pow(ez * by - ey * bz, 2)) /
799 ebang =
acos(std::min(1., eb / (e * b)));
814 std::cerr <<
" Interpolation of velocity along E failed.\n";
822 const double mu = q * ve / e;
831 double ue[3] = {ex / e, ey / e, ez / e};
832 double uexb[3] = {ey * bz - ez * by, ez * bx - ex * bz, ex * by - ey * bx};
834 sqrt(uexb[0] * uexb[0] + uexb[1] * uexb[1] + uexb[2] * uexb[2]);
845 double ubt[3] = {uexb[1] * ez - uexb[2] * ey, uexb[2] * ex - uexb[0] * ez,
846 uexb[0] * ey - uexb[1] * ex};
847 const double bt =
sqrt(ubt[0] * ubt[0] + ubt[1] * ubt[1] + ubt[2] * ubt[2]);
860 double ve = 0., vbt = 0., vexb = 0.;
866 std::cerr <<
" Interpolation of velocity along E failed.\n";
873 std::cerr <<
" Interpolation of velocity along ExB failed.\n";
880 std::cerr <<
" Interpolation of velocity along Bt failed.\n";
892 if (ex * bx + ey * by + ez * bz > 0.) vbt =
fabs(vbt);
893 else vbt = -
fabs(vbt);
894 vx = q * (ve * ue[0] + q * q * vbt * ubt[0] + q * vexb * uexb[0]);
895 vy = q * (ve * ue[1] + q * q * vbt * ubt[1] + q * vexb * uexb[1]);
896 vz = q * (ve * ue[2] + q * q * vbt * ubt[2] + q * vexb * uexb[2]);
908 std::cerr <<
" Interpolation of velocity along E failed.\n";
917 const double mu = q * ve / e;
918 const double eb = bx * ex + by * ey + bz * ez;
919 const double nom = 1. +
pow(mu * b, 2);
920 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
921 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
922 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
929 const double bx,
const double by,
const double bz,
930 double& dl,
double& dt) {
934 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
936 if (e < Small || e0 < Small)
return true;
940 const double b =
sqrt(bx * bx + by * by + bz * bz);
944 const double eb =
fabs(ex * bx + ey * by + ez * bz);
945 if (eb > 0.2 * e * b) {
946 ebang =
asin(std::min(
947 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
948 pow(ez * by - ey * bz, 2)) /
951 ebang =
acos(std::min(1., eb / (e * b)));
993 if (dl < 0.) dl = 0.;
994 if (dt < 0.) dt = 0.;
1002 const double bx,
const double by,
const double bz,
1006 cov[0][0] = cov[0][1] = cov[0][2] = 0.;
1007 cov[1][0] = cov[1][1] = cov[1][2] = 0.;
1008 cov[2][0] = cov[2][1] = cov[2][2] = 0.;
1013 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1015 if (e < Small || e0 < Small)
return true;
1019 const double b =
sqrt(bx * bx + by * by + bz * bz);
1024 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1025 if (eb > 0.2 * e * b) {
1026 ebang =
asin(std::min(
1027 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1028 pow(ez * by - ey * bz, 2)) /
1031 ebang =
acos(std::min(1., eb / (e * b)));
1038 for (
int l = 0; l < 6; ++l) {
1048 }
else if (l == 3) {
1049 cov[0][1] = cov[1][0] = diff;
1050 }
else if (l == 4) {
1051 cov[0][2] = cov[2][0] = diff;
1052 }
else if (l == 5) {
1053 cov[1][2] = cov[2][1] = diff;
1058 for (
int l = 0; l < 6; ++l) {
1066 }
else if (l == 3) {
1067 cov[0][1] = cov[1][0] = diff;
1068 }
else if (l == 4) {
1069 cov[0][2] = cov[2][0] = diff;
1070 }
else if (l == 5) {
1071 cov[1][2] = cov[2][1] = diff;
1080 const double bx,
const double by,
const double bz,
1086 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1088 if (e < Small || e0 < Small)
return true;
1092 const double b =
sqrt(bx * bx + by * by + bz * bz);
1097 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1098 if (eb > 0.2 * e * b) {
1099 ebang =
asin(std::min(
1100 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1101 pow(ez * by - ey * bz, 2)) /
1104 ebang =
acos(std::min(1., eb / (e * b)));
1145 const double bx,
const double by,
const double bz,
1151 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1153 if (e < Small || e0 < Small)
return true;
1157 const double b =
sqrt(bx * bx + by * by + bz * bz);
1162 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1163 if (eb > 0.2 * e * b) {
1164 ebang =
asin(std::min(
1165 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1166 pow(ez * by - ey * bz, 2)) /
1169 ebang =
acos(std::min(1., eb / (e * b)));
1212 const double bx,
const double by,
const double bz,
1213 double& vx,
double& vy,
double& vz) {
1218 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1220 if (e < Small || e0 < Small)
return true;
1222 const double b =
sqrt(bx * bx + by * by + bz * bz);
1229 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1230 if (eb > 0.2 * e * b) {
1231 ebang =
asin(std::min(
1232 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1233 pow(ez * by - ey * bz, 2)) /
1236 ebang =
acos(std::min(1., eb / (e * b)));
1251 const double q = 1.;
1258 const double eb = bx * ex + by * ey + bz * ez;
1259 const double nom = 1. +
pow(mu * b, 2);
1260 vx = mu * (ex + mu * (ey * bz - ez * by) + mu * mu * bx * eb) / nom;
1261 vy = mu * (ey + mu * (ez * bx - ex * bz) + mu * mu * by * eb) / nom;
1262 vz = mu * (ez + mu * (ex * by - ey * bx) + mu * mu * bz * eb) / nom;
1269 const double bx,
const double by,
const double bz,
1270 double& dl,
double& dt) {
1274 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1276 if (e < Small || e0 < Small)
return true;
1280 const double b =
sqrt(bx * bx + by * by + bz * bz);
1284 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1285 if (eb > 0.2 * e * b) {
1286 ebang =
asin(std::min(
1287 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1288 pow(ez * by - ey * bz, 2)) /
1291 ebang =
acos(std::min(1., eb / (e * b)));
1336 const double bx,
const double by,
const double bz,
1342 const double e =
sqrt(ex * ex + ey * ey + ez * ez);
1344 if (e < Small || e0 < Small)
return true;
1348 const double b =
sqrt(bx * bx + by * by + bz * bz);
1353 const double eb =
fabs(ex * bx + ey * by + ez * bz);
1354 if (eb > 0.2 * e * b) {
1355 ebang =
asin(std::min(
1356 1.,
sqrt(
pow(ex * by - ey * bx, 2) +
pow(ex * bz - ez * bx, 2) +
1357 pow(ez * by - ey * bz, 2)) /
1360 ebang =
acos(std::min(1., eb / (e * b)));
1403 const unsigned int& i) {
1406 std::cerr <<
m_className <<
"::GetOpticalDataRange:\n";
1407 std::cerr <<
" Component " << i <<
" does not exist.\n";
1412 std::cerr <<
m_className <<
"::GetOpticalDataRange:\n";
1413 std::cerr <<
" Function is not implemented.\n";
1420 const unsigned int& i) {
1423 std::cerr <<
m_className <<
"::GetDielectricFunction:\n";
1424 std::cerr <<
" Component " << i <<
" does not exist.\n";
1429 std::cerr <<
m_className <<
"::GetDielectricFunction:\n";
1430 std::cerr <<
" Energy must be > 0.\n";
1435 std::cerr <<
m_className <<
"::GetDielectricFunction:\n";
1436 std::cerr <<
" Function is not implemented.\n";
1444 const unsigned int& i) {
1447 std::cerr <<
m_className <<
"::GetPhotoAbsorptionCrossSection:\n";
1448 std::cerr <<
" Component " << i <<
" does not exist.\n";
1453 std::cerr <<
m_className <<
"::GetPhotoAbsorptionCrossSection:\n";
1454 std::cerr <<
" Energy must be > 0.\n";
1459 std::cerr <<
m_className <<
"::GetPhotoAbsorptionCrossSection:\n";
1460 std::cerr <<
" Function is not implemented.\n";
1471 return sigma *
m_density * SpeedOfLight;
1475 double& e1,
double& ctheta,
int& nsec,
1571 double bmin,
double bmax,
int nb,
double amin,
1572 double amax,
int na) {
1577 std::cerr <<
" Number of E-fields must be > 0.\n";
1581 if (emin < 0. || emax < 0.) {
1583 std::cerr <<
" Electric fields must be positive.\n";
1589 std::cerr <<
" Swapping min./max. E-field.\n";
1590 const double etemp = emin;
1600 std::cerr <<
" Min. E-field must be non-zero for log. scale.\n";
1605 std::cerr <<
" Number of E-fields must be > 1 for log. scale.\n";
1608 estep =
pow(emax / emin, 1. / (ne - 1.));
1611 if (ne > 1) estep = (emax - emin) / (ne - 1.);
1617 std::cerr <<
" Number of B-fields must be > 0.\n";
1620 if (bmax < 0. || bmin < 0.) {
1622 std::cerr <<
" Magnetic fields must be positive.\n";
1627 std::cerr <<
" Swapping min./max. B-field.\n";
1628 const double btemp = bmin;
1634 if (nb > 1) bstep = (bmax - bmin) / (nb - 1.);
1639 std::cerr <<
" Number of angles must be > 0.\n";
1642 if (amax < 0. || amin < 0.) {
1644 std::cerr <<
" Angles must be positive.\n";
1649 std::cerr <<
" Swapping min./max. angle.\n";
1650 const double atemp = amin;
1655 if (na > 1) astep = (amax - amin) / (na - 1.);
1658 std::vector<double> eFieldsNew;
1659 std::vector<double> bFieldsNew;
1660 std::vector<double> bAnglesNew;
1661 eFieldsNew.resize(ne);
1662 bFieldsNew.resize(nb);
1663 bAnglesNew.resize(na);
1665 for (
int i = 0; i < ne; ++i) {
1667 eFieldsNew[i] = emin *
pow(estep, i);
1669 eFieldsNew[i] = emin + i * estep;
1672 for (
int i = 0; i < nb; ++i) {
1673 bFieldsNew[i] = bmin + i * bstep;
1675 if (na == 1 && nb == 1 &&
fabs(bmin) < 1.e-4) {
1676 bAnglesNew[0] = HalfPi;
1678 for (
int i = 0; i < na; ++i) {
1679 bAnglesNew[i] = amin + i * astep;
1686 const std::vector<double>& bfields,
1687 const std::vector<double>& angles) {
1689 if (efields.empty()) {
1691 std::cerr <<
" Number of E-fields must be > 0.\n";
1694 if (bfields.empty()) {
1696 std::cerr <<
" Number of B-fields must be > 0.\n";
1699 if (angles.empty()) {
1701 std::cerr <<
" Number of angles must be > 0.\n";
1706 if (efields[0] < 0.) {
1708 std::cerr <<
" E-fields must be >= 0.\n";
1710 if (bfields[0] < 0.) {
1712 std::cerr <<
" B-fields must be >= 0.\n";
1714 if (angles[0] < 0.) {
1716 std::cerr <<
" Angles must be >= 0.\n";
1719 const unsigned int nEfieldsNew = efields.size();
1720 const unsigned int nBfieldsNew = bfields.size();
1721 const unsigned int nAnglesNew = angles.size();
1723 if (nEfieldsNew > 1) {
1724 for (
unsigned int i = 1; i < nEfieldsNew; ++i) {
1725 if (efields[i] <= efields[i - 1]) {
1727 std::cerr <<
" E-fields are not in ascending order.\n";
1732 if (nBfieldsNew > 1) {
1733 for (
unsigned int i = 1; i < nBfieldsNew; ++i) {
1734 if (bfields[i] <= bfields[i - 1]) {
1736 std::cerr <<
" B-fields are not in ascending order.\n";
1741 if (nAnglesNew > 1) {
1742 for (
unsigned int i = 1; i < nAnglesNew; ++i) {
1743 if (angles[i] <= angles[i - 1]) {
1745 std::cerr <<
" Angles are not in ascending order.\n";
1753 std::cout <<
" E-fields:\n";
1754 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
1755 std::cout <<
" " << efields[i] <<
"\n";
1757 std::cout <<
" B-fields:\n";
1758 for (
unsigned int i = 0; i < nBfieldsNew; ++i) {
1759 std::cout <<
" " << bfields[i] <<
"\n";
1761 std::cout <<
" Angles:\n";
1762 for (
unsigned int i = 0; i < nAnglesNew; ++i) {
1763 std::cout <<
" " << angles[i] <<
"\n";
1772 "electron velocity along E");
1777 "electron velocity along Bt");
1782 "electron velocity along ExB");
1787 "electron longitudinal diffusion");
1792 "electron transverse diffusion");
1797 "electron Townsend coefficient");
1802 "electron attachment coefficient");
1807 "electron diffusion tensor");
1814 "hole velocity along E");
1819 "hole velocity along Bt");
1824 "hole velocity along ExB");
1829 "hole longitudinal diffusion");
1834 "hole transverse diffusion");
1839 "hole Townsend coefficient");
1844 "hole attachment coefficient");
1849 "hole diffusion tensor");
1861 "ion longitudinal diffusion");
1866 "ion transverse diffusion");
1871 "ion dissociation");
1887 std::vector<double>& bfields,
1888 std::vector<double>& angles) {
1896 const unsigned int& ib,
1897 const unsigned int& ia,
double& v) {
1900 std::cerr <<
m_className <<
"::GetElectronVelocityE:\n";
1901 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1902 <<
") out of range.\n";
1908 std::cerr <<
m_className <<
"::GetElectronVelocityE:\n";
1909 std::cerr <<
" Data not available.\n";
1920 const unsigned int& ib,
1921 const unsigned int& ia,
double& v) {
1924 std::cerr <<
m_className <<
"::GetElectronVelocityExB:\n";
1925 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1926 <<
") out of range.\n";
1932 std::cerr <<
m_className <<
"::GetElectronVelocityExB:\n";
1933 std::cerr <<
" Data not available.\n";
1944 const unsigned int& ib,
1945 const unsigned int& ia,
double& v) {
1948 std::cerr <<
m_className <<
"::GetElectronVelocityB:\n";
1949 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1950 <<
") out of range.\n";
1956 std::cerr <<
m_className <<
"::GetElectronVelocityB:\n";
1957 std::cerr <<
" Data not available.\n";
1968 const unsigned int& ib,
1969 const unsigned int& ia,
1973 std::cerr <<
m_className <<
"::GetElectronLongitudinalDiffusion:\n";
1974 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
1975 <<
") out of range.\n";
1981 std::cerr <<
m_className <<
"::GetElectronLongitudinalDiffusion:\n";
1982 std::cerr <<
" Data not available.\n";
1993 const unsigned int& ib,
1994 const unsigned int& ia,
1998 std::cerr <<
m_className <<
"::GetElectronTransverseDiffusion:\n";
1999 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2000 <<
") out of range.\n";
2006 std::cerr <<
m_className <<
"::GetElectronTransverseDiffusion:\n";
2007 std::cerr <<
" Data not available.\n";
2018 const unsigned int& ib,
2019 const unsigned int& ia,
double& alpha) {
2022 std::cerr <<
m_className <<
"::GetElectronTownsend:\n";
2023 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2024 <<
") out of range.\n";
2030 std::cerr <<
m_className <<
"::GetElectronTownsend:\n";
2031 std::cerr <<
" Data not available.\n";
2042 const unsigned int& ib,
2043 const unsigned int& ia,
double& eta) {
2046 std::cerr <<
m_className <<
"::GetElectronAttachment:\n";
2047 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2048 <<
") out of range.\n";
2054 std::cerr <<
m_className <<
"::GetElectronAttachment:\n";
2055 std::cerr <<
" Data not available.\n";
2066 const unsigned int& ib,
2067 const unsigned int& ia,
double& v) {
2070 std::cerr <<
m_className <<
"::GetHoleVelocityE:\n";
2071 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2072 <<
") out of range.\n";
2078 std::cerr <<
m_className <<
"::GetHoleVelocityE:\n";
2079 std::cerr <<
" Data not available.\n";
2090 const unsigned int& ib,
2091 const unsigned int& ia,
double& v) {
2094 std::cerr <<
m_className <<
"::GetHoleVelocityExB:\n";
2095 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2096 <<
") out of range.\n";
2102 std::cerr <<
m_className <<
"::GetHoleVelocityExB:\n";
2103 std::cerr <<
" Data not available.\n";
2114 const unsigned int& ib,
2115 const unsigned int& ia,
double& v) {
2118 std::cerr <<
m_className <<
"::GetHoleVelocityB:\n";
2119 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2120 <<
") out of range.\n";
2126 std::cerr <<
m_className <<
"::GetHoleVelocityB:\n";
2127 std::cerr <<
" Data not available.\n";
2138 const unsigned int& ib,
2139 const unsigned int& ia,
double& dl) {
2142 std::cerr <<
m_className <<
"::GetHoleLongitudinalDiffusion:\n";
2143 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2144 <<
") out of range.\n";
2150 std::cerr <<
m_className <<
"::GetHoleLongitudinalDiffusion:\n";
2151 std::cerr <<
" Data not available.\n";
2162 const unsigned int& ib,
2163 const unsigned int& ia,
double& dt) {
2166 std::cerr <<
m_className <<
"::GetHoleTransverseDiffusion:\n";
2167 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2168 <<
") out of range.\n";
2174 std::cerr <<
m_className <<
"::GetHoleTransverseDiffusion:\n";
2175 std::cerr <<
" Data not available.\n";
2186 const unsigned int& ib,
2187 const unsigned int& ia,
double& alpha) {
2190 std::cerr <<
m_className <<
"::GetHoleTownsend:\n";
2191 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2192 <<
") out of range.\n";
2198 std::cerr <<
m_className <<
"::GetHoleTownsend:\n";
2199 std::cerr <<
" Data not available.\n";
2210 const unsigned int& ib,
2211 const unsigned int& ia,
double& eta) {
2214 std::cerr <<
m_className <<
"::GetHoleAttachment:\n";
2215 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2216 <<
") out of range.\n";
2222 std::cerr <<
m_className <<
"::GetHoleAttachment:\n";
2223 std::cerr <<
" Data not available.\n";
2234 const unsigned int& ia,
double& mu) {
2237 std::cerr <<
m_className <<
"::GetIonMobility:\n";
2238 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2239 <<
") out of range.\n";
2245 std::cerr <<
m_className <<
"::GetIonMobility:\n";
2246 std::cerr <<
" Data not available.\n";
2257 const unsigned int& ib,
2258 const unsigned int& ia,
double& dl) {
2261 std::cerr <<
m_className <<
"::GetIonLongitudinalDiffusion:\n";
2262 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2263 <<
") out of range.\n";
2269 std::cerr <<
m_className <<
"::GetIonLongitudinalDiffusion:\n";
2270 std::cerr <<
" Data not available.\n";
2281 const unsigned int& ib,
2282 const unsigned int& ia,
double& dt) {
2285 std::cerr <<
m_className <<
"::GetIonTransverseDiffusion:\n";
2286 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2287 <<
") out of range.\n";
2293 std::cerr <<
m_className <<
"::GetIonTransverseDiffusion:\n";
2294 std::cerr <<
" Data not available.\n";
2305 const unsigned int& ib,
2306 const unsigned int& ia,
double& diss) {
2309 std::cerr <<
m_className <<
"::GetIonDissociation:\n";
2310 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2311 <<
") out of range.\n";
2317 std::cerr <<
m_className <<
"::GetIonDissociation:\n";
2318 std::cerr <<
" Data not available.\n";
2329 const std::vector<double>& efields,
2330 const std::vector<double>& bfields,
2331 const std::vector<double>& angles,
2332 const unsigned int& intp,
2333 const unsigned int& extrLow,
2334 const unsigned int& extrHigh,
2335 const double init,
const std::string label) {
2339 std::cout <<
" Copying values of " << label <<
" to new grid.\n";
2343 const int nEfieldsNew = efields.size();
2344 const int nBfieldsNew = bfields.size();
2345 const int nAnglesNew = angles.size();
2348 std::vector<std::vector<std::vector<double> > > tabClone;
2350 InitParamArrays(nEfieldsNew, nBfieldsNew, nAnglesNew, tabClone, init);
2353 for (
int i = 0; i < nEfieldsNew; ++i) {
2354 for (
int j = 0; j < nBfieldsNew; ++j) {
2355 for (
int k = 0; k < nAnglesNew; ++k) {
2360 efields[i], val, intp)) {
2362 std::cerr <<
" Interpolation of " << label <<
" failed.\n";
2363 std::cerr <<
" Cannot copy value to new grid at: \n";
2364 std::cerr <<
" E = " << efields[i] <<
"\n";
2365 std::cerr <<
" B = " << bfields[j] <<
"\n";
2366 std::cerr <<
" angle: " << angles[k] <<
"\n";
2368 tabClone[k][j][i] = val;
2373 tabClone[k][j][i] = val;
2381 for (
int i = 0; i < nEfieldsNew; ++i) {
2382 for (
int j = 0; j < nBfieldsNew; ++j) {
2383 for (
int k = 0; k < nAnglesNew; ++k) {
2384 tab[k][j][i] = tabClone[k][j][i];
2392 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
2393 const unsigned int& n,
2394 const std::vector<double>& efields,
const std::vector<double>& bfields,
2395 const std::vector<double>& angles,
2396 const unsigned int& intp,
2397 const unsigned int& extrLow,
const unsigned int& extrHigh,
2399 const std::string& label) {
2402 const unsigned int nEfieldsNew = efields.size();
2403 const unsigned int nBfieldsNew = bfields.size();
2404 const unsigned int nAnglesNew = angles.size();
2407 std::vector<std::vector<std::vector<std::vector<double> > > > tabClone;
2409 InitParamTensor(nEfieldsNew, nBfieldsNew, nAnglesNew, n, tabClone, init);
2412 for (
unsigned int l = 0; l < n; ++l) {
2413 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
2414 for (
unsigned int j = 0; j < nBfieldsNew; ++j) {
2415 for (
unsigned int k = 0; k < nAnglesNew; ++k) {
2420 efields[i], val, intp)) {
2422 std::cerr <<
" Interpolation of " << label <<
" failed.\n";
2423 std::cerr <<
" Cannot copy value to new grid at: \n";
2424 std::cerr <<
" Index: " << l <<
"\n";
2425 std::cerr <<
" E = " << efields[i] <<
"\n";
2426 std::cerr <<
" B = " << bfields[j] <<
"\n";
2427 std::cerr <<
" angle: " << angles[k] <<
"\n";
2429 tabClone[l][k][j][i] = val;
2434 tabClone[l][k][j][i] = val;
2443 for (
unsigned int l = 0; l < n; ++l) {
2444 for (
unsigned int i = 0; i < nEfieldsNew; ++i) {
2445 for (
unsigned int j = 0; j < nBfieldsNew; ++j) {
2446 for (
unsigned int k = 0; k < nAnglesNew; ++k) {
2447 tab[l][k][j][i] = tabClone[l][k][j][i];
2455 const unsigned int& ia,
const double& mu) {
2459 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2460 std::cerr <<
" Index (" << ie <<
", " << ib <<
", " << ia
2461 <<
") out of range.\n";
2466 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2467 std::cerr <<
" Ion mobility table not initialised.\n";
2472 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2473 std::cerr <<
" Zero value not permitted.\n";
2479 std::cout <<
m_className <<
"::SetIonMobility:\n";
2480 std::cout <<
" Ion mobility at E = " <<
eFields[ie]
2482 <<
" set to " << mu <<
" cm2/(V ns).\n";
2488 const std::vector<double>& mobilities) {
2490 const int ne = efields.size();
2491 const int nm = mobilities.size();
2493 std::cerr <<
m_className <<
"::SetIonMobility:\n";
2494 std::cerr <<
" E-field and mobility arrays have different sizes.\n";
2500 for (
unsigned int i = 0; i <
m_nEfields; ++i) {
2505 std::cout <<
"E = " << e <<
", mu = " << mu <<
"\n";
2509 for (
unsigned int i = 0; i <
m_nAngles; ++i) {
2510 for (
unsigned int j = 0; j<
m_nBfields; ++j) {
2511 for (
unsigned int k = 0; k <
m_nEfields; ++k) {
2523 const std::string& extrHigh) {
2525 unsigned int iExtr = 0;
2529 std::cerr <<
m_className <<
"::SetExtrapolationMethodVelocity:\n";
2530 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2536 std::cerr <<
m_className <<
"::SetExtrapolationMethodVelocity:\n";
2537 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2542 const std::string& extrHigh) {
2544 unsigned int iExtr = 0;
2548 std::cerr <<
m_className <<
"::SetExtrapolationMethodDiffusion:\n";
2549 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2555 std::cerr <<
m_className <<
"::SetExtrapolationMethodDiffusion:\n";
2556 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2561 const std::string& extrHigh) {
2563 unsigned int iExtr = 0;
2567 std::cerr <<
m_className <<
"::SetExtrapolationMethodTownsend:\n";
2568 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2574 std::cerr <<
m_className <<
"::SetExtrapolationMethodTownsend:\n";
2575 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2580 const std::string& extrHigh) {
2582 unsigned int iExtr = 0;
2586 std::cerr <<
m_className <<
"::SetExtrapolationMethodAttachment:\n";
2587 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2593 std::cerr <<
m_className <<
"::SetExtrapolationMethodAttachment:\n";
2594 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2599 const std::string& extrHigh) {
2601 unsigned int iExtr = 0;
2605 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonMobility:\n";
2606 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2611 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonMobility:\n";
2612 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2617 const std::string& extrHigh) {
2619 unsigned int iExtr = 0;
2623 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonDissociation:\n";
2624 std::cerr <<
" Unknown extrapolation method (" << extrLow <<
")\n";
2630 std::cerr <<
m_className <<
"::SetExtrapolationMethodIonDissociation:\n";
2631 std::cerr <<
" Unknown extrapolation method (" << extrHigh <<
")\n";
2638 for (
unsigned int i = 0; i < extrStr.length(); ++i) {
2639 extrStr[i] = toupper(extrStr[i]);
2642 if (extrStr ==
"CONST" || extrStr ==
"CONSTANT") {
2644 }
else if (extrStr ==
"LIN" || extrStr ==
"LINEAR") {
2646 }
else if (extrStr ==
"EXP" || extrStr ==
"EXPONENTIAL") {
2698 const std::vector<double>& fields,
2699 const unsigned int& intpMeth,
const int& extrLow,
2700 const int& extrHigh) {
2706 const int nSizeTable = fields.size();
2708 if (e < 0. || nSizeTable < 1)
return 0.;
2712 if (nSizeTable == 1) {
2715 }
else if (e < fields[0]) {
2717 if (fields[0] >= fields[1]) {
2720 std::cerr <<
" First two field values coincide.\n";
2721 std::cerr <<
" No extrapolation to lower fields.\n";
2724 }
else if (extrLow == 1) {
2726 const double extr4 = (table[1] - table[0]) / (fields[1] - fields[0]);
2727 const double extr3 = table[0] - extr4 * fields[0];
2728 result = extr3 + extr4 * e;
2729 }
else if (extrLow == 2) {
2731 const double extr4 = log(table[1] / table[0]) / (fields[1] - fields[0]);
2732 const double extr3 = log(table[0] - extr4 * fields[0]);
2733 result = std::exp(std::min(50., extr3 + extr4 * e));
2737 }
else if (e > fields[nSizeTable - 1]) {
2739 if (fields[nSizeTable - 1] <= fields[nSizeTable - 2]) {
2742 std::cerr <<
" Last two field values coincide.\n";
2743 std::cerr <<
" No extrapolation to higher fields.\n";
2745 result = table[nSizeTable - 1];
2746 }
else if (extrHigh == 1) {
2748 const double extr2 = (table[nSizeTable - 1] - table[nSizeTable - 2]) /
2749 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
2750 const double extr1 =
2751 table[nSizeTable - 1] - extr2 * fields[nSizeTable - 1];
2752 result = extr1 + extr2 * e;
2753 }
else if (extrHigh == 2) {
2755 const double extr2 = log(table[nSizeTable - 1] / table[nSizeTable - 2]) /
2756 (fields[nSizeTable - 1] - fields[nSizeTable - 2]);
2757 const double extr1 =
2758 log(table[nSizeTable - 1]) - extr2 * fields[nSizeTable - 1];
2759 result =
exp(std::min(50., extr1 + extr2 * e));
2761 result = table[nSizeTable - 1];
2773 const unsigned int& eRes,
const unsigned int& bRes,
2774 const unsigned int& aRes,
2775 std::vector<std::vector<std::vector<double> > >& tab,
const double& val) {
2777 if (eRes == 0 || bRes == 0 || aRes == 0) {
2778 std::cerr <<
m_className <<
"::InitParamArrays:\n";
2779 std::cerr <<
" Invalid grid.\n";
2784 for (
unsigned int i = 0; i < aRes; ++i) {
2785 tab[i].resize(bRes);
2786 for (
unsigned int j = 0; j < bRes; ++j) {
2787 tab[i][j].assign(eRes, val);
2793 const unsigned int& eRes,
const unsigned int& bRes,
2794 const unsigned int& aRes,
const unsigned int& tRes,
2795 std::vector<std::vector<std::vector<std::vector<double> > > >& tab,
2796 const double& val) {
2798 if (eRes == 0 || bRes == 0 || aRes == 0 || tRes == 0) {
2799 std::cerr <<
m_className <<
"::InitParamArrays:\n";
2800 std::cerr <<
" Invalid grid.\n";
2805 for (
unsigned int l = 0; l < tRes; ++l) {
2806 tab[l].resize(aRes);
2807 for (
unsigned int i = 0; i < aRes; ++i) {
2808 tab[l][i].resize(bRes);
2809 for (
unsigned int j = 0; j < bRes; ++j) {
2810 tab[l][i][j].assign(eRes, val);
DoubleAc cos(const DoubleAc &f)
DoubleAc asin(const DoubleAc &f)
DoubleAc pow(const DoubleAc &f, double p)
DoubleAc sqrt(const DoubleAc &f)
DoubleAc sin(const DoubleAc &f)
DoubleAc acos(const DoubleAc &f)
DoubleAc exp(const DoubleAc &f)
DoubleAc fabs(const DoubleAc &f)
void ResetHoleAttachment()
bool GetHoleVelocityE(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
bool m_hasElectronDiffTens
virtual bool GetPhotonCollision(const double e, int &type, int &level, double &e1, double &ctheta, int &nsec, double &esec)
bool GetElectronVelocityB(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
void ResetElectronAttachment()
virtual double GetMassDensity() const
unsigned int m_extrLowMobility
virtual void GetElectronMomentum(const double e, double &px, double &py, double &pz, int &band)
bool SetIonMobility(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, const double &mu)
unsigned int m_intpDiffusion
virtual void SetAtomicWeight(const double &a)
bool GetElectronTransverseDiffusion(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &dt)
virtual void SetMassDensity(const double &rho)
std::vector< std::vector< std::vector< double > > > tabHoleVelocityE
virtual double ScaleElectricField(const double &e) const
unsigned int m_extrLowDiffusion
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)
virtual bool HoleTownsend(const double ex, const double ey, const double ez, const double bx, const double by, const double bz, double &alpha)
virtual bool GetIonisationProduct(const int i, int &type, double &energy)
bool m_hasElectronDiffTrans
bool m_hasElectronTownsend
void SetInterpolationMethodIonDissociation(const unsigned int &intrp)
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)
std::vector< double > bFields
virtual double ScaleDiffusion(const double &d) const
std::vector< std::vector< std::vector< double > > > tabElectronVelocityB
unsigned int m_extrHighAttachment
bool GetIonLongitudinalDiffusion(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &dl)
bool GetIonDissociation(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &diss)
bool GetHoleVelocityExB(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
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
unsigned int m_intpAttachment
bool GetElectronTownsend(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &alpha)
bool GetIonTransverseDiffusion(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &dt)
bool m_hasElectronVelocityB
bool GetExtrapolationIndex(std::string extrStr, unsigned int &extrNb)
void ResetIonDissociation()
unsigned int m_extrHighDiffusion
std::vector< double > eFields
std::vector< std::vector< std::vector< double > > > tabIonDissociation
unsigned int m_extrHighMobility
std::vector< std::vector< std::vector< double > > > tabElectronVelocityE
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)
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)
unsigned int m_intpTownsend
virtual void SetAtomicNumber(const double &z)
unsigned int m_extrLowAttachment
virtual bool GetOpticalDataRange(double &emin, double &emax, const unsigned int &i=0)
std::vector< double > bAngles
unsigned int m_extrHighDissociation
virtual double ScaleAttachment(const double &eta) const
virtual void GetComponent(const unsigned int &i, std::string &label, double &f)
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)
virtual double ScaleDiffusionTensor(const double &d) const
unsigned int m_intpVelocity
void SetExtrapolationMethodTownsend(const std::string &extrLow, const std::string &extrHigh)
std::vector< std::vector< std::vector< double > > > tabElectronDiffLong
void SetInterpolationMethodIonMobility(const unsigned int &intrp)
void SetExtrapolationMethodIonMobility(const std::string &extrLow, const std::string &extrHigh)
std::vector< std::vector< std::vector< double > > > tabElectronAttachment
virtual double GetElectronNullCollisionRate(const int band=0)
unsigned int m_extrLowVelocity
unsigned int m_extrHighTownsend
virtual bool GetPhotoAbsorptionCrossSection(const double &e, double &sigma, const unsigned int &i=0)
virtual double ScaleDissociation(const double &diss) const
virtual double GetElectronCollisionRate(const double e, const int band=0)
void SetTemperature(const double &t)
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
std::vector< std::vector< std::vector< double > > > tabHoleTownsend
void SetDielectricConstant(const double &eps)
unsigned int m_extrLowTownsend
void SetExtrapolationMethodDiffusion(const std::string &extrLow, const std::string &extrHigh)
void GetFieldGrid(std::vector< double > &efields, std::vector< double > &bfields, std::vector< double > &angles)
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)
void SetPressure(const double &p)
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
void SetInterpolationMethodAttachment(const unsigned int &intrp)
unsigned int m_extrLowDissociation
virtual bool GetDielectricFunction(const double &e, double &eps1, double &eps2, const unsigned int &i=0)
std::vector< std::vector< std::vector< std::vector< double > > > > tabElectronDiffTens
bool GetHoleTransverseDiffusion(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &dt)
void SetInterpolationMethodVelocity(const unsigned int &intrp)
virtual bool GetDeexcitationProduct(const int i, double &t, double &s, int &type, double &energy)
virtual double GetElectronEnergy(const double px, const double py, const double pz, double &vx, double &vy, double &vz, const int band=0)
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
bool GetHoleVelocityB(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
std::vector< std::vector< std::vector< double > > > tabIonMobility
bool GetElectronVelocityExB(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
int thrElectronAttachment
bool m_hasElectronDiffLong
std::vector< std::vector< std::vector< double > > > tabHoleDiffTrans
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)
bool GetElectronLongitudinalDiffusion(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &dl)
void SetExtrapolationMethodAttachment(const std::string &extrLow, const std::string &extrHigh)
std::vector< std::vector< std::vector< double > > > tabHoleVelocityB
std::vector< std::vector< std::vector< double > > > tabHoleDiffLong
unsigned int m_nComponents
bool GetHoleAttachment(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &eta)
std::vector< std::vector< std::vector< double > > > tabIonDiffLong
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
void SetInterpolationMethodDiffusion(const unsigned int &intrp)
bool GetElectronAttachment(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &eta)
bool GetHoleTownsend(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &alpha)
virtual double ScaleTownsend(const double &alpha) const
unsigned int m_intpDissociation
virtual double GetPhotonCollisionRate(const double &e)
void ResetHoleDiffusion()
bool m_hasHoleVelocityExB
void SetInterpolationMethodTownsend(const unsigned int &intrp)
bool m_hasElectronVelocityE
bool GetElectronVelocityE(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &v)
std::vector< std::vector< std::vector< double > > > tabElectronTownsend
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)
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)
virtual void SetNumberDensity(const double &n)
void ResetElectronVelocity()
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 GetIonMobility(const unsigned int &ie, const unsigned int &ib, const unsigned int &ia, double &mu)
bool Boxin3(std::vector< std::vector< std::vector< double > > > &value, std::vector< double > &xAxis, std::vector< double > &yAxis, std::vector< double > &zAxis, int nx, int ny, int nz, double xx, double yy, double zz, double &f, int iOrder)
double Divdif(const std::vector< double > &f, const std::vector< double > &a, int nn, double x, int mm)