Prototypes for functions using the new qpms_vswf_set_spec_t (NI).

Former-commit-id: 26a1d102b4be0b0fa96a04d17a85b6b84c15b705
This commit is contained in:
Marek Nečada 2019-02-19 21:35:46 +00:00
parent f5a776ac61
commit 2238409046
2 changed files with 37 additions and 24 deletions

View File

@ -17,17 +17,19 @@
// integer index types // integer index types
typedef int qpms_lm_t; typedef int qpms_lm_t;
/// Type for spherical harmonic degree l. /// 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. /// Type for spherical harmonic order m.
typedef qpms_lm_t qpms_m_t; typedef qpms_lm_t qpms_m_t;
/// Type for the (l,m) multiindex of transversal (M or N-type) VSWFs. /// Type for the (l,m) multiindex of transversal (M or N-type) VSWFs.
/** This corresponds to the typical memory layout for various coefficient etc. /** This corresponds to the typical memory layout for various coefficient etc.
* Corresponds to the l-primary, m-secondary ordering, i.e. \n * Corresponds to the l-primary, m-secondary ordering, i.e.
* y = 0: l = 1, m = -1,\n * \f[ y = 0: l = 1, m = -1, \f]
* y = 1: l = 1, m = 0,\n * \f[ y = 1: l = 1, m = 0, \f]
* y = 2: l = 1, m = +1,\n * \f[ y = 2: l = 1, m = +1, \f]
* y = 3: l = 2, m = -2,\n * \f[ y = 3: l = 2, m = -2, \f]
* ... * ...
*/ */
typedef size_t qpms_y_t; 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). /// 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 /** This differs from qpms_y_t by being shifted by one and including
* the l = 0 option. Suitable also for scalar and longitudinal waves. * the l = 0 option. Suitable also for scalar and longitudinal waves.
* Corresponds to the l-primary, m-secondary ordering, i.e.\n * Corresponds to the l-primary, m-secondary ordering, i.e.
* y = 0: l = 0, m = 0,\n * \f[ y = 0: l = 0, m = 0, \f]
* y = 1: l = 1, m = -1,\n * \f[ y = 1: l = 1, m = -1, \f]
* y = 2: l = 1, m = 0,\n * \f[ y = 2: l = 1, m = 0, \f]
* y = 3: l = 1, m = +1,\n * \f[ y = 3: l = 1, m = +1, \f]
* y = 4: l = 2, m = -2,\n * \f[ y = 4: l = 2, m = -2, \f]
* ... * ...
*/ */
typedef size_t qpms_y_sc_t; 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. /// Bessel function kinds.
typedef enum { typedef enum {
QPMS_BESSEL_REGULAR = 1, ///< regular (spherical) Bessel function $j$ (Bessel function of the first kind) QPMS_BESSEL_REGULAR = 1, ///< regular (spherical) Bessel function \a j (Bessel function of the first kind)
QPMS_BESSEL_SINGULAR = 2, ///< singular (spherical) Bessel function $y$ (Bessel function of the second kind) QPMS_BESSEL_SINGULAR = 2, ///< singular (spherical) Bessel function \a y (Bessel function of the second kind)
QPMS_HANKEL_PLUS = 3, ///< (spherical) Hankel function $h_1 = j + iy$ QPMS_HANKEL_PLUS = 3, ///< (spherical) Hankel function \f$ h_1 = j + iy \f$
QPMS_HANKEL_MINUS = 4, ///< (spherical) Hankel function $h_2 = j - iy$ QPMS_HANKEL_MINUS = 4, ///< (spherical) Hankel function \f$ h_2 = j - iy \f$
QPMS_BESSEL_UNDEF = 0 ///< invalid / unspecified kind QPMS_BESSEL_UNDEF = 0 ///< invalid / unspecified kind
} qpms_bessel_t; } qpms_bessel_t;

View File

@ -28,16 +28,29 @@ typedef struct qpms_vswf_set_spec_t {
size_t capacity; ///< Allocated capacity of ilist. size_t capacity; ///< Allocated capacity of ilist.
qpms_normalisation_t norm; ///< Normalisation convention. To be set manually if needed. qpms_normalisation_t norm; ///< Normalisation convention. To be set manually if needed.
} qpms_vswf_set_spec_t; } qpms_vswf_set_spec_t;
/// Creates a qpms_vswf_set_spec_t structure with an empty list of wave indices. /// 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(); 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. /// 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); 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. /// Destroys a \ref qpms_vswf_set_spec_t.
void qpms_vswf_set_spec_free(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. /// Electric wave N.
csphvec_t qpms_vswf_single_el(int m, int n, sph_t kdlj, csphvec_t qpms_vswf_single_el(int m, int n, sph_t kdlj,
qpms_bessel_t btyp, qpms_normalisation_t norm); 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); qpms_bessel_t btyp, qpms_normalisation_t norm);
/// Set of electric and magnetic VSWF values in spherical coordinate basis. /// Set of electric and magnetic VSWF values in spherical coordinate basis.
/* This is supposed to contain all the waves up to $l = lMax$. /** 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. *
* For a completely custom set of waves, use \ref qpms_uvswfset_sph_t instead.
*/ */
typedef struct qpms_vswfset_sph_t { typedef struct qpms_vswfset_sph_t {
//qpms_normalisation_t norm; //qpms_normalisation_t norm;
qpms_l_t lMax; qpms_l_t lMax;
@ -58,8 +71,6 @@ typedef struct qpms_vswfset_sph_t {
csphvec_t *el, *mg; csphvec_t *el, *mg;
} qpms_vswfset_sph_t; } qpms_vswfset_sph_t;
qpms_errno_t qpms_legendre_deriv_y_get(double **result, double **result_deriv, double x, qpms_l_t lMax, 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! 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, qpms_errno_t qpms_legendre_deriv_y_fill(double *where, double *where_deriv, double x,