From 2499c739c8625d3b2bc81027312e8f774d4550be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Wed, 5 Feb 2020 16:02:33 +0200 Subject: [PATCH] New members to qpms_scatsys_t for periodic lattices. Former-commit-id: 94011c64fb1928b20419e628de045dbc762167eb --- qpms/scatsystem.c | 5 +++++ qpms/scatsystem.h | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/qpms/scatsystem.c b/qpms/scatsystem.c index 7308cc7..e4965d0 100644 --- a/qpms/scatsystem.c +++ b/qpms/scatsystem.c @@ -147,8 +147,11 @@ static void add_orbit_type(qpms_scatsys_t *ss, const qpms_ss_orbit_type_t *ot_cu qpms_scatsys_at_omega_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, const qpms_finite_group_t *sym, complex double omega, const qpms_tolerance_spec_t *tol) { + if(orig->lattice_dimension) + QPMS_NOT_IMPLEMENTED("Periodic systems not yet done"); // TODO check data sanity + qpms_l_t lMax = 0; // the overall lMax of all base specs. qpms_normalisation_t normalisation = QPMS_NORMALISATION_UNDEF; @@ -178,6 +181,8 @@ qpms_scatsys_at_omega_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, // Allocate T-matrix, particle and particle orbit info arrays qpms_scatsys_t *ss; QPMS_CRASHING_MALLOC(ss, sizeof(qpms_scatsys_t)); + ss->lattice_dimension = orig->lattice_dimension; + // TODO basic periodic lattices related stuff here. ss->lenscale = lenscale; ss->sym = sym; ss->medium = orig->medium; diff --git a/qpms/scatsystem.h b/qpms/scatsystem.h index 5c74c1f..0b32ec7 100644 --- a/qpms/scatsystem.h +++ b/qpms/scatsystem.h @@ -135,7 +135,42 @@ typedef struct qpms_ss_derived_tmatrix_t { struct qpms_trans_calculator; struct qpms_epsmu_generator_t; +/// Common "class" for system of scatterers, both periodic and non-periodic. +/** + * Infinite periodic structures (those with \a lattice_dimension > 0) + * have the following additional members filled: + * - lattice_basis_csystem + * - lattice_basis + * - reciprocal_basis_csystem + * - reciprocal_basis + * - unitcell_volume + * These are ignored for finite systems (lattice_dimension == 0). + * + */ typedef struct qpms_scatsys_t { + /// Number of dimensions in which the system is periodic from the range 0–3. + int lattice_dimension; + + /// Coordinate system for \a lattice_basis. + /** This is mandatory for \a lattice_dimension != 0 */ + qpms_coord_system_t lattice_basis_csystem; + /// (Direct) lattice basis of the system (only \a lattice_dimension elements are used) + /** This is mandatory for \a lattice_dimension != 0 */ + anycoord_point_t lattice_basis[3]; + + /// Coordinate system for \a reciprocal_basis. + qpms_coord_system_t reciprocal_basis_csystem; + /// Reciprocal lattice basis. + /**(TODO specify whether it includes 2π or not) */ + anycoord_point_t reciprocal_basis[3]; + + /// Unitcell volume (irrelevant for non-periodic systems). + /** The dimensionality of the volume corresponds to lattice_dimension, so + * for lattice_dimension == 1, this will actually be lenght and for + * lattice_dimension == 2, a 2D area. + */ + double unitcell_volume; + struct qpms_epsmu_generator_t medium; ///< Optical properties of the background medium. /// (Template) T-matrix functions in the system.