![]() |
QPMS
Electromagnetic multiple scattering library and toolkit.
|
Plain-C ABI over the C++ resonance-solving layer (resonance_k.hpp), for the Cython bindings and other non-C++ hosts. More...


Go to the source code of this file.
Data Structures | |
| struct | qpms_resonance_contour_c_t |
| struct | qpms_resonance_block_c_t |
| One solved block (mirrors qpms::resonance::ResonanceBlockResult). More... | |
| struct | qpms_resonance_result_c_t |
| The per-k solve results over all blocks. More... | |
Typedefs | |
| typedef struct qpms_resonance_setup_t | qpms_resonance_setup_t |
| Opaque per-k setup handle (system + block structure). | |
Functions | |
| int | qpms_resonance_validate_c (const qpms_scatspec_t *spec, const qpms_simspec_resonances_t *r, char *errbuf, size_t errlen) |
| Validates the solver specification against the system. | |
| int | qpms_resonance_effective_contour_c (const qpms_scatspec_t *spec, const double k[3], const qpms_simspec_resonances_t *r, qpms_resonance_contour_c_t *out, char *errbuf, size_t errlen) |
| qpms_resonance_setup_t * | qpms_resonance_setup_at_k_c (const qpms_scatspec_t *spec, const double k[3], const qpms_simspec_resonances_t *r, const qpms_resonance_contour_c_t *contour, char *errbuf, size_t errlen) |
| Builds the scattering system + block structure at k. | |
| int | qpms_resonance_solve_c (const qpms_resonance_setup_t *setup, const double k[3], const qpms_simspec_resonances_t *r, _Bool verbose, qpms_resonance_result_c_t *out, char *errbuf, size_t errlen) |
| Runs the libnles solver per block of a prepared setup. | |
| void | qpms_resonance_result_free_c (qpms_resonance_result_c_t *out) |
| Frees a result returned by qpms_resonance_solve_c(). | |
| void | qpms_resonance_setup_free_c (qpms_resonance_setup_t *setup) |
| Frees a setup handle returned by qpms_resonance_setup_at_k_c(). | |
Plain-C ABI over the C++ resonance-solving layer (resonance_k.hpp), for the Cython bindings and other non-C++ hosts.
The solver specification is the plain POD struct qpms_simspec_resonances_t from simspec.h (the same struct the YAML parser fills); the Python layer fills it directly. All functions follow the errbuf/errlen convention (human-readable message, NULL / negative return on failure). All returned memory is owned by the caller unless noted otherwise.
| int qpms_resonance_effective_contour_c | ( | const qpms_scatspec_t * | spec, |
| const double | k[3], | ||
| const qpms_simspec_resonances_t * | r, | ||
| qpms_resonance_contour_c_t * | out, | ||
| char * | errbuf, | ||
| size_t | errlen | ||
| ) |
Derives the effective contour at the Bloch vector k (the band sugar evaluated; an explicit contour is carried verbatim).
| qpms_resonance_setup_t * qpms_resonance_setup_at_k_c | ( | const qpms_scatspec_t * | spec, |
| const double | k[3], | ||
| const qpms_simspec_resonances_t * | r, | ||
| const qpms_resonance_contour_c_t * | contour, | ||
| char * | errbuf, | ||
| size_t | errlen | ||
| ) |
Builds the scattering system + block structure at k.
contour is the effective contour from qpms_resonance_effective_contour_c(). Returns an opaque handle (free with qpms_resonance_setup_free_c()) or NULL on failure. Serial: not guaranteed reentrant.
| int qpms_resonance_solve_c | ( | const qpms_resonance_setup_t * | setup, |
| const double | k[3], | ||
| const qpms_simspec_resonances_t * | r, | ||
| _Bool | verbose, | ||
| qpms_resonance_result_c_t * | out, | ||
| char * | errbuf, | ||
| size_t | errlen | ||
| ) |
Runs the libnles solver per block of a prepared setup.
out receives the per-block results (free with qpms_resonance_result_free_c()). verbose mirrors the app runner's per-block progress prints. May run concurrently for independent setups.
| int qpms_resonance_validate_c | ( | const qpms_scatspec_t * | spec, |
| const qpms_simspec_resonances_t * | r, | ||
| char * | errbuf, | ||
| size_t | errlen | ||
| ) |
Validates the solver specification against the system.