QPMS
Electromagnetic multiple scattering library and toolkit.
Data Structures | Functions
qpms_specfunc.h File Reference

Various special and auxillary functions. More...

#include "qpms_types.h"
#include <gsl/gsl_sf_legendre.h>
Include dependency graph for qpms_specfunc.h:

Go to the source code of this file.

Data Structures

struct  qpms_sbessel_calculator_t
 
struct  qpms_pitau_t
 Array of Legendre and and auxillary \(\pi_{lm}, \tau_{lm} \) functions. More...
 

Functions

qpms_errno_t qpms_sph_bessel_fill (qpms_bessel_t typ, qpms_l_t lmax, complex double x, complex double *result_array)
 
qpms_sbessel_calculator_tqpms_sbessel_calculator_init (void)
 
void qpms_sbessel_calculator_pfree (qpms_sbessel_calculator_t *c)
 
qpms_errno_t qpms_sbessel_calc_fill (qpms_sbessel_calculator_t *c, qpms_bessel_t typ, qpms_l_t lmax, double x, complex double *result_array)
 
complex double qpms_sbessel_calc_h1 (qpms_sbessel_calculator_t *c, qpms_l_t n, complex double x)
 
qpms_errno_t qpms_sbessel_calc_h1_fill (qpms_sbessel_calculator_t *c, qpms_l_t lmax, complex double x, complex double *result_array)
 
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)
 
qpms_errno_t qpms_legendre_deriv_y_fill (double *where, double *where_deriv, double x, qpms_l_t lMax, gsl_sf_legendre_t lnorm, double csphase)
 
double * qpms_legendre_y_get (double x, qpms_l_t lMax, qpms_normalisation_t norm)
 
double * qpms_legendre0d_y_get (qpms_l_t lMax, qpms_normalisation_t norm)
 
double * qpms_legendre_plus1d_y_get (qpms_l_t lMax, qpms_normalisation_t norm)
 
double * qpms_legendre_minus1d_y_get (qpms_l_t lMax, qpms_normalisation_t norm)
 
qpms_pitau_t qpms_pitau_get (double theta, qpms_l_t lMax, double csphase)
 Returns an array of normalised Legendre and auxillary \(\pi_{lm}, \tau_{lm} \) functions. More...
 
qpms_errno_t qpms_pitau_fill (double *target_leg, double *target_pi, double *target_tau, double theta, qpms_l_t lMax, double csphase)
 Directly fills (pre-allocated) arrays of normalised Legendre and auxillary \(\pi_{lm}, \tau_{lm} \) functions. More...
 
void qpms_pitau_free (qpms_pitau_t)
 Frees the dynamically allocated arrays from qpms_pitau_t.
 
double qpms_legendre0 (int m, int n)
 
double qpms_legendred0 (int m, int n)
 

Detailed Description

Various special and auxillary functions.

Function Documentation

◆ qpms_pitau_fill()

qpms_errno_t qpms_pitau_fill ( double *  target_leg,
double *  target_pi,
double *  target_tau,
double  theta,
qpms_l_t  lMax,
double  csphase 
)

Directly fills (pre-allocated) arrays of normalised Legendre and auxillary \(\pi_{lm}, \tau_{lm} \) functions.

Arrays must be preallocated for lMax * (lMax + 2) elements. NULL targets are skipped. For details, see qpms_pitau_get().

◆ qpms_pitau_get()

qpms_pitau_t qpms_pitau_get ( double  theta,
qpms_l_t  lMax,
double  csphase 
)

Returns an array of normalised Legendre and auxillary \(\pi_{lm}, \tau_{lm} \) functions.

The normalised Legendre function here is defined as

\[ \Fer[norm.]{l}{m} = \csphase^{-1} \sqrt{\frac{1}{l(l+1)}\frac{(l-m)!(2l+1)}{4\pi(l+m)!}}, \]

i.e. obtained using gsl_sf_legendre_array_e() with norm = GSL_SF_LEGENDRE_SPHARM and divided by \( \sqrt{l(l+1)} \).

The auxillary functions are defined as

\[ \pi_{lm}(\cos \theta) = \frac{m}{\sin \theta} \Fer[norm.]{l}{m}(\cos\theta),\\ \tau_{lm}(\cos \theta) = \frac{\ud}{\ud \theta} \Fer[norm.]{l}{m}(\cos\theta) \]

with appropriate limit expression used if \( \abs{\cos\theta} = 1 \).

When done, don't forget to deallocate the memory using qpms_pitau_free().