|
|
static void | sspec_free_bspec (void *ptr) |
| |
|
static void | sspec_free_scuff_interp (void *ptr) |
| |
|
static void | sspec_free_spg_detection (void *ptr) |
| |
|
static int | sspec_own (struct qpms_scatspec_t *spec, void *ptr, void(*dtor)(void *)) |
| | Registers an owned resource; returns -1 (without taking ownership) on error.
|
| |
|
void | qpms_scatspec_free (qpms_scatspec_t *spec) |
| | Frees a spec. Any qpms_scatsys_t built from it becomes invalid afterwards.
|
| |
|
static void | ssf_fail (sspec_ctx_t *c, const char *fmt,...) |
| |
|
static int | ssf_check (sspec_ctx_t *c) |
| |
|
static int | ssf_check_keys (sspec_ctx_t *c, struct fy_node *map, const char *where, const char *const *allowed) |
| | Rejects mapping keys outside the allowed set (typo protection).
|
| |
|
static int | ssf_text (sspec_ctx_t *c, struct fy_node *n, const char *where, char *out, size_t outlen) |
| | Copies the (resolved) text of a scalar node.
|
| |
| static char * | ssf_material_describe (struct fy_node *n) |
| | Renders a material node "as given" into a newly allocated string.
|
| |
|
static int | ssf_number (sspec_ctx_t *c, struct fy_node *n, const char *where, _Complex double *out) |
| | Evaluates a numeric field: plain number or specexpr expression.
|
| |
|
static int | ssf_int (sspec_ctx_t *c, struct fy_node *n, const char *where, long *out) |
| |
|
static int | ssf_positive_int (sspec_ctx_t *c, struct fy_node *n, const char *where, long *out) |
| |
| static int | ssf_key_alias (struct fy_node *node, const char *key, const char *alias, struct fy_node **out) |
| | Looks up a shape parameter key with an alternative spelling.
|
| |
|
static int | ssf_bool (sspec_ctx_t *c, struct fy_node *n, const char *where, _Bool *out) |
| | Parses a boolean field; YAML 1.2 booleans ("true"/"false") accepted.
|
| |
|
static int | ssf_vec3 (sspec_ctx_t *c, struct fy_node *n, const char *where, cart3_t *out) |
| | Parses a vector of 2 or 3 numbers (2 -> z = 0).
|
| |
|
static int | ssf_const_refindex (sspec_ctx_t *c, _Complex double n, const char *where, qpms_epsmu_generator_t *out) |
| | Creates a constant epsmu generator with eps = n*n, mu = 1.
|
| |
|
static int | ssf_yaml_material (sspec_ctx_t *c, const char *path, const char *where, qpms_epsmu_generator_t *out) |
| | Creates an interpolator-based generator from a refractiveindex.info yml file.
|
| |
|
static int | ssf_ld_material (sspec_ctx_t *c, const char *name, const char *where, qpms_epsmu_generator_t *out) |
| |
|
static int | ssf_material_node (sspec_ctx_t *c, struct fy_node *n, const char *where, qpms_epsmu_generator_t *out) |
| |
|
static int | ssf_material_by_name (sspec_ctx_t *c, const char *name, const char *where, qpms_epsmu_generator_t *out) |
| | Resolves a material by name: named table entry, LD model, or yml file.
|
| |
| static int | ssf_layers_node (sspec_ctx_t *c, struct fy_node *n, struct qpms_scatspec_t *spec) |
| | Parse system.layers: a sequence of per-layer mappings (bottom to top).
|
| |
|
static qpms_vswf_set_spec_t * | sspec_bs_ball (struct qpms_scatspec_t *spec, long lMax) |
| |
| static int | ssf_parse_kind_constant (sspec_ctx_t *c, sspec_kind_t *k, struct fy_node *node, const char *where) |
| |
|
static _Bool | ssf_shape_is_scuffgen (const char *shapename) |
| | Tells whether the shape name belongs to the scuffgen-only kinds.
|
| |
|
static int | ssf_pos_dim (sspec_ctx_t *c, struct fy_node *n, const char *name, const char *where, double *out) |
| | Parses a strictly positive real dimension.
|
| |
|
static int | ssf_nonneg_dim (sspec_ctx_t *c, struct fy_node *n, const char *name, const char *where, double *out) |
| | Parses a non-negative real dimension.
|
| |
|
static int | ssf_parse_kind (sspec_ctx_t *c, struct fy_node *node, const char *name, const char *where) |
| | Parses a single particle kind definition (a mapping node).
|
| |
|
static int | ssf_rotate (sspec_ctx_t *c, struct fy_node *node, const char *where, _Bool *has, qpms_irot3_t *out) |
| | Parses a rotation: {axis: [...], angle: ...} or a shorthand {x|y|z: angle}.
|
| |
|
static int | ssf_mirror (sspec_ctx_t *c, struct fy_node *node, const char *where, _Bool *has, qpms_irot3_t *out) |
| | Parses a mirror: "xy" (primitive z-flip), "xz", "yz", or true (= "xy").
|
| |
|
static int | sspec_transform_is_identity (qpms_irot3_t tr) |
| | Returns true if tr is (numerically) the identity transform.
|
| |
|
static int | sspec_add_particle (sspec_ctx_t *c, cart3_t pos, size_t kind, qpms_irot3_t tr) |
| |
|
static int | ssf_place_particle_ref (sspec_ctx_t *c, struct fy_node *node, const char *where, size_t *kind) |
| | Resolves the 'particle' field: either a kind name or an inline definition.
|
| |
|
static int | ssf_place_array (sspec_ctx_t *c, struct fy_node *node, const char *where, size_t kind, qpms_irot3_t tr) |
| | Expands an 'array' placement into particles.
|
| |
|
static int | ssf_parse_place (sspec_ctx_t *c, struct fy_node *node, const char *where) |
| | Parses and expands a single element of the 'places' sequence.
|
| |
|
static int | ssf_parse_lattice (sspec_ctx_t *c, struct fy_node *node, const char *where) |
| | Parses the 'lattice' field; sets lattice_dimension and lattice_basis.
|
| |
|
static struct qpms_scatspec_t * | sspec_parse_document (struct fy_document *doc, const char *path, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| |
|
static struct qpms_scatspec_t * | sspec_parse_generic (int(*setup)(void *ud, struct fy_parser *fyp), void *ud, const char *display_path, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| |
|
static int | sspec_setup_file (void *ud, struct fy_parser *fyp) |
| |
|
static int | sspec_setup_string (void *ud, struct fy_parser *fyp) |
| |
| qpms_scatspec_t * | qpms_scatspec_parse_file (const char *path, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| | Parses and validates a spec file.
|
| |
| qpms_scatspec_t * | qpms_scatspec_parse_string (const char *yaml, ssize_t len, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| | As qpms_scatspec_parse_file(), but parses from a NUL-terminated string.
|
| |
|
static int | sspec_parse_vars (sspec_ctx_t *c, struct fy_node *node) |
| |
| static int | ssf_fp_epsmu_gen (qpms_canonbuf_t *b, const char *tag, const qpms_epsmu_generator_t *g) |
| | Serialises an optical-property generator into the canonical stream.
|
| |
|
size_t | qpms_scatspec_particle_count (const qpms_scatspec_t *spec) |
| | Number of particles after the placement expansion.
|
| |
| void | qpms_scatspec_positions (const qpms_scatspec_t *spec, cart3_t *out) |
| |
|
size_t | qpms_scatspec_kind_count (const qpms_scatspec_t *spec) |
| | Number of particle kinds defined in the spec.
|
| |
|
const char * | qpms_scatspec_kind_name (const qpms_scatspec_t *spec, size_t ki) |
| | Name of a particle kind, or NULL if ki is out of range (borrowed pointer).
|
| |
|
int | qpms_scatspec_kind_source (const qpms_scatspec_t *spec, size_t ki) |
| | T-matrix source kind of a particle kind, or -1 if ki is out of range.
|
| |
| const char * | qpms_scatspec_kind_file (const qpms_scatspec_t *spec, size_t ki) |
| |
| _Bool | qpms_scatspec_kind_shapeinfo (const qpms_scatspec_t *spec, size_t ki, qpms_scatspec_shapeinfo_t *out) |
| |
| const qpms_vswf_set_spec_t * | qpms_scatspec_kind_bspec (const qpms_scatspec_t *spec, size_t ki) |
| |
| void | qpms_scatspec_particle_kinds (const qpms_scatspec_t *spec, size_t *out) |
| |
| void | qpms_scatspec_particle_transforms (const qpms_scatspec_t *spec, qpms_irot3_t *out) |
| |
|
qpms_epsmu_t | qpms_scatspec_medium_eval (const qpms_scatspec_t *spec, _Complex double omega) |
| | Evaluates the background medium (system.medium) at an angular frequency.
|
| |
|
int | qpms_scatspec_lattice_dimension (const qpms_scatspec_t *spec) |
| | Lattice dimension (0 = finite system, 1-3 = periodic).
|
| |
|
void | qpms_scatspec_lattice_basis (const qpms_scatspec_t *spec, cart3_t *out) |
| | Copies the lattice basis vectors to out (which must have room for 3).
|
| |
| const qpms_finite_group_t * | qpms_scatspec_symmetry (const qpms_scatspec_t *spec) |
| |
|
const qpms_spg_detection_t * | qpms_scatspec_detection (const qpms_scatspec_t *spec) |
| |
|
int | qpms_scatspec_has_omega (const qpms_scatspec_t *spec) |
| | Returns whether the spec defines the initial frequency (system.omega).
|
| |
| _Complex double | qpms_scatspec_omega (const qpms_scatspec_t *spec) |
| |
| static int | sspec_proto_from_spec (const qpms_scatspec_t *spec, qpms_scatsys_t *orig, size_t *p_tmi, sspec_tmkey_t *tmkeys) |
| |
| qpms_scatsys_t * | qpms_scatspec_build_scatsys (const qpms_scatspec_t *spec, _Complex double omega) |
| | Builds a scattering system from the spec.
|
| |
| qpms_scatsys_t * | qpms_scatspec_build_scatsys_with_group (const qpms_scatspec_t *spec, const qpms_finite_group_t *group, _Complex double omega) |
| |
|
static int | ssf_fp_bspec (qpms_canonbuf_t *b, const qpms_vswf_set_spec_t *bs) |
| | Serialises a VSWF basis specification into the canonical stream.
|
| |
| static int | ssf_fp_kind (qpms_canonbuf_t *b, const sspec_kind_t *k) |
| |
| static int | ssf_fp_irot3 (qpms_canonbuf_t *b, qpms_irot3_t t) |
| |
| int | qpms_scatspec_system_fingerprint (const qpms_scatspec_t *spec, char hex[65]) |
| | Computes a SHA-256 fingerprint of the resolved physical system.
|
| |