![]() |
QPMS
Electromagnetic multiple scattering library and toolkit.
|
Per-k resonance solving machinery (libnles); see resonance_k.hpp. More...
#include <complex.h>#include "resonance_k.hpp"#include <cstring>#include <format>#include <lapacke.h>#include <memory>#include <print>#include <stdexcept>#include <string>#include <vector>#include <nles.h>#include "scatspec.h"#include "scatsystem.h"#include "groups.h"#include "ksym.h"#include "spgsym.h"#include "pergroups.h"#include "tolerances.h"#include "vectors.h"
Namespaces | |
| namespace | qpms |
Per-k resonance solving machinery (libnles); see resonance_k.hpp.
| void qpms::resonance::evaluate_eigenmode_fields | ( | const ResonanceKSetup & | setup, |
| const cart3_t & | k, | ||
| const qpms_simspec_resonances_t * | r, | ||
| ResonanceKResult & | res, | ||
| bool | verbose = false |
||
| ) |
Evaluates the eigenmode field maps of a solved setup (the resonances experiment fields: option). Fills the fields_* members of res.blocks (index-aligned with setup.blocks). The block vectors are unpacked to the full excitation basis (via the little-group irrep projection on the point-image path, via the SA basis lift v = Uᴴ·u on the affine path); the fields are the scattered ones, valid in the background medium only. Throws std::runtime_error on failures of the per-eigenfrequency system snapshots.
| ResonanceContour qpms::resonance::resonance_effective_contour | ( | const qpms_scatspec_t * | spec, |
| const cart3_t & | k, | ||
| const qpms_simspec_resonances_t * | r | ||
| ) |
Derives the effective contour at the Bloch vector k.
The band contour sugar (has_band) is evaluated at k with the two-pass scheme (vacuum estimate, then the background index at the estimated centre); an explicit contour is carried verbatim. Throws std::runtime_error if the sugar cannot be derived at k.
| std::unique_ptr< ResonanceKSetup > qpms::resonance::resonance_setup_at_k | ( | const qpms_scatspec_t * | spec, |
| const cart3_t & | k, | ||
| const qpms_simspec_resonances_t * | r, | ||
| const ResonanceContour & | contour | ||
| ) |
Builds the scattering system + block structure at k (the little-group decomposition follows the mode_svd dispatch). Serial: the system build and the numerical decomposition are not guaranteed reentrant. Throws std::runtime_error on error.
| void qpms::resonance::resonance_solve_setup | ( | const ResonanceKSetup & | setup, |
| const cart3_t & | k, | ||
| const qpms_simspec_resonances_t * | r, | ||
| const ResonanceContour & | contour, | ||
| bool | verbose, | ||
| ResonanceKResult & | out | ||
| ) |
Runs the libnles solver per block of a prepared setup and appends one ResonanceBlockResult per block to out.blocks. May run concurrently for independent setups (the callback path is reentrant, cf. resonance_k.cpp); the setup must outlive the call. Throws std::runtime_error on hard failures; NLES_BUDGET_EXHAUSTED is tolerated per block (flagged in the result).
| void qpms::resonance::resonance_validate_solver | ( | const qpms_scatspec_t * | spec, |
| const qpms_simspec_resonances_t * | r | ||
| ) |
Validates the solver specification against the system; throws std::runtime_error on error (mutual exclusivity of the contour forms, periodic-only band sugar, band sugar vs recursive_beyn).
|
inline |
2pi-included reciprocal basis of the spec's lattice (throws on degenerate/unsupported lattices; xy-planar restriction for 2D).