56 std::vector<cmatrix> memP;
58 void saveP(
size_t n) {
59 if (memP[
n].rows() == P.rows() && memP[
n].cols() == P.cols())
60 memcpy(memP[
n].data(), P.data(), P.rows() * P.cols() *
sizeof(dcomplex));
66 if (std::ptrdiff_t(
n) >= solver->interface) {
68 if (
n != 0 &&
n != solver->vbounds->size())
69 z += solver->vbounds->at(
n) - solver->vbounds->at(
n-1);
75 void adjust_z(
size_t n,
double& z1,
double& z2) {
76 if (std::ptrdiff_t(
n) >= solver->interface) {
79 if (
n != 0 &&
n != solver->vbounds->size()) {
80 double d = solver->vbounds->at(
n) - solver->vbounds->at(
n-1);
88 ReflectionTransfer(ModalBase* solver, Expansion& expansion, Matching matching);
90 ~ReflectionTransfer();
92 cvector getReflectionVector(
const cvector& incident, IncidentDirection direction)
override;
94 cvector getTransmissionVector(
const cvector& incident, IncidentDirection side)
override;
98 void getFinalMatrix()
override;
100 void determineFields()
override;
102 void determineReflectedFields(
const cvector& incident, IncidentDirection side)
override;
104 cvector getFieldVectorE(
double z, std::size_t
n, PropagationDirection part = PROPAGATION_TOTAL)
override;
106 cvector getFieldVectorH(
double z, std::size_t
n, PropagationDirection part = PROPAGATION_TOTAL)
override;
115 void getAM(
size_t start,
size_t end,
bool add,
double mfac=1.);
124 void findReflection(std::size_t start, std::size_t end,
bool emitting,
int store=0);
126 double integrateField(WhichField field,
size_t n,
double z1,
double z2)
override;