scatsystem field evaluation (WIP)

Former-commit-id: ee0ad31050cf194a0a6e0fcd5a176b568e1d2064
This commit is contained in:
Marek Nečada 2019-06-23 23:33:08 +03:00
parent f63f3fbefb
commit c29a284bc6
3 changed files with 25 additions and 5 deletions

View File

@ -1460,10 +1460,19 @@ complex double *qpms_scatsys_build_modeproblem_matrix_irrep_packed_parallelR(
return target_packed;
}
#if 0
ccart3_t qpms_scatsys_eval_field(const qpms_scatsys_t *ss, const complex double *cvf, cart3_t where) {
TODO;
ccart3_t qpms_scatsys_eval_field(const qpms_scatsys_t *ss,
const complex double *cvf, const cart3_t where,
complex double omega, complex double refindex) {
QPMS_UNTESTED;
ccart3_t result = {0,0,0};
ccart3_t result_kahanc = {0,0,0};
for (qpms_ss_pi_t pi = 0; pi < ss->p_count; ++pi) {
const cart3_t particle_pos = ss->p[pi];
const csph_t kr = sph_cscale(...);
...;
}
}

View File

@ -326,7 +326,9 @@ complex double *qpms_orbit_irrep_basis(
*/
ccart3_t qpms_scatsys_eval_field(const qpms_scatsys_t *ss,
const complex double *coeff_vector, //< A full-length excitation vector.
cart3_t where //< Evaluation point.
cart3_t where, //< Evaluation point.
complex double omega, //< Angular frequency
complex double refindex //< Background medium refractive index
);
@ -338,6 +340,8 @@ ccart3_t qpms_scatsys_eval_field(const qpms_scatsys_t *ss,
ccart3_t qpms_scatsys_eval_field_irrep(const qpms_scatsys_t *ss,
qpms_iri_t iri, //< Irreducible representation
const complex double *coeff_vector, //< A reduced excitation vector, corresponding to \a iri.
cart3_t where //< Evaluation point.
cart3_t where, //< Evaluation point.
complex double omega, //< Angular frequency
complex double refindex //< Background medium refractive index
);
#endif //QPMS_SCATSYSTEM_H

View File

@ -169,6 +169,13 @@ static inline double cart3_dot(const cart3_t a, const cart3_t b) {
return a.x * b.x + a.y * b.y + a.z * b.z;
}
static inline csph_t sph_cscale(complex double c, const sph_t s) {
return {c * s.r, s.theta, s.phi};
}
static inline sph_t sph_scale(double c, const sph_t s) {
return {c * s.r, s.theta, s.phi};
}
// equivalent to sph_loccart2cart in qpms_p.py
static inline ccart3_t csphvec2ccart(const csphvec_t sphvec, const sph_t at) {