diff --git a/qpms/scatsystem.c b/qpms/scatsystem.c index c22d625..e5107b9 100644 --- a/qpms/scatsystem.c +++ b/qpms/scatsystem.c @@ -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(...); + ...; + } } diff --git a/qpms/scatsystem.h b/qpms/scatsystem.h index 9d94770..6ee2a68 100644 --- a/qpms/scatsystem.h +++ b/qpms/scatsystem.h @@ -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 diff --git a/qpms/vectors.h b/qpms/vectors.h index 64bf664..c50864b 100644 --- a/qpms/vectors.h +++ b/qpms/vectors.h @@ -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) {