942 const shared_ptr<
const RectangularMesh<2>>& rect_mesh,
945 rect_mesh(rect_mesh),
946 valr(rect_mesh->axis[0]->size()),
947 valz(rect_mesh->axis[1]->size()) {
948 std::exception_ptr error;
952#pragma omp for nowait
953 for (
int idr = 0; idr < int(rect_mesh->axis[0]->size());
956 double r = rect_mesh->axis[0]->
at(idr);
959 valr[idr] = solver->modes[num].rField(r);
962 error = std::current_exception();
968 for (
int idz = 0; idz < int(rect_mesh->axis[1]->size());
970 double z = rect_mesh->axis[1]->at(idz);
971 size_t iz = solver->mesh->axis[1]->findIndex(z);
972 if (iz >= solver->zsize)
973 iz = solver->zsize - 1;
974 else if (iz < solver->zbegin)
977 solver->k0 * sqrt(solver->nrCache[stripe][iz] * solver->nrCache[stripe][iz] -
978 solver->veffs[stripe] * solver->nrCache[stripe][iz] * solver->ngCache[stripe][iz]);
979 if (
real(kz) < 0.) kz = -kz;
980 z -= solver->mesh->axis[1]->at(
max(
int(iz) - 1, 0));
981 dcomplex phasz = exp(-I * kz * z);
982 valz[idz] = solver->zfields[iz].F * phasz + solver->zfields[iz].B / phasz;
986 if (error) std::rethrow_exception(error);
997 DataVector<const FieldT>
getAll()
const override {
998 DataVector<FieldT> results(rect_mesh->size());
1000 if (rect_mesh->getIterationOrder() == RectangularMesh<2>::ORDER_10) {
1003 FieldT* data = results.data() + i1 * rect_mesh->axis[0]->size();
1004 for (
size_t i0 = 0; i0 < rect_mesh->axis[0]->size(); ++i0) {
1005 dcomplex f = valr[i0] * valz[i1];
1006 data[i0] = this->value(f);
1012 FieldT* data = results.data() + i0 * rect_mesh->axis[1]->size();
1013 for (
size_t i1 = 0; i1 < rect_mesh->axis[1]->size(); ++i1) {
1014 dcomplex f = valr[i0] * valz[i1];
1015 data[i1] = this->value(f);