15#ifndef __Propagation_h
16#define __Propagation_h
33template <
class T,
class U,
class V,
class W>
56 std::array<std::array<T, 3>, 3> eye;
60 void _debugArray(T *arr,
int idx);
62 void _debugArray(std::array<std::complex<T>, 3> arr);
68 Propagation(T k,
int numThreads,
int gs,
int gt, T epsilon, T t_direction,
bool verbose =
false);
90 std::array<std::array<std::complex<T>, 3>, 2>
fieldAtPoint(V *cs, W *currents,
91 const std::array<T, 3> &point_target);
101 W *currents, U *res);
104 W *currents, U *res);
109 W *currents, U *res);
111 std::array<std::array<std::complex<T>, 3>, 2>
farfieldAtPoint(V *cs, W *currents,
112 const std::array<T, 3> &point_target);
115 W *currents, U *res);
124 const std::array<T, 3> &point_target);
144template <
class T,
class U,
class V,
class W>
147 this->PIf = 3.14159265359f;
148 this->C_L = 2.99792458e11f;
149 this->MU_0 = 1.2566370614e-3f;
150 this->EPS_VAC = 1 / (MU_0 * C_L*C_L);
151 this->ZETA_0_INV = 1 / (C_L * MU_0);
153 std::complex<T> j(0., 1.);
154 std::complex<T> z0(0., 0.);
160 this->EPS = epsilon * EPS_VAC;
162 this->numThreads = numThreads;
166 this->step = ceil(gt / numThreads);
168 threadPool.resize(numThreads);
170 this->t_direction = t_direction;
172 this->eye[0].fill(0);
173 this->eye[1].fill(0);
174 this->eye[2].fill(0);
182 printf(
"***--------- PO info ---------***\n");
183 printf(
"--- Source : %d cells\n", gs);
184 printf(
"--- Target : %d cells\n", gt);
185 printf(
"--- Wavenumber : %.3f / mm\n", k);
186 printf(
"--- Threads : %d\n", numThreads);
187 printf(
"--- Device : CPU\n");
188 printf(
"***--------- PO info ---------***\n");
210template <
class T,
class U,
class V,
class W>
216 std::complex<T> e_dot_p_r_perp;
217 std::complex<T> e_dot_p_r_parr;
220 std::array<T, 3> S_i_norm;
221 std::array<T, 3> p_i_perp;
222 std::array<T, 3> p_i_parr;
223 std::array<T, 3> S_r_norm;
224 std::array<T, 3> p_r_perp;
225 std::array<T, 3> p_r_parr;
226 std::array<T, 3> S_out_n;
227 std::array<T, 3> point;
228 std::array<T, 3> norms;
229 std::array<T, 3> e_out_h_r;
232 std::array<std::complex<T>, 3> e_r;
233 std::array<std::complex<T>, 3> h_r;
234 std::array<std::complex<T>, 3> n_out_e_i_r;
235 std::array<std::complex<T>, 3> temp1;
236 std::array<std::complex<T>, 3> temp2;
238 std::array<std::complex<T>, 3> jt;
239 std::array<std::complex<T>, 3> mt;
242 std::array<std::array<std::complex<T>, 3>, 2> beam_e_h;
246 for(
int i=start; i<stop; i++)
253 norms[0] = ct->nx[i];
254 norms[1] = ct->ny[i];
255 norms[2] = ct->nz[i];
261 ut.conj(beam_e_h[1], temp1);
262 ut.ext(beam_e_h[0], temp1, temp2);
264 for (
int n=0; n<3; n++)
266 e_out_h_r[n] = temp2[n].real();
271 ut.normalize(e_out_h_r, S_i_norm);
274 ut.ext(S_i_norm, norms, S_out_n);
275 ut.normalize(S_out_n, p_i_perp);
276 ut.ext(p_i_perp, S_i_norm, p_i_parr);
279 ut.snell(S_i_norm, norms, S_r_norm);
282 ut.ext(S_r_norm, norms, S_out_n);
283 ut.normalize(S_out_n, p_r_perp);
284 ut.ext(S_r_norm, p_r_perp, p_r_parr);
287 ut.dot(beam_e_h[0], p_r_perp, e_dot_p_r_perp);
288 ut.dot(beam_e_h[0], p_r_parr, e_dot_p_r_parr);
291 for(
int n=0; n<3; n++)
293 e_r[n] = -e_dot_p_r_perp * p_i_perp[n] - e_dot_p_r_parr * p_i_parr[n];
298 ut.ext(S_r_norm, e_r, temp1);
299 ut.s_mult(temp1, ZETA_0_INV, h_r);
301 for(
int n=0; n<3; n++)
303 temp1[n] = e_r[n] + beam_e_h[0][n];
304 temp2[n] = h_r[n] + beam_e_h[1][n];
307 ut.ext(norms, temp2, jt);
308 ut.ext(norms, temp1, n_out_e_i_r);
309 ut.s_mult(n_out_e_i_r, -1., mt);
311 res->r1x[i] = jt[0].real();
312 res->r1y[i] = jt[1].real();
313 res->r1z[i] = jt[2].real();
315 res->i1x[i] = jt[0].imag();
316 res->i1y[i] = jt[1].imag();
317 res->i1z[i] = jt[2].imag();
319 res->r2x[i] = mt[0].real();
320 res->r2y[i] = mt[1].real();
321 res->r2z[i] = mt[2].real();
323 res->i2x[i] = mt[0].imag();
324 res->i2y[i] = mt[1].imag();
325 res->i2z[i] = mt[2].imag();
346template <
class T,
class U,
class V,
class W>
352 std::array<T, 3> point;
355 std::array<std::array<std::complex<T>, 3>, 2> beam_e_h;
359 for(
int i=start; i<stop; i++)
369 res->r1x[i] = beam_e_h[0][0].real();
370 res->r1y[i] = beam_e_h[0][1].real();
371 res->r1z[i] = beam_e_h[0][2].real();
373 res->i1x[i] = beam_e_h[0][0].imag();
374 res->i1y[i] = beam_e_h[0][1].imag();
375 res->i1z[i] = beam_e_h[0][2].imag();
377 res->r2x[i] = beam_e_h[1][0].real();
378 res->r2y[i] = beam_e_h[1][1].real();
379 res->r2z[i] = beam_e_h[1][2].real();
381 res->i2x[i] = beam_e_h[1][0].imag();
382 res->i2y[i] = beam_e_h[1][1].imag();
383 res->i2z[i] = beam_e_h[1][2].imag();
406template <
class T,
class U,
class V,
class W>
412 std::complex<T> e_dot_p_r_perp;
413 std::complex<T> e_dot_p_r_parr;
416 std::array<T, 3> S_i_norm;
417 std::array<T, 3> p_i_perp;
418 std::array<T, 3> p_i_parr;
419 std::array<T, 3> S_r_norm;
420 std::array<T, 3> p_r_perp;
421 std::array<T, 3> p_r_parr;
422 std::array<T, 3> S_out_n;
423 std::array<T, 3> point;
424 std::array<T, 3> norms;
425 std::array<T, 3> e_out_h_r;
428 std::array<std::complex<T>, 3> e_r;
429 std::array<std::complex<T>, 3> h_r;
430 std::array<std::complex<T>, 3> n_out_e_i_r;
431 std::array<std::complex<T>, 3> temp1;
432 std::array<std::complex<T>, 3> temp2;
434 std::array<std::complex<T>, 3> jt;
435 std::array<std::complex<T>, 3> mt;
438 std::array<std::array<std::complex<T>, 3>, 2> beam_e_h;
442 for(
int i=start; i<stop; i++)
449 norms[0] = ct->nx[i];
450 norms[1] = ct->ny[i];
451 norms[2] = ct->nz[i];
458 res->r3x[i] = beam_e_h[0][0].real();
459 res->r3y[i] = beam_e_h[0][1].real();
460 res->r3z[i] = beam_e_h[0][2].real();
462 res->i3x[i] = beam_e_h[0][0].imag();
463 res->i3y[i] = beam_e_h[0][1].imag();
464 res->i3z[i] = beam_e_h[0][2].imag();
466 res->r4x[i] = beam_e_h[1][0].real();
467 res->r4y[i] = beam_e_h[1][1].real();
468 res->r4z[i] = beam_e_h[1][2].real();
470 res->i4x[i] = beam_e_h[1][0].imag();
471 res->i4y[i] = beam_e_h[1][1].imag();
472 res->i4z[i] = beam_e_h[1][2].imag();
475 ut.conj(beam_e_h[1], temp1);
477 ut.ext(beam_e_h[0], temp1, temp2);
479 for (
int n=0; n<3; n++)
481 e_out_h_r[n] = temp2[n].real();
486 ut.normalize(e_out_h_r, S_i_norm);
489 ut.ext(S_i_norm, norms, S_out_n);
491 ut.normalize(S_out_n, p_i_perp);
492 ut.ext(p_i_perp, S_i_norm, p_i_parr);
495 ut.snell(S_i_norm, norms, S_r_norm);
498 ut.ext(S_r_norm, norms, S_out_n);
500 ut.normalize(S_out_n, p_r_perp);
501 ut.ext(S_r_norm, p_r_perp, p_r_parr);
504 ut.dot(beam_e_h[0], p_r_perp, e_dot_p_r_perp);
505 ut.dot(beam_e_h[0], p_r_parr, e_dot_p_r_parr);
510 for(
int n=0; n<3; n++)
512 e_r[n] = -e_dot_p_r_perp * p_i_perp[n] - e_dot_p_r_parr * p_i_parr[n];
517 ut.ext(S_r_norm, e_r, temp1);
518 ut.s_mult(temp1, ZETA_0_INV, h_r);
520 for(
int n=0; n<3; n++)
522 temp1[n] = e_r[n] + beam_e_h[0][n];
523 temp2[n] = h_r[n] + beam_e_h[1][n];
526 ut.ext(norms, temp2, jt);
527 ut.ext(norms, temp1, n_out_e_i_r);
528 ut.s_mult(n_out_e_i_r, -1., mt);
532 res->r1x[i] = jt[0].real();
533 res->r1y[i] = jt[1].real();
534 res->r1z[i] = jt[2].real();
536 res->i1x[i] = jt[0].imag();
537 res->i1y[i] = jt[1].imag();
538 res->i1z[i] = jt[2].imag();
540 res->r2x[i] = mt[0].real();
541 res->r2y[i] = mt[1].real();
542 res->r2z[i] = mt[2].real();
544 res->i2x[i] = mt[0].imag();
545 res->i2y[i] = mt[1].imag();
546 res->i2z[i] = mt[2].imag();
569template <
class T,
class U,
class V,
class W>
575 std::complex<T> e_dot_p_r_perp;
576 std::complex<T> e_dot_p_r_parr;
579 std::array<T, 3> S_i_norm;
580 std::array<T, 3> p_i_perp;
581 std::array<T, 3> p_i_parr;
582 std::array<T, 3> S_r_norm;
583 std::array<T, 3> p_r_perp;
584 std::array<T, 3> p_r_parr;
585 std::array<T, 3> S_out_n;
586 std::array<T, 3> point;
587 std::array<T, 3> norms;
588 std::array<T, 3> e_out_h_r;
591 std::array<std::complex<T>, 3> e_r;
592 std::array<std::complex<T>, 3> h_r;
593 std::array<std::complex<T>, 3> n_out_e_i_r;
594 std::array<std::complex<T>, 3> temp1;
595 std::array<std::complex<T>, 3> temp2;
598 std::array<std::array<std::complex<T>, 3>, 2> beam_e_h;
602 for(
int i=start; i<stop; i++)
609 norms[0] = ct->nx[i];
610 norms[1] = ct->ny[i];
611 norms[2] = ct->nz[i];
617 ut.conj(beam_e_h[1], temp1);
618 ut.ext(beam_e_h[0], temp1, temp2);
620 for (
int n=0; n<3; n++)
622 e_out_h_r[n] = temp2[n].real();
627 ut.normalize(e_out_h_r, S_i_norm);
630 ut.ext(S_i_norm, norms, S_out_n);
631 ut.normalize(S_out_n, p_i_perp);
632 ut.ext(p_i_perp, S_i_norm, p_i_parr);
635 ut.snell(S_i_norm, norms, S_r_norm);
638 ut.ext(S_r_norm, norms, S_out_n);
639 ut.normalize(S_out_n, p_r_perp);
640 ut.ext(S_r_norm, p_r_perp, p_r_parr);
643 ut.dot(beam_e_h[0], p_r_perp, e_dot_p_r_perp);
644 ut.dot(beam_e_h[0], p_r_parr, e_dot_p_r_parr);
647 for(
int n=0; n<3; n++)
649 e_r[n] = -e_dot_p_r_perp * p_i_perp[n] - e_dot_p_r_parr * p_i_parr[n];
652 ut.ext(S_r_norm, e_r, temp1);
653 ut.s_mult(temp1, ZETA_0_INV, h_r);
655 res->r1x[i] = e_r[0].real();
656 res->r1y[i] = e_r[1].real();
657 res->r1z[i] = e_r[2].real();
659 res->i1x[i] = e_r[0].imag();
660 res->i1y[i] = e_r[1].imag();
661 res->i1z[i] = e_r[2].imag();
663 res->r2x[i] = h_r[0].real();
664 res->r2y[i] = h_r[1].real();
665 res->r2z[i] = h_r[2].real();
667 res->i2x[i] = h_r[0].imag();
668 res->i2y[i] = h_r[1].imag();
669 res->i2z[i] = h_r[2].imag();
671 res->r3x[i] = S_r_norm[0];
672 res->r3y[i] = S_r_norm[1];
673 res->r3z[i] = S_r_norm[2];
694template <
class T,
class U,
class V,
class W>
699 std::array<T, 3> point_target;
702 for(
int i=start; i<stop; i++)
704 point_target[0] = ct->x[i];
705 point_target[1] = ct->y[i];
706 point_target[2] = ct->z[i];
708 ets = fieldScalarAtPoint(cs, field, point_target);
710 res->x[i] = ets.real();
711 res->y[i] = ets.imag();
729template <
class T,
class U,
class V,
class W>
731 W *currents,
const std::array<T, 3> &point_target)
738 std::complex<T> Green;
739 std::complex<T> r_in_s;
742 std::array<T, 3> source_point;
743 std::array<T, 3> source_norm;
744 std::array<T, 3> r_vec;
745 std::array<T, 3> k_hat;
746 std::array<T, 3> k_arr;
749 std::array<std::complex<T>, 3> e_field;
750 std::array<std::complex<T>, 3> h_field;
751 std::array<std::complex<T>, 3> js;
752 std::array<std::complex<T>, 3> ms;
753 std::array<std::complex<T>, 3> e_vec_thing;
754 std::array<std::complex<T>, 3> h_vec_thing;
755 std::array<std::complex<T>, 3> k_out_ms;
756 std::array<std::complex<T>, 3> k_out_js;
757 std::array<std::complex<T>, 3> temp;
760 std::array<std::array<std::complex<T>, 3>, 2> e_h_field;
767 for(
int i=0; i<gs; i++)
769 source_point[0] = cs->x[i];
770 source_point[1] = cs->y[i];
771 source_point[2] = cs->z[i];
773 source_norm[0] = cs->nx[i];
774 source_norm[1] = cs->ny[i];
775 source_norm[2] = cs->nz[i];
777 js[0] = {currents->r1x[i], currents->i1x[i]};
778 js[1] = {currents->r1y[i], currents->i1y[i]};
779 js[2] = {currents->r1z[i], currents->i1z[i]};
781 ms[0] = {currents->r2x[i], currents->i2x[i]};
782 ms[1] = {currents->r2y[i], currents->i2y[i]};
783 ms[2] = {currents->r2z[i], currents->i2z[i]};
785 ut.diff(point_target, source_point, r_vec);
790 ut.s_mult(r_vec, r_inv, k_hat);
793 ut.dot(source_norm, k_hat, norm_dot_k_hat);
794 if (norm_dot_k_hat < 0) {
continue;}
796 ut.s_mult(k_hat, k, k_arr);
799 ut.dot(k_hat, js, r_in_s);
800 ut.s_mult(k_hat, r_in_s, temp);
801 ut.diff(js, temp, e_vec_thing);
803 ut.ext(k_arr, ms, k_out_ms);
806 ut.dot(k_hat, ms, r_in_s);
807 ut.s_mult(k_hat, r_in_s, temp);
808 ut.diff(ms, temp, h_vec_thing);
810 ut.ext(k_arr, js, k_out_js);
814 Green = exp(this->t_direction * j * k * r) / (4 * PIf * r) * cs->area[i] * j;
816 for(
int n=0; n<3; n++)
818 e_field[n] += (-omega * MU_0 * e_vec_thing[n] + k_out_ms[n]) * Green;
819 h_field[n] += (-omega * EPS * h_vec_thing[n] - k_out_js[n]) * Green;
825 e_h_field[0] = e_field;
826 e_h_field[1] = h_field;
847template <
class T,
class U,
class V,
class W>
849 W *field,
const std::array<T, 3> &point_target)
851 std::complex<T> out(0., 0.);
852 std::complex<T> j(0., 1.);
853 std::complex<T> _field;
856 std::array<T, 3> r_vec;
857 std::array<T, 3> source_point;
859 for(
int i=0; i<gs; i++)
861 source_point[0] = cs->x[i];
862 source_point[1] = cs->y[i];
863 source_point[2] = cs->z[i];
865 _field = {field->x[i], field->y[i]};
867 ut.diff(point_target, source_point, r_vec);
870 out += - k * k * _field * exp(this->t_direction * j * k * r) / (4 * PIf * r) * cs->area[i];
891template <
class T,
class U,
class V,
class W>
897 for(
int n=0; n<numThreads; n++)
900 if(n == (numThreads-1))
907 final_step = (n+1) * step;
913 this, n * step, final_step,
914 cs, ct, currents, res);
934template <
class T,
class U,
class V,
class W>
940 for(
int n=0; n<numThreads; n++)
943 if(n == (numThreads-1))
950 final_step = (n+1) * step;
956 this, n * step, final_step,
957 cs, ct, currents, res);
979template <
class T,
class U,
class V,
class W>
985 for(
int n=0; n<numThreads; n++)
987 if(n == (numThreads-1))
994 final_step = (n+1) * step;
998 this, n * step, final_step,
999 cs, ct, currents, res);
1021template <
class T,
class U,
class V,
class W>
1023 W *currents, U *res)
1027 for(
int n=0; n<numThreads; n++)
1030 if(n == (numThreads-1))
1037 final_step = (n+1) * step;
1041 this, n * step, final_step,
1042 cs, ct, currents, res);
1062template <
class T,
class U,
class V,
class W>
1068 for(
int n=0; n<numThreads; n++)
1070 if(n == (numThreads-1))
1077 final_step = (n+1) * step;
1081 this, n * step, final_step,
1082 cs, ct, field, res);
1104template <
class T,
class U,
class V,
class W>
1107 W *currents, U *res)
1114 std::complex<T> e_th;
1115 std::complex<T> e_ph;
1117 std::complex<T> e_Az;
1118 std::complex<T> e_El;
1121 std::array<T, 2> point_ff;
1122 std::array<T, 3> r_hat;
1125 std::array<std::array<std::complex<T>, 3>, 2> eh;
1128 for(
int i=start; i<stop; i++)
1132 cosEl = std::sqrt(1 - sin(theta) * sin(phi) * sin(theta) * sin(phi));
1134 r_hat[0] = cos(theta) * sin(phi);
1135 r_hat[1] = sin(theta) * sin(phi);
1136 r_hat[2] = cos(phi);
1141 res->r1x[i] = eh[0][0].real();
1142 res->r1y[i] = eh[0][1].real();
1143 res->r1z[i] = eh[0][2].real();
1145 res->i1x[i] = eh[0][0].imag();
1146 res->i1y[i] = eh[0][1].imag();
1147 res->i1z[i] = eh[0][2].imag();
1150 res->r2x[i] = eh[1][0].real();
1151 res->r2y[i] = eh[1][1].real();
1152 res->r2z[i] = eh[1][2].real();
1154 res->i2x[i] = eh[1][0].imag();
1155 res->i2y[i] = eh[1][1].imag();
1156 res->i2z[i] = eh[1][2].imag();
1174template <
class T,
class U,
class V,
class W>
1177 const std::array<T, 3> &r_hat)
1183 std::complex<T> r_in_s;
1184 std::complex<T> expo;
1188 std::array<T, 3> source_point;
1191 std::array<std::complex<T>, 3> e;
1192 std::array<std::complex<T>, 3> h;
1193 std::array<std::complex<T>, 3> _js;
1194 std::array<std::complex<T>, 3> _ms;
1196 std::array<std::complex<T>, 3> js;
1197 std::array<std::complex<T>, 3> ms;
1199 std::array<std::complex<T>, 3> _ctemp;
1200 std::array<std::complex<T>, 3> js_tot_factor;
1201 std::array<std::complex<T>, 3> ms_tot_factor;
1202 std::array<std::complex<T>, 3> js_tot_factor_h;
1203 std::array<std::complex<T>, 3> ms_tot_factor_h;
1206 std::array<std::array<std::complex<T>, 3>, 2> out;
1209 std::array<std::array<T, 3>, 3> rr_dyad;
1210 std::array<std::array<T, 3>, 3> eye_min_rr;
1217 omega_mu = C_L * k * MU_0;
1219 ut.dyad(r_hat, r_hat, rr_dyad);
1220 ut.matDiff(this->eye, rr_dyad, eye_min_rr);
1222 for(
int i=0; i<gs; i++)
1224 source_point[0] = cs->x[i];
1225 source_point[1] = cs->y[i];
1226 source_point[2] = cs->z[i];
1228 ut.dot(r_hat, source_point, r_hat_in_rp);
1230 expo = exp(j * k * r_hat_in_rp);
1233 _js[0] = {currents->r1x[i], currents->i1x[i]};
1234 _js[1] = {currents->r1y[i], currents->i1y[i]};
1235 _js[2] = {currents->r1z[i], currents->i1z[i]};
1237 _ms[0] = {currents->r2x[i], currents->i2x[i]};
1238 _ms[1] = {currents->r2y[i], currents->i2y[i]};
1239 _ms[2] = {currents->r2z[i], currents->i2z[i]};
1241 for (
int n=0; n<3; n++)
1243 js[n] += _js[n] * expo * area;
1244 ms[n] += _ms[n] * expo * area;
1248 ut.matVec(eye_min_rr, js, _ctemp);
1249 ut.s_mult(_ctemp, omega_mu, js_tot_factor);
1251 ut.ext(r_hat, ms, _ctemp);
1252 ut.s_mult(_ctemp, k, ms_tot_factor);
1254 omega_eps = C_L * k * EPS;
1256 ut.matVec(eye_min_rr, ms, _ctemp);
1257 ut.s_mult(_ctemp, omega_eps, ms_tot_factor_h);
1259 ut.ext(r_hat, js, _ctemp);
1260 ut.s_mult(_ctemp, k, js_tot_factor_h);
1262 for (
int n=0; n<3; n++)
1264 e[n] = -js_tot_factor[n] + ms_tot_factor[n];
1265 h[n] = -ms_tot_factor[n] - js_tot_factor[n];
1288template <
class T,
class U,
class V,
class W>
1290 W *currents, U *res)
1294 for(
int n=0; n<numThreads; n++)
1296 if(n == (numThreads-1))
1303 final_step = (n+1) * step;
1307 this, n * step, final_step,
1308 cs, ct, currents, res);
1313template <
class T,
class U,
class V,
class W>
1316 for (std::thread &t : threadPool)
1325template <
class T,
class U,
class V,
class W>
1328 T toPrint = arr[idx];
1329 std::cout <<
"Value of c-style array, element " << idx <<
", is : " << toPrint << std::endl;
1332template <
class T,
class U,
class V,
class W>
1335 std::cout << arr[0] <<
", " << arr[1] <<
", " << arr[2] << std::endl;
1338template <
class T,
class U,
class V,
class W>
1341 std::cout << arr[0].real() <<
" + " << arr[0].imag() <<
"j"
1342 <<
", " << arr[1].real() <<
" + " << arr[1].imag() <<
"j"
1343 <<
", " << arr[2].real() <<
" + " << arr[2].imag() <<
"j"
__host__ __device__ void _debugArray(cuFloatComplex arr[3])
Definition Debug.h:23
Header for reflector generation interface.
__device__ void fieldAtPoint(float *d_xs, float *d_ys, float *d_zs, float *d_nxs, float *d_nys, float *d_nzs, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, float(&point)[3], float *d_A, cuFloatComplex(&d_ei)[3], cuFloatComplex(&d_hi)[3])
Definition Kernelsf.cu:96
__device__ void farfieldAtPoint(float *d_xs, float *d_ys, float *d_zs, cuFloatComplex *d_Jx, cuFloatComplex *d_Jy, cuFloatComplex *d_Jz, cuFloatComplex *d_Mx, cuFloatComplex *d_My, cuFloatComplex *d_Mz, float(&r_hat)[3], float *d_A, cuFloatComplex(&e)[3], cuFloatComplex(&h)[3])
Definition Kernelsf.cu:741
Structs used within PyPO.
Linear algebra functions for the CPU version of PyPO.
Definition Propagation.h:35
Utils< T > ut
Definition Propagation.h:71
void propagateBeam_JM(int start, int stop, V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:211
std::array< std::array< std::complex< T >, 3 >, 2 > farfieldAtPoint(V *cs, W *currents, const std::array< T, 3 > &point_target)
Definition Propagation.h:1175
void parallelProp_JMEH(V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:980
std::vector< std::thread > threadPool
Definition Propagation.h:66
void propagateBeam_EH(int start, int stop, V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:347
void propagateScalarBeam(int start, int stop, V *cs, V *ct, W *field, U *res)
Definition Propagation.h:695
void parallelProp_EHP(V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:1022
void parallelFarField(V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:1289
std::array< std::array< std::complex< T >, 3 >, 2 > fieldAtPoint(V *cs, W *currents, const std::array< T, 3 > &point_target)
Definition Propagation.h:730
std::complex< T > fieldScalarAtPoint(V *cs, W *field, const std::array< T, 3 > &point_target)
Definition Propagation.h:848
void parallelProp_JM(V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:892
void propagateBeam_EHP(int start, int stop, V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:570
Propagation(T k, int numThreads, int gs, int gt, T epsilon, T t_direction, bool verbose=false)
Definition Propagation.h:145
void propagateBeam_JMEH(int start, int stop, V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:407
void parallelPropScalar(V *cs, V *ct, W *field, U *res)
Definition Propagation.h:1063
void parallelProp_EH(V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:935
void propagateToFarField(int start, int stop, V *cs, V *ct, W *currents, U *res)
Definition Propagation.h:1105