QPMS
Electromagnetic multiple scattering library and toolkit.
tmatrices.h
Go to the documentation of this file.
1 
4 #ifndef TMATRICES_H
5 #define TMATRICES_H
6 // #include "qpms_types.h" // included via materials.h
7 // #include <gsl/gsl_spline.h> // included via materials.h
8 #include "materials.h"
9 #include <stdio.h>
10 
11 
12 
13 struct qpms_finite_group_t;
15 
17 static inline complex double *qpms_tmatrix_row(qpms_tmatrix_t *t, size_t rowno){
18  return t->m + (t->spec->n * rowno);
19 }
20 
22 
25 
26 
29 
31 
36 
39 
41 
45 bool qpms_tmatrix_isclose(const qpms_tmatrix_t *T1, const qpms_tmatrix_t *T2,
46  const double rtol, const double atol);
47 
49 
55  const qpms_tmatrix_t *T,
56  const complex double *M
57  );
58 
60 
66  qpms_tmatrix_t *T,
67  const complex double *M
68  );
69 
71 
77  const qpms_tmatrix_t *T,
78  const complex double *M
79  );
80 
82 
86  const qpms_tmatrix_t *T
87  );
89 
96  const qpms_tmatrix_t *T,
97  int N
98  );
99 
101 
107  qpms_tmatrix_t *T,
108  const complex double *M
109  );
110 
112 
116  qpms_tmatrix_t *T
117  );
119 
126  qpms_tmatrix_t *T,
127  int N
128  );
129 
131 
145  const char *path,
146  const qpms_vswf_set_spec_t *bspec,
147  size_t *n,
148  double **freqs,
149  double **freqs_su,
151  qpms_tmatrix_t **tmatrices_array,
152  complex double **tmdata
153  );
154 
156 
165 
167 
178  FILE *f,
179  const qpms_vswf_set_spec_t *bspec,
180  size_t *n,
181  double **freqs,
182  double **freqs_su,
184  qpms_tmatrix_t **tmatrices_array,
186 
192  complex double ** tmdata
193  );
194 
196 
203  complex double *tmdata, const size_t tmcount,
204  const qpms_vswf_set_spec_t *bspec,
205  size_t n_symops,
206  const qpms_irot3_t *symops
207  );
208 
210 
216  complex double *tmdata, const size_t tmcount,
217  const qpms_vswf_set_spec_t *bspec,
218  const qpms_finite_group_t *pointgroup
219  );
220 
222 
228  qpms_tmatrix_t *T,
229  size_t n_symops,
230  const qpms_irot3_t *symops
231  );
232 
234 
240  qpms_tmatrix_t *T,
241  const qpms_finite_group_t *pointgroup
242  );
243 
245 complex double *qpms_apply_tmatrix(
246  complex double *f_target,
247  const complex double *a,
248  const qpms_tmatrix_t *T
249  );
250 
252 
258 typedef struct qpms_tmatrix_generator_t {
259  qpms_errno_t (*function) (qpms_tmatrix_t *t,
260  complex double omega,
261  const void *params
262  );
263  const void *params;
265 
268  const qpms_vswf_set_spec_t *bspec,
270  complex double omega);
271 
272 
274 
278  complex double omega,
280  const void *tmatrix_orig
281  );
282 
283 /* Fuck this, include the whole <gsl/gsl_spline.h>
284 typedef struct gsl_spline gsl_spline; // Forward declaration for the interpolator struct
285 typedef struct gsl_interp_type gsl_interp_type;
286 extern const gsl_interp_type * gsl_interp_linear;
287 extern const gsl_interp_type * gsl_interp_polynomial;
288 extern const gsl_interp_type * gsl_interp_cspline;
289 extern const gsl_interp_type * gsl_interp_cspline_periodic;
290 extern const gsl_interp_type * gsl_interp_akima;
291 extern const gsl_interp_type * gsl_interp_akima_periodic;
292 extern const gsl_interp_type * gsl_interp_steffen;
293 */
294 
295 // struct gsl_interp_accel; // use if lookup proves to be too slow
297  const qpms_vswf_set_spec_t *bspec;
298  //bool owns_bspec;
299  gsl_spline **splines_real;
300  gsl_spline **splines_imag;
301  // gsl_interp_accel **accel_real;
302  // gsl_interp_accel **accel_imag;
304 
307 
310  const qpms_tmatrix_interpolator_t *interp, double freq);
311 
313 
315 
318  const double *freqs, const qpms_tmatrix_t *tmatrices_array,
319  const gsl_interp_type *iptype
320  //, bool copy_bspec ///< if true, copies its own copy of basis spec from the first T-matrix.
321  /*, ...? */);
322 
323 
325 
328  complex double omega,
329  const void *interpolator
330 );
331 
333 
345 complex double *qpms_mie_coefficients_reflection(
346  complex double *target,
347  const qpms_vswf_set_spec_t *bspec,
348  double a,
349  complex double k_i,
350  complex double k_e,
351  complex double mu_i,
352  complex double mu_e,
353  qpms_bessel_t J_ext,
354  qpms_bessel_t J_scat
355  );
356 
359  double a,
360  complex double k_i,
361  complex double k_e,
362  complex double mu_i,
363  complex double mu_e
364  );
365 
368  qpms_epsmu_generator_t outside;
369  qpms_epsmu_generator_t inside;
370  double radius;
372 
375  complex double omega,
376  const void *params
377  );
378 
381  const qpms_vswf_set_spec_t *bspec,
382  double a,
383  complex double k_i,
384  complex double k_e,
385  complex double mu_i,
386  complex double mu_e
387  ) {
388  qpms_tmatrix_t *t = qpms_tmatrix_init(bspec);
389  qpms_tmatrix_spherical_fill(t, a, k_i, k_e, mu_i, mu_e);
390  return t;
391 }
392 
395  qpms_tmatrix_t *t,
396  double a,
397  double omega,
398  complex double epsilon_fg,
399  complex double epsilon_bg
400  );
401 
404  const qpms_vswf_set_spec_t *bspec,
405  double a,
406  double omega,
407  complex double epsilon_fg,
408  complex double epsilon_bg
409  ) {
410  qpms_tmatrix_t *t = qpms_tmatrix_init(bspec);
411  qpms_tmatrix_spherical_mu0_fill(t, a, omega, epsilon_fg, epsilon_bg);
412  return t;
413 };
414 
417  double r;
418  double beta;
420 
422 typedef struct qpms_arc_function_t {
424 
431  double theta,
432  const void *params
433  );
434  const void *params;
436 
439  double R;
440  double h;
442 
445  const void *params
446  );
447 
449 
451  const void *R
452  );
453 
454 
456 
462  qpms_tmatrix_t *t,
463  complex double omega,
464  qpms_epsmu_t outside,
465  qpms_epsmu_t inside,
466  qpms_arc_function_t shape,
471  qpms_l_t lMax_extend
472  );
473 
476  const qpms_vswf_set_spec_t *bspec,
477  complex double omega,
478  qpms_epsmu_t outside,
479  qpms_epsmu_t inside,
480  qpms_arc_function_t shape,
482 
486  qpms_l_t lMax_extend
487  ) {
488  qpms_tmatrix_t *t = qpms_tmatrix_init(bspec);
489  qpms_tmatrix_axialsym_fill(t, omega, outside, inside, shape, lMax_extend);
490  return t;
491 }
492 
495  qpms_epsmu_generator_t outside;
496  qpms_epsmu_generator_t inside;
497  qpms_arc_function_t shape;
498  qpms_l_t lMax_extend;
500 
501 
504  complex double omega,
505  const void *params
506 );
507 
508 
511  complex double omega,
514  qpms_bessel_t J
515  );
516 
519  complex double omega, qpms_epsmu_t outside, qpms_epsmu_t inside,
521  qpms_bessel_t J
522  );
523 
524 
526 typedef struct qpms_tmatrix_function_t {
537 
539 // FIXME the name is not very intuitive.
541  return qpms_tmatrix_init_from_generator(f.spec, *f.gen, omega);
542 }
543 
545 typedef enum {
553  //QPMS_TMATRIX_OPERATION_POINTGROUP, ///< TODO the new point group in pointgroup.h
556 
560 
561  complex double *m;
562  size_t m_size;
563  bool owns_m;
564 };
565 
566 struct qpms_tmatrix_operation_t; // Forward declaration for the composed operations.
567 
570  size_t n;
571  const struct qpms_tmatrix_operation_t **ops;
572  double factor;
574 
579 };
580 
583  size_t n;
584  const struct qpms_tmatrix_operation_t **ops;
586  size_t opmem_size;
587  _Bool *ops_owned;
588 };
589 
593 
594  complex double *m;
595  size_t m_size;
596  bool owns_m;
597 };
598 
600 
603  size_t n;
605  bool owns_ops;
606 };
607 
609 typedef struct qpms_tmatrix_operation_t {
612  union {
613  struct qpms_tmatrix_operation_lrmatrix lrmatrix;
614  struct qpms_tmatrix_operation_scmulz scmulz;
616  struct qpms_tmatrix_operation_irot3arr irot3arr;
617  struct qpms_tmatrix_operation_compose_sum compose_sum;
618  struct qpms_tmatrix_operation_compose_chain compose_chain;
620 
622  } op;
624 
625 static const qpms_tmatrix_operation_t qpms_tmatrix_operation_noop = {.typ = QPMS_TMATRIX_OPERATION_NOOP};
626 
629 
632 
635  const qpms_tmatrix_operation_t *op, const qpms_tmatrix_t *orig);
636 
638 
644 
646 
648 
651  qpms_tmatrix_operation_t *target,
652  size_t nops,
653  size_t opmem_size
654  );
655 
656 #if 0
657 // Abstract types that describe T-matrix/particle/scatsystem symmetries
658 // To be implemented later. See also the thoughts in the beginning of groups.h.
659 
660 typedef *char qpms_tmatrix_id_t;
661 
663 
666 typedef struct qpms_abstract_tmatrix_t{
667  qpms_tmatrix_id_t id;
669  qpms_irot3_t *invar_gens;
671  qpms_gmi_t invar_gens_size;
672 
674 
675 
676 typedef struct qpms_abstract_particle_t{
677 } qpms_abstract_particle_t;
678 
680 typedef struct qpms_abstract_particle_t {
681  cart3_t pos;
682  const qpms_abstract_tmatrix_t *tmatrix;
683 } qpms_abstract_particle_t;
684 
685 
689 typedef qpms_particle_tid_t qpms_abstract_particle_tid_t;
690 #endif // 0
691 
692 #endif //TMATRICES_H
Optical properties of materials.
qpms_normalisation_t
Vector spherical wavefuction normalisation and phase convention codes.
Definition: qpms_types.h:104
int qpms_l_t
Type for spherical harmonic degree l.
Definition: qpms_types.h:27
int qpms_gmi_t
Finite group member index. See also groups.h.
Definition: qpms_types.h:320
qpms_errno_t
Error codes / return values for certain numerical functions.
Definition: qpms_types.h:85
struct qpms_abstract_tmatrix_t qpms_abstract_tmatrix_t
An abstract T-matrix without actual elements, but with info about particle symmetry.
qpms_bessel_t
Bessel function kinds.
Definition: qpms_types.h:176
3D cartesian coordinates. See also vectors.h.
Definition: qpms_types.h:186
An abstract T-matrix without actual elements, but with info about particle symmetry.
Definition: qpms_types.h:415
Parameter structure for qpms_arc_cylinder().
Definition: tmatrices.h:438
double h
Cylinder height.
Definition: tmatrices.h:440
double R
Cylinder radius.
Definition: tmatrices.h:439
Return value type for qpms_arc_function_t.
Definition: tmatrices.h:416
double beta
Angle between surface normal and radial direction.
Definition: tmatrices.h:418
double r
Distance from the origin.
Definition: tmatrices.h:417
Prototype for general parametrisation of -symmetric particle's surface.
Definition: tmatrices.h:422
Prototype for general optical property generator for isotropic materials.
Definition: materials.h:16
A type holding electric permittivity and magnetic permeability of a material.
Definition: qpms_types.h:422
A point group with its irreducible representations and some metadata.
Definition: groups.h:53
3D improper rotations represented as a quaternion and a sign of the determinant.
Definition: qpms_types.h:275
A particle, defined by its T-matrix INDEX and position, to be used in qpms_scatsys_t.
Definition: scatsystem.h:36
An "abstract" T-matrix, contains a T-matrix generator instead of actual data.
Definition: tmatrices.h:526
const qpms_vswf_set_spec_t * spec
VSWF basis specification, NOT owned by qpms_tmatrix_t by default.
Definition: tmatrices.h:534
const qpms_tmatrix_generator_t * gen
A T-matrix generator function.
Definition: tmatrices.h:535
Parameter structure for qpms_tmatrix_generator_axialsym.
Definition: tmatrices.h:494
Parameter structure for qpms_tmatrix_generator_sphere().
Definition: tmatrices.h:367
Generic T-matrix generator function that fills a pre-initialised qpms_tmatrix_t given a frequency.
Definition: tmatrices.h:258
const void * params
Parameter pointer passed to the function.
Definition: tmatrices.h:263
Definition: tmatrices.h:296
gsl_spline ** splines_imag
There will be a spline object for each nonzero element.
Definition: tmatrices.h:300
gsl_spline ** splines_real
There will be a spline object for each nonzero element.
Definition: tmatrices.h:299
Specifies a composed operation of type for qpms_tmatrix_operation_t.
Definition: tmatrices.h:582
size_t opmem_size
Length of the opmem array.
Definition: tmatrices.h:586
struct qpms_tmatrix_operation_t * opmem
(Optional) operations buffer into which elements of ops point. (Owned by this or NULL....
Definition: tmatrices.h:585
size_t n
Number of operations in ops;.
Definition: tmatrices.h:583
_Bool * ops_owned
True for all sub operations owned by this and saved in opmem. NULL if opmem is NULL.
Definition: tmatrices.h:587
const struct qpms_tmatrix_operation_t ** ops
Operations array. (Pointers owned by this.)
Definition: tmatrices.h:584
Specifies a composed operation of type for qpms_tmatrix_operation_t.
Definition: tmatrices.h:569
const struct qpms_tmatrix_operation_t ** ops
Operations array. (Pointers array ops[] always owned by this.)
Definition: tmatrices.h:571
struct qpms_tmatrix_operation_t * opmem
(Optional) operations buffer into which elements of ops point.
Definition: tmatrices.h:578
double factor
Definition: tmatrices.h:572
size_t n
Number of operations in ops;.
Definition: tmatrices.h:570
Specifies a symmetrisation using a set of rotoreflections (with equal weights) for qpms_tmatrix_opera...
Definition: tmatrices.h:602
qpms_irot3_t * ops
Rotoreflection array of size n.
Definition: tmatrices.h:604
bool owns_ops
Whether ops array is owned by this.
Definition: tmatrices.h:605
size_t n
Number of rotoreflections;.
Definition: tmatrices.h:603
General matrix transformation.
Definition: tmatrices.h:558
bool owns_m
Whether m is owned by this;.
Definition: tmatrices.h:563
size_t m_size
Total size of m matrix in terms of sizeof(complex double).
Definition: tmatrices.h:562
complex double * m
Raw matrix data of M in row-major order.
Definition: tmatrices.h:561
Specifies an elementwise complex multiplication of type for qpms_tmatrix_operation_t.
Definition: tmatrices.h:591
size_t m_size
Total size of m matrix in terms of sizeof(complex double).
Definition: tmatrices.h:595
bool owns_m
Whether m is owned by this.
Definition: tmatrices.h:596
complex double * m
Raw matrix data of M in row-major order.
Definition: tmatrices.h:594
A generic T-matrix transformation operator.
Definition: tmatrices.h:609
const qpms_finite_group_t * finite_group
Finite group for QPMS_TMATRIX_OPERATION_FINITE_GROUP_SYMMETRISE.
Definition: tmatrices.h:621
qpms_irot3_t irot3
Single rotoreflection; typ = QPMS_TMATRIX_OPERATION_IROT3.
Definition: tmatrices.h:615
union qpms_tmatrix_operation_t::@0 op
Operation data; actual type is determined by typ.
qpms_tmatrix_operation_kind_t typ
Specifies the operation kind to be performed and which type \op actually contains.
Definition: tmatrices.h:611
A T-matrix.
Definition: qpms_types.h:338
Specifies a finite set of VSWFs.
Definition: qpms_types.h:290
qpms_errno_t qpms_read_scuff_tmatrix(FILE *f, const qpms_vswf_set_spec_t *bspec, size_t *n, double **freqs, double **freqs_su, qpms_tmatrix_t **tmatrices_array, complex double **tmdata)
Loads a scuff-tmatrix generated file.
Definition: tmatrices.c:368
qpms_tmatrix_t * qpms_tmatrix_mv(qpms_tmatrix_t *dest, const qpms_tmatrix_t *orig)
Copies a T-matrix contents between two pre-allocated T-matrices.
Definition: tmatrices.c:1132
qpms_tmatrix_t * qpms_tmatrix_apply_symop_inplace(qpms_tmatrix_t *T, const complex double *M)
Applies a symmetry operation onto a T-matrix, rewriting the original T-matrix data.
Definition: tmatrices.c:71
qpms_tmatrix_t * qpms_tmatrix_symmetrise_finite_group_inplace(qpms_tmatrix_t *T, const qpms_finite_group_t *pointgroup)
In-place application of point group elements on a T-matrix.
Definition: tmatrices.c:170
qpms_tmatrix_t * qpms_tmatrix_apply_operation_replace(qpms_tmatrix_t *dest, const qpms_tmatrix_operation_t *op, const qpms_tmatrix_t *orig)
Apply an operation on a T-matrix and replace another one it with the result.
Definition: tmatrices.c:1140
qpms_arc_function_retval_t qpms_arc_cylinder(double theta, const void *params)
Arc parametrisation of cylindrical particle; for qpms_arc_function_t.
Definition: tmatrices.c:625
qpms_tmatrix_operation_kind_t
Specifies different kinds of operations done on T-matrices.
Definition: tmatrices.h:545
@ QPMS_TMATRIX_OPERATION_FINITE_GROUP_SYMMETRISE
Legacy qpms_finite_group_t with filled rep3d; see qpms_tmatrix_operation_finite_group.
Definition: tmatrices.h:554
@ QPMS_TMATRIX_OPERATION_COMPOSE_CHAIN
Chain several different transformations; see qpms_tmatrix_operation_compose_chain.
Definition: tmatrices.h:551
@ QPMS_TMATRIX_OPERATION_NOOP
Identity operation.
Definition: tmatrices.h:546
@ QPMS_TMATRIX_OPERATION_IROT3ARR
Symmetrise using an array of rotoreflection; see qpms_tmatrix_operation_irot3arr.
Definition: tmatrices.h:549
@ QPMS_TMATRIX_OPERATION_COMPOSE_SUM
Apply several transformations and sum the results, see qpms_tmatrix_operation_compose_sum.
Definition: tmatrices.h:550
@ QPMS_TMATRIX_OPERATION_IROT3
Single rotoreflection specified by a qpms_irot3_t.
Definition: tmatrices.h:548
@ QPMS_TMATRIX_OPERATION_SCMULZ
Elementwise scalar multiplication with a complex matrix; see qpms_tmatrix_operation_scmulz.
Definition: tmatrices.h:552
@ QPMS_TMATRIX_OPERATION_LRMATRIX
General matrix transformation ; see qpms_tmatrix_operation_lrmatrix.
Definition: tmatrices.h:547
qpms_errno_t qpms_tmatrix_interpolator_eval_fill(qpms_tmatrix_t *target, const qpms_tmatrix_interpolator_t *interp, double freq)
Fills an existing T-matrix with new interpolated values.
Definition: tmatrices.c:341
qpms_errno_t qpms_tmatrix_generator_axialsym_RQ_transposed_fill(complex double *target, complex double omega, const qpms_tmatrix_generator_axialsym_param_t *param, qpms_normalisation_t norm, qpms_bessel_t J)
Computes the (reduced) transposed R or Q matrix for axially symmetric particle (useful for debugging)...
Definition: tmatrices.c:958
complex double * qpms_mie_coefficients_reflection(complex double *target, const qpms_vswf_set_spec_t *bspec, double a, complex double k_i, complex double k_e, complex double mu_i, complex double mu_e, qpms_bessel_t J_ext, qpms_bessel_t J_scat)
Calculates the reflection Mie-Lorentz coefficients for a spherical particle.
Definition: tmatrices.c:500
void qpms_tmatrix_operation_copy(qpms_tmatrix_operation_t *target, const qpms_tmatrix_operation_t *src)
(Recursively) copies an qpms_tmatrix_operation_t.
Definition: tmatrices.c:1051
void qpms_tmatrix_free(qpms_tmatrix_t *t)
Destroys a T-matrix.
Definition: tmatrices.c:66
bool qpms_tmatrix_isclose(const qpms_tmatrix_t *T1, const qpms_tmatrix_t *T2, const double rtol, const double atol)
Check T-matrix equality/similarity.
Definition: tmatrices.c:257
qpms_errno_t qpms_tmatrix_axialsym_RQ_transposed_fill(complex double *target, complex double omega, qpms_epsmu_t outside, qpms_epsmu_t inside, qpms_arc_function_t shape, qpms_l_t lMaxQR, qpms_normalisation_t norm, qpms_bessel_t J)
Computes the (reduced) transposed R or Q matrix for axially symmetric particle (useful mostly for deb...
Definition: tmatrices.c:896
qpms_tmatrix_t * qpms_tmatrix_symmetrise_C_inf(const qpms_tmatrix_t *T)
Creates a -symmetrized version of a T-matrix.
Definition: tmatrices.c:217
struct qpms_tmatrix_generator_sphere_param_t qpms_tmatrix_generator_sphere_param_t
Parameter structure for qpms_tmatrix_generator_sphere().
qpms_tmatrix_t * qpms_tmatrix_symmetrise_C_inf_inplace(qpms_tmatrix_t *T)
Creates a -symmetrized version of a T-matrix, rewriting the original one.
Definition: tmatrices.c:222
void qpms_tmatrix_operation_clear(qpms_tmatrix_operation_t *f)
(Recursively) deallocates internal data of qpms_tmatrix_operation_t.
Definition: tmatrices.c:991
qpms_tmatrix_t * qpms_tmatrix_apply_symop(const qpms_tmatrix_t *T, const complex double *M)
Creates a T-matrix from another matrix and a symmetry operation.
Definition: tmatrices.c:93
qpms_errno_t qpms_tmatrix_generator_interpolator(qpms_tmatrix_t *t, complex double omega, const void *interpolator)
qpms_tmatrix_interpolator for qpms_tmatrix_generator_t.
Definition: tmatrices.c:352
static complex double * qpms_tmatrix_row(qpms_tmatrix_t *t, size_t rowno)
Returns a pointer to the beginning of the T-matrix row rowno.
Definition: tmatrices.h:17
qpms_arc_function_retval_t qpms_arc_sphere(double theta, const void *R)
Arc parametrisation of spherical particle; for qpms_arc_function_t.
Definition: tmatrices.c:620
struct qpms_arc_function_retval_t qpms_arc_function_retval_t
Return value type for qpms_arc_function_t.
qpms_tmatrix_t * qpms_tmatrix_copy(const qpms_tmatrix_t *T)
Copies a T-matrix, allocating new array for the T-matrix data.
Definition: tmatrices.c:58
struct qpms_tmatrix_function_t qpms_tmatrix_function_t
An "abstract" T-matrix, contains a T-matrix generator instead of actual data.
qpms_errno_t qpms_tmatrix_axialsym_fill(qpms_tmatrix_t *t, complex double omega, qpms_epsmu_t outside, qpms_epsmu_t inside, qpms_arc_function_t shape, qpms_l_t lMax_extend)
Replaces T-matrix contents with those of a particle with symmetry.
Definition: tmatrices.c:807
bool qpms_load_scuff_tmatrix_crash_on_failure
Tells whether qpms_load_scuff_tmatrix should crash if fopen() fails.
Definition: tmatrices.c:467
qpms_tmatrix_t * qpms_tmatrix_symmetrise_C_N(const qpms_tmatrix_t *T, int N)
Creates a -symmetrized version of a T-matrix.
Definition: tmatrices.c:237
struct qpms_tmatrix_generator_t qpms_tmatrix_generator_t
Generic T-matrix generator function that fills a pre-initialised qpms_tmatrix_t given a frequency.
struct qpms_arc_cylinder_params_t qpms_arc_cylinder_params_t
Parameter structure for qpms_arc_cylinder().
static qpms_tmatrix_t * qpms_tmatrix_axialsym(const qpms_vswf_set_spec_t *bspec, complex double omega, qpms_epsmu_t outside, qpms_epsmu_t inside, qpms_arc_function_t shape, qpms_l_t lMax_extend)
Creates a new T-matrix of a particle with symmetry.
Definition: tmatrices.h:475
qpms_tmatrix_t * qpms_tmatrix_symmetrise_C_N_inplace(qpms_tmatrix_t *T, int N)
Creates a -symmetrized version of a T-matrix, rewriting the original one.
Definition: tmatrices.c:242
qpms_tmatrix_t * qpms_tmatrix_apply_operation(const qpms_tmatrix_operation_t *op, const qpms_tmatrix_t *orig)
Apply an operation on a T-matrix, returning a newly allocated result.
Definition: tmatrices.c:1152
void qpms_tmatrix_operation_compose_chain_init(qpms_tmatrix_operation_t *target, size_t nops, size_t opmem_size)
Inits a new "chain" of composed operations, some of which might be owned.
Definition: tmatrices.c:1107
qpms_errno_t qpms_tmatrix_spherical_fill(qpms_tmatrix_t *t, double a, complex double k_i, complex double k_e, complex double mu_i, complex double mu_e)
Replaces the contents of an existing T-matrix with that of a spherical nanoparticle calculated using ...
Definition: tmatrices.c:564
struct qpms_tmatrix_generator_axialsym_param_t qpms_tmatrix_generator_axialsym_param_t
Parameter structure for qpms_tmatrix_generator_axialsym.
qpms_errno_t qpms_symmetrise_tmdata_finite_group(complex double *tmdata, const size_t tmcount, const qpms_vswf_set_spec_t *bspec, const qpms_finite_group_t *pointgroup)
In-place application of a point group on raw T-matrix data.
Definition: tmatrices.c:149
qpms_tmatrix_t * qpms_tmatrix_symmetrise_involution(const qpms_tmatrix_t *T, const complex double *M)
Symmetrizes a T-matrix with an involution symmetry operation.
Definition: tmatrices.c:193
qpms_errno_t qpms_load_scuff_tmatrix(const char *path, const qpms_vswf_set_spec_t *bspec, size_t *n, double **freqs, double **freqs_su, qpms_tmatrix_t **tmatrices_array, complex double **tmdata)
Reads an open scuff-tmatrix generated file.
Definition: tmatrices.c:469
qpms_tmatrix_interpolator_t * qpms_tmatrix_interpolator_create(size_t n, const double *freqs, const qpms_tmatrix_t *tmatrices_array, const gsl_interp_type *iptype)
Create a T-matrix interpolator from frequency and T-matrix arrays.
Definition: tmatrices.c:273
qpms_errno_t qpms_symmetrise_tmdata_irot3arr(complex double *tmdata, const size_t tmcount, const qpms_vswf_set_spec_t *bspec, size_t n_symops, const qpms_irot3_t *symops)
In-place application of point group elements on raw T-matrix data.
Definition: tmatrices.c:115
qpms_tmatrix_t * qpms_tmatrix_init(const qpms_vswf_set_spec_t *bspec)
Initialises a zero T-matrix.
Definition: tmatrices.c:39
complex double * qpms_apply_tmatrix(complex double *f_target, const complex double *a, const qpms_tmatrix_t *T)
Application of T-matrix on a vector of incident field coefficients, .
Definition: tmatrices.c:608
struct qpms_arc_function_t qpms_arc_function_t
Prototype for general parametrisation of -symmetric particle's surface.
qpms_tmatrix_t * qpms_tmatrix_interpolator_eval(const qpms_tmatrix_interpolator_t *interp, double freq)
Evaluate a T-matrix interpolated value.
Definition: tmatrices.c:335
qpms_tmatrix_t * qpms_tmatrix_init_from_generator(const qpms_vswf_set_spec_t *bspec, qpms_tmatrix_generator_t gen, complex double omega)
Initialises and evaluates a new T-matrix using a generator.
Definition: tmatrices.c:49
qpms_errno_t qpms_tmatrix_generator_axialsym(qpms_tmatrix_t *t, complex double omega, const void *params)
qpms_tmatrix_axialsym for qpms_tmatrix_generator_t
Definition: tmatrices.c:970
qpms_errno_t qpms_tmatrix_spherical_mu0_fill(qpms_tmatrix_t *t, double a, double omega, complex double epsilon_fg, complex double epsilon_bg)
Convenience function to calculate T-matrix of a non-magnetic spherical particle using the permittivit...
static qpms_tmatrix_t * qpms_tmatrix_spherical(const qpms_vswf_set_spec_t *bspec, double a, complex double k_i, complex double k_e, complex double mu_i, complex double mu_e)
Creates a new T-matrix of a spherical particle using the Lorentz-Mie theory.
Definition: tmatrices.h:380
qpms_tmatrix_t * qpms_tmatrix_symmetrise_irot3arr_inplace(qpms_tmatrix_t *T, size_t n_symops, const qpms_irot3_t *symops)
In-place application of point group elements on a T-matrix.
Definition: tmatrices.c:159
qpms_tmatrix_t * qpms_tmatrix_apply_operation_inplace(const qpms_tmatrix_operation_t *op, qpms_tmatrix_t *orig)
Apply an operation on a T-matrix and replace it with the result.
Definition: tmatrices.c:1191
void qpms_tmatrix_interpolator_free(qpms_tmatrix_interpolator_t *interp)
Free a T-matrix interpolator.
Definition: tmatrices.c:322
struct qpms_tmatrix_operation_t qpms_tmatrix_operation_t
A generic T-matrix transformation operator.
static qpms_tmatrix_t * qpms_tmatrix_spherical_mu0(const qpms_vswf_set_spec_t *bspec, double a, double omega, complex double epsilon_fg, complex double epsilon_bg)
Convenience function to calculate T-matrix of a non-magnetic spherical particle using the permittivit...
Definition: tmatrices.h:403
qpms_errno_t qpms_tmatrix_generator_constant(qpms_tmatrix_t *t, complex double omega, const void *tmatrix_orig)
Implementation of qpms_matrix_generator_t that just copies a constant matrix.
Definition: tmatrices.c:980
static qpms_tmatrix_t * qpms_tmatrix_init_from_function(qpms_tmatrix_function_t f, complex double omega)
Convenience function to create a new T-matrix from qpms_tmatrix_function_t.
Definition: tmatrices.h:540
qpms_errno_t qpms_tmatrix_generator_sphere(qpms_tmatrix_t *t, complex double omega, const void *params)
T-matrix generator for spherical particles using Lorentz-Mie solution.
Definition: tmatrices.c:580
qpms_tmatrix_t * qpms_tmatrix_symmetrise_involution_inplace(qpms_tmatrix_t *T, const complex double *M)
Symmetrizes a T-matrix with an involution symmetry operation, rewriting the original one.
Definition: tmatrices.c:180