From 6da03c6591c6ff5cb051f8d57f3bde33128eb45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 20 Feb 2019 07:57:36 +0000 Subject: [PATCH] Start a new C implementation of finite symmetric scattering systems. Former-commit-id: 14e2cd0568e9b65aaceff2b8cf31be544664eab3 --- qpms/scatsystem.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 qpms/scatsystem.h diff --git a/qpms/scatsystem.h b/qpms/scatsystem.h new file mode 100644 index 0000000..4ea278e --- /dev/null +++ b/qpms/scatsystem.h @@ -0,0 +1,34 @@ +/*! \file scatsystem.h + * \brief Modern interface for finite lattice calculations, including symmetries. + */ +#ifndef QPMS_SCATSYSTEM_H +#define QPMS_SCATSYSTEM_H + +/// 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 struct qpms_tmatrix_t { + const qpms_vswf_set_spec_t *spec; ///< NOT owned by qpms_tmatrix_t by default. + complex double *m; ///< Matrix elements +} qpms_tmatrix_t; +/// Returns a pointer to the beginning of the T-matrix row \a rowno. +static inline complex double *qpms_tmatrix_row(qpms_tmatrix_t *t, size_t rowno){ + return t->m + (t->spec->n * rowno); +} +/// NOT IMPLEMENTED Initialises a zero T-matrix. +qpms_tmatrix_t *qpms_tmatrix_init(const qpms_vswf_set_spec_t *bspec); +/// NOT IMPLEMENTED Destroys a T-matrix. +void qpms_tmatrix_free(qpms_tmatrix_t *t); + + +/// A particle, defined by its T-matrix and position. +typedef struct qpms_particle_t { + // Does it make sense to ever use other than cartesian coords for this? + cart3_t pos; ///< Particle position in cartesian coordinates. + const qpms_tmatrix_t *tmatrix; ///< T-matrix; not owned by qpms_particle_t. +} qpms_particle_t; + +#endif //QPMS_SCATSYSTEM_H