diff --git a/qpms/qpms_types.h b/qpms/qpms_types.h index 976e5a7..f382849 100644 --- a/qpms/qpms_types.h +++ b/qpms/qpms_types.h @@ -17,17 +17,19 @@ // integer index types typedef int qpms_lm_t; /// Type for spherical harmonic degree l. -typedef int qpms_l_t; // can't be unsigned because of the behaviour under - operator +typedef int qpms_l_t; /* can't be unsigned because of the behaviour under - operator; + also -1 needed as an invalid value for scalar waves. */ + /// Type for spherical harmonic order m. typedef qpms_lm_t qpms_m_t; /// Type for the (l,m) multiindex of transversal (M or N-type) VSWFs. /** This corresponds to the typical memory layout for various coefficient etc. - * Corresponds to the l-primary, m-secondary ordering, i.e. \n - * y = 0: l = 1, m = -1,\n - * y = 1: l = 1, m = 0,\n - * y = 2: l = 1, m = +1,\n - * y = 3: l = 2, m = -2,\n + * Corresponds to the l-primary, m-secondary ordering, i.e. + * \f[ y = 0: l = 1, m = -1, \f] + * \f[ y = 1: l = 1, m = 0, \f] + * \f[ y = 2: l = 1, m = +1, \f] + * \f[ y = 3: l = 2, m = -2, \f] * ... */ typedef size_t qpms_y_t; @@ -35,12 +37,12 @@ typedef size_t qpms_y_t; /// Type for the (l,m) multiindex of spherical harmonics, including (0,0). /** This differs from qpms_y_t by being shifted by one and including * the l = 0 option. Suitable also for scalar and longitudinal waves. - * Corresponds to the l-primary, m-secondary ordering, i.e.\n - * y = 0: l = 0, m = 0,\n - * y = 1: l = 1, m = -1,\n - * y = 2: l = 1, m = 0,\n - * y = 3: l = 1, m = +1,\n - * y = 4: l = 2, m = -2,\n + * Corresponds to the l-primary, m-secondary ordering, i.e. + * \f[ y = 0: l = 0, m = 0, \f] + * \f[ y = 1: l = 1, m = -1, \f] + * \f[ y = 2: l = 1, m = 0, \f] + * \f[ y = 3: l = 1, m = +1, \f] + * \f[ y = 4: l = 2, m = -2, \f] * ... */ typedef size_t qpms_y_sc_t; @@ -189,10 +191,10 @@ static inline double qpms_normalisation_t_factor_abssquare(qpms_normalisation_t /// Bessel function kinds. typedef enum { - QPMS_BESSEL_REGULAR = 1, ///< regular (spherical) Bessel function $j$ (Bessel function of the first kind) - QPMS_BESSEL_SINGULAR = 2, ///< singular (spherical) Bessel function $y$ (Bessel function of the second kind) - QPMS_HANKEL_PLUS = 3, ///< (spherical) Hankel function $h_1 = j + iy$ - QPMS_HANKEL_MINUS = 4, ///< (spherical) Hankel function $h_2 = j - iy$ + QPMS_BESSEL_REGULAR = 1, ///< regular (spherical) Bessel function \a j (Bessel function of the first kind) + QPMS_BESSEL_SINGULAR = 2, ///< singular (spherical) Bessel function \a y (Bessel function of the second kind) + QPMS_HANKEL_PLUS = 3, ///< (spherical) Hankel function \f$ h_1 = j + iy \f$ + QPMS_HANKEL_MINUS = 4, ///< (spherical) Hankel function \f$ h_2 = j - iy \f$ QPMS_BESSEL_UNDEF = 0 ///< invalid / unspecified kind } qpms_bessel_t; diff --git a/qpms/vswf.h b/qpms/vswf.h index 81b3455..1389aa8 100644 --- a/qpms/vswf.h +++ b/qpms/vswf.h @@ -28,16 +28,29 @@ typedef struct qpms_vswf_set_spec_t { size_t capacity; ///< Allocated capacity of ilist. qpms_normalisation_t norm; ///< Normalisation convention. To be set manually if needed. } qpms_vswf_set_spec_t; - /// Creates a qpms_vswf_set_spec_t structure with an empty list of wave indices. qpms_vswf_set_spec_t *qpms_vswf_set_spec_init(); - /// Appends a VSWF index to a \ref qpms_vswf_set_spec_t, also updating metadata. qpms_errno_t qpms_vswf_set_spec_append(qpms_vswf_set_spec_t *self, qpms_uvswfi_t u); - /// Destroys a \ref qpms_vswf_set_spec_t. void qpms_vswf_set_spec_free(qpms_vswf_set_spec_t *); +/// NOT IMPLEMENTED Evaluates a set of VSWF basis functions at a given point. +/** The list of basis wave indices is specified in \a setspec; + * \a setspec->norm must be set as well. + */ +qpms_errno_t qpms_uvswf_fill( + csphvec_t *const target, + const qpms_vswf_set_spec_t *setspec, + sph_t evaluation_point, qpms_bessel_t btyp); + +/// NOT IMPLEMENTED Evaluates field specified by SVWF coefficients at a given point. +/** SVWF coefficients in \a coeffs must be ordered according to \a setspec->ilist + */ +csphvec_t qpms_eval_uvswf(const qpms_vswf_set_spec_t *setspec, + const complex double *coeffs, sph_t evaluation_point, + qpms_bessel_t btyp); + /// Electric wave N. csphvec_t qpms_vswf_single_el(int m, int n, sph_t kdlj, qpms_bessel_t btyp, qpms_normalisation_t norm); @@ -46,10 +59,10 @@ csphvec_t qpms_vswf_single_mg(int m, int n, sph_t kdlj, qpms_bessel_t btyp, qpms_normalisation_t norm); /// Set of electric and magnetic VSWF values in spherical coordinate basis. -/* This is supposed to contain all the waves up to $l = lMax$. - * for a custom set of waves, use \ref qpms_uvswfset_sph_t instead. +/** This is supposed to contain all the waves up to $l = lMax$. + * + * For a completely custom set of waves, use \ref qpms_uvswfset_sph_t instead. */ - typedef struct qpms_vswfset_sph_t { //qpms_normalisation_t norm; qpms_l_t lMax; @@ -58,8 +71,6 @@ typedef struct qpms_vswfset_sph_t { csphvec_t *el, *mg; } qpms_vswfset_sph_t; - - qpms_errno_t qpms_legendre_deriv_y_get(double **result, double **result_deriv, double x, qpms_l_t lMax, gsl_sf_legendre_t lnorm, double csphase); // free() result and result_deriv yourself! qpms_errno_t qpms_legendre_deriv_y_fill(double *where, double *where_deriv, double x,