QPMS
Electromagnetic multiple scattering library and toolkit.
|
Common qpms types. More...
#include <complex.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | cart3_t |
3D cartesian coordinates. See also vectors.h. More... | |
struct | ccart3_t |
3D complex (actually 6D) coordinates. See also vectors.h. More... | |
struct | ccart3_pair |
3D complex vector pair (represents the E, H fields). More... | |
struct | cart2_t |
2D cartesian coordinates. See also vectors.h. More... | |
struct | sph_t |
Spherical coordinates. See also vectors.h. More... | |
struct | csph_t |
Spherical coordinates with complex radial component. See also vectors.h. More... | |
struct | csphvec_t |
3D complex vector components in local spherical basis. See also vectors.h. More... | |
struct | pol_t |
2D polar coordinates. See also vectors.h. More... | |
union | anycoord_point_t |
Union type capable to contain various 1D, 2D and 3D coordinates. More... | |
struct | qpms_quat_t |
Quaternion type. More... | |
struct | qpms_quat4d_t |
Quaternion type as four doubles. More... | |
struct | qpms_irot3_t |
3D improper rotations represented as a quaternion and a sign of the determinant. More... | |
struct | qpms_vswf_set_spec_t |
Specifies a finite set of VSWFs. More... | |
struct | qpms_tmatrix_t |
A T-matrix. More... | |
struct | qpms_pointgroup_t |
Full characterisation of a 3D point group. More... | |
struct | qpms_abstract_tmatrix_t |
An abstract T-matrix without actual elements, but with info about particle symmetry. More... | |
struct | qpms_epsmu_t |
A type holding electric permittivity and magnetic permeability of a material. More... | |
Macros | |
#define | M_PI_2 (1.570796326794896619231321691639751442098584699687552910487L) |
#define | M_PI (3.14159265358979323846264338327950288419716939937510582097494L) |
#define | M_SQRT2 (1.41421356237309504880168872420969807856967187537694807317668L) |
#define | M_SQRTPI (1.77245385090551602729816748334114518279754945612238712821381L) |
#define | QPMS_NO_IRREP ((qpms_iri_t) -1) |
Constant labeling that no irrep decomposition is done (full system solved instead). | |
#define | lmcheck(l, m) assert((l) >= 1 && abs(m) <= (l)) |
Typedefs | |
typedef int | qpms_lm_t |
typedef int | qpms_l_t |
Type for spherical harmonic degree l. | |
typedef qpms_lm_t | qpms_m_t |
Type for spherical harmonic order m. | |
typedef size_t | qpms_y_t |
Type for the (l, m) multiindex of transversal (M or N -type) VSWFs. More... | |
typedef size_t | qpms_y_sc_t |
Type for the (l, m) multiindex of spherical harmonics, including (0, 0). More... | |
typedef unsigned long long | qpms_uvswfi_t |
Exhaustive index type for VSWF basis functions. More... | |
typedef struct cart3_t | cart3_t |
3D cartesian coordinates. See also vectors.h. | |
typedef struct ccart3_t | ccart3_t |
3D complex (actually 6D) coordinates. See also vectors.h. | |
typedef struct ccart3_pair | ccart3_pair |
3D complex vector pair (represents the E, H fields). | |
typedef struct cart2_t | cart2_t |
2D cartesian coordinates. See also vectors.h. More... | |
typedef struct sph_t | sph_t |
Spherical coordinates. See also vectors.h. | |
typedef struct csph_t | csph_t |
Spherical coordinates with complex radial component. See also vectors.h. | |
typedef struct csphvec_t | csphvec_t |
3D complex vector components in local spherical basis. See also vectors.h. | |
typedef struct pol_t | pol_t |
2D polar coordinates. See also vectors.h. | |
typedef union anycoord_point_t | anycoord_point_t |
Union type capable to contain various 1D, 2D and 3D coordinates. More... | |
typedef struct qpms_quat_t | qpms_quat_t |
Quaternion type. More... | |
typedef struct qpms_quat4d_t | qpms_quat4d_t |
Quaternion type as four doubles. More... | |
typedef struct qpms_irot3_t | qpms_irot3_t |
3D improper rotations represented as a quaternion and a sign of the determinant. More... | |
typedef struct qpms_vswf_set_spec_t | qpms_vswf_set_spec_t |
Specifies a finite set of VSWFs. More... | |
typedef int32_t | qpms_ss_tmi_t |
T-matrix index used in qpms_scatsys_t and related structures. | |
typedef int32_t | qpms_ss_tmgi_t |
T-matrix generator index used in qpms_scatsys_t and related structures. | |
typedef int32_t | qpms_ss_pi_t |
Particle index used in qpms_scatsys_t and related structures. | |
typedef int | qpms_gmi_t |
Finite group member index. See also groups.h. | |
typedef int | qpms_iri_t |
Irreducible representation index. See also groups.h. | |
typedef const char * | qpms_permutation_t |
Permutation representation of a group element. More... | |
typedef struct qpms_tmatrix_t | qpms_tmatrix_t |
A T-matrix. More... | |
typedef struct qpms_pointgroup_t | qpms_pointgroup_t |
Full characterisation of a 3D point group. | |
typedef struct qpms_abstract_tmatrix_t | qpms_abstract_tmatrix_t |
An abstract T-matrix without actual elements, but with info about particle symmetry. | |
typedef struct qpms_epsmu_t | qpms_epsmu_t |
A type holding electric permittivity and magnetic permeability of a material. | |
Functions | |
static int | qpms_normalisation_t_csphase (qpms_normalisation_t norm) |
Determine whether the convention includes Condon-Shortley phase (-1) or not (+1). | |
Common qpms types.
typedef union anycoord_point_t anycoord_point_t |
Union type capable to contain various 1D, 2D and 3D coordinates.
Usually combined with qpms_coord_system_t.
typedef struct qpms_irot3_t qpms_irot3_t |
3D improper rotations represented as a quaternion and a sign of the determinant.
See quaternions.h for "methods".
typedef const char* qpms_permutation_t |
Permutation representation of a group element.
For now, it's just a string of the form "(0,1)(3,4,5)"
typedef struct qpms_quat4d_t qpms_quat4d_t |
Quaternion type as four doubles.
See quaternions.h for "methods".
typedef struct qpms_quat_t qpms_quat_t |
Quaternion type.
Internaly represented as a pair of complex numbers, \( Q_a = Q_1 + iQ_z, Q_b = Q_y + i Q_x\).
See quaternions.h for "methods".
typedef struct qpms_tmatrix_t qpms_tmatrix_t |
A T-matrix.
In the future, I might rather use a more abstract approach in which T-matrix is a mapping (function) of the field expansion coefficients. So the interface might change. For now, let me stick to the square dense matrix representation.
typedef unsigned long long qpms_uvswfi_t |
Exhaustive index type for VSWF basis functions.
Carries information about the wave being of M/N/L (magnetic, electric, or longitudinal) type, as well as the wave's degree and order (l, m).
The formula is 4 * (qpms_y_sc_t) y_sc + (qmps_vswf_type_t) type_code, but don't rely on this and use the functions qpms_tmn2uvswfi() and qpms_uvswfi2tmn() from qpms_types.h instead as the formula might change in future versions.
See also indexing.h.
typedef struct qpms_vswf_set_spec_t qpms_vswf_set_spec_t |
Specifies a finite set of VSWFs.
When for example not all the M and N -type waves up to a degree lMax need to be computed, this will specify the subset.
A typical use case would be when only even/odd fields wrt. z-plane mirror symmetry are considered.
See vswf.h for "methods".
typedef size_t qpms_y_sc_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.
\[ y = 0: l = 0, m = 0, \]
\[ y = 1: l = 1, m = -1, \]
\[ y = 2: l = 1, m = 0, \]
\[ y = 3: l = 1, m = +1, \]
\[ y = 4: l = 2, m = -2, \]
...
See also indexing.h.
typedef size_t qpms_y_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.
\[ y = 0: l = 1, m = -1, \]
\[ y = 1: l = 1, m = 0, \]
\[ y = 2: l = 1, m = +1, \]
\[ y = 3: l = 2, m = -2, \]
...
See also indexing.h.
enum qpms_bessel_t |
Bessel function kinds.
enum qpms_coord_system_t |
enum qpms_errno_t |
Error codes / return values for certain numerical functions.
Those with values between -2 and 32 are subset of the GSL error codes.
Enumerator | |
---|---|
QPMS_SUCCESS | Success. |
QPMS_ERROR | Unspecified error. |
QPMS_ENOMEM | Out of memory. |
QPMS_ESING | Apparent singularity detected. |
QPMS_NAN_ENCOUNTERED | NaN value encountered in data processing. |
enum qpms_normalisation_t |
Vector spherical wavefuction normalisation and phase convention codes.
Throughout the literature, various conventions for VSWF bases are used. These bit flags are used by the functions declared in normalisation.h that return the appropriate convention-dependent factors.
See VSWF conventions for comparison of the various conventions used.
Enumerator | |
---|---|
QPMS_NORMALISATION_UNDEF | Convention undefined. This should not happen. |
QPMS_NORMALISATION_INVERSE | Flag indicating that qpms_normalisition_factor_* should actually return values inverse to the default. |
QPMS_NORMALISATION_REVERSE_AZIMUTHAL_PHASE | Flag indicating inversion of the asimuthal phase for complex spherical harmonics (i.e. \( e^{-im\phi} \) instead of \( e^{im\phi} \). |
QPMS_NORMALISATION_SPHARM_REAL | Flag indicating use of the real spherical harmonics. If QPMS_NORMALISATION_REVERSE_AZIMUTHAL_PHASE is unset, negative m correspond to sine in the asimuthal factor; if set, undefined behaviour. |
QPMS_NORMALISATION_CSPHASE | Flag indicating usage of Condon-Shortley phase. If set, the Ferrers functions and everything derived from them (spherical harmonics, VSWFs) will include a \( (-1)^m \) factor. On implementation level, this means that the relevant |
QPMS_NORMALISATION_M_I | Include an additional i -factor into the magnetic waves. |
QPMS_NORMALISATION_M_MINUS | Include an additional \(-1\) -factor into the magnetic waves. |
QPMS_NORMALISATION_N_I | Include an additional i -factor into the electric waves. |
QPMS_NORMALISATION_N_MINUS | Include an additional \(-1\) -factor into the magnetic waves. |
QPMS_NORMALISATION_L_I | Include an additional i -factor into the longitudinal waves. |
QPMS_NORMALISATION_L_MINUS | Include an additional \(-1\) -factor into the longitudinal waves. |
QPMS_NORMALISATION_NORM_POWER | The VSWFs shall be power-normalised. This is the "default". Power normalisation is used e.g. in [3] (complex spherical harmonics with Condon-Shortley phase) or [4] (real spherical harmonics). This is also the reference for all the other normalisation conventions, meaning that qpms_normalisation_factor_M() and qpms_normalisation_factor_N() shall always return |
QPMS_NORMALISATION_NORM_SPHARM | The VSWFs shall be normalised as in [6] . This includes a \( \sqrt{l(l+1)} \) factor compared to the power normalisation. |
QPMS_NORMALISATION_NORM_NONE | The VSWFs shall be created using spherical harmonics without any normalisation. Do not use. This includes a \[ \sqrt{l(l+1)} \left(\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}\right)^{-\frac{1}{2}} \] factor compared to the power normalisation. Note that this has no sense whatsoever for real spherical harmonics. Again, do not use this. |
QPMS_NORMALISATION_CONVENTION_KRISTENSSON_REAL | VSWF convention used in [4]. |
QPMS_NORMALISATION_CONVENTION_KRISTENSSON | VSWF convention used in [3]. |
QPMS_NORMALISATION_CONVENTION_SCUFF | VSWF convention used in SCUFF-EM [5]. |
QPMS_NORMALISATION_DEFAULT | Default VSWF convention. We might encourage the compiler to expect this one. |
Classification of a 3D point group.
enum qpms_vswf_type_t |