#include "superdirectivity.h" #include "sph_bessel.h" #include using namespace std; using namespace sph_bessel; Real get_directivity_sphml_dZx_epsRe(vector ¶m, void *cls) { int ni = (size(param)-1)/2; // 1, ni, ni sphere_ml *sph = reinterpret_cast(cls); vector kR(param.begin()+1, param.begin()+ni+1); sort(kR.begin(),kR.end()); vector eps; for (int i=0; iget_directivity_edipole_x(param[0],kR,eps); } Real get_directivity_sphml_dZx_epsRe_parallel(vector ¶m, void *cls) { int ni = (size(param)-1)/2; sphere_ml_parallel *sph = reinterpret_cast(cls); vector kR(param.begin()+1, param.begin()+ni+1); sort(kR.begin(),kR.end()); vector eps; for (int i=0; iget_directivity_edipole_x(param[0],kR,eps); } //############################################################################### // class sphere_ml // public members void sphere_ml::set_directivity_angles(Real theta_, Real phi_) { theta = theta_; phi = phi_; get_pitau_m01(cos(theta),pi1,tau0,tau1,deg_max); } Real sphere_ml::get_directivity_edipole_x(Real kz, const std::vector &kR, const std::vector &eps) { int ni = size(kR); if (size(eps)-1 != ni) {std::cout << "get_directivity_edipole_x error\n"; return Real(0);} Real D = 0.; Complex kzn; if (kz <= kR[0]) { // s-matrix of a the multilayer sphere_sm(kR[0], eps[0], eps[1], rtml_out); //cout << "sphere coeff:\n"; //for (int i=0; i kR[++kd]); // determine a first interface with radius larger than the dipole position // calculate s-matrices of multilayers inside and outside the dipole position: sphere_sm(kR[0], eps[0], eps[1], rtml_in); for (int k=1; k sphere_ml::get_last_ampl() const { std::vector res; res.resize(3*deg_max); for (int i=0; i<3*deg_max; ++i) res[i] = ampl_out[i]; return res; } std::vector sphere_ml::ampl_far(Real th_rad, Real ph_rad) { Complex tci = -im1, tc, ts = Real(0); std::vector E_out = {Real(0),Real(0)}; get_pitau_m01(cos(th_rad),pi1,tau0,tau1,deg_max); for (int n=0; n &kR, const std::vector &eps) { int ni = size(kR); if (size(eps)-1 != ni) {std::cout << "get_directivity_edipole_x error\n"; return Real(0);} Real D = 0.; Complex kzn; Complex rtml_in[8*_degree], rtml_out[8*_degree], rt[8*_degree]; Complex ampl_in[3*_degree], ampl_out[3*_degree]; if (kz <= kR[0]) { // s-matrix of a the multilayer sphere_sm(kR[0], eps[0], eps[1], rtml_out); //cout << "sphere coeff:\n"; //for (int i=0; i kR[++kd]); // determine a first interface with radius larger than the dipole position // calculate s-matrices of multilayers inside and outside the dipole position: sphere_sm(kR[0], eps[0], eps[1], rtml_in); for (int k=1; k