40 std::vector<FieldsDiagonalized>
fields;
46 double d = (
n == 0 || std::size_t(
n) == solver->vbounds->size())?
48 solver->vbounds->at(
n) - solver->vbounds->at(
n-1);
49 if (std::ptrdiff_t(
n) >= solver->interface) {
54 else if (
n == 0) z += d;
59 double get_d(
size_t n,
double& z1,
double& z2) {
60 double d = (
n == 0 || std::size_t(
n) == solver->vbounds->size())?
62 solver->vbounds->at(
n) - solver->vbounds->at(
n-1);
63 if (std::ptrdiff_t(
n) >= solver->interface) {
65 z1 = d - z2; z2 = d - zl;
76 cvector getTransmissionVector(
const cvector& incident, IncidentDirection side)
override;
90 void storeY(
size_t n);
97 if (memY.size() == solver->stack.size() && needAllY)
105 const std::size_t
N = gamma.
size();
106 assert(y1.
size() ==
N);
107 for (std::size_t i = 0; i <
N; i++) {
108 dcomplex t = tanh(I*gamma[i]*d);
109 if (isinf(
real(t)) || isinf(imag(t))) y1[i] = 0.;
110 else if (abs(t) <
SMALL)
112 "Matrix y1 has some infinite value (try changing wavelength or layer thickness a bit)");
119 const std::size_t
N = gamma.
size();
120 assert(y2.
size() ==
N);
121 for (std::size_t i = 0; i <
N; i++) {
122 dcomplex s = sinh(I*gamma[i]*d);
123 if (isinf(
real(s)) || isinf(imag(s))) y2[i] = 0.;
124 else if (abs(s) <
SMALL)
126 "Matrix y2 has some infinite value (try changing wavelength or layer thickness a bit)");
127 else y2[i] = - 1. / s;
131 double integrateField(
WhichField field,
size_t n,
double z1,
double z2)
override;