|
|
static void | ssim_fail (ssim_ctx_t *c, const char *fmt,...) |
| |
|
static int | ssim_check (ssim_ctx_t *c) |
| |
|
static int | ssim_check_keys (ssim_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 | ssim_text (ssim_ctx_t *c, struct fy_node *n, const char *where, char *out, size_t outlen) |
| | Copies the (resolved) text of a scalar node.
|
| |
| static _Bool | ssim_rayleigh_token (const char *s) |
| |
| static void | ssim_fail_number (ssim_ctx_t *c, const char *where, const char *buf, const char *err) |
| |
|
static int | ssim_number_text (ssim_ctx_t *c, const char *buf, const char *where, _Complex double *out) |
| | Evaluates a numeric field text: plain number or specexpr expression.
|
| |
|
static int | ssim_number (ssim_ctx_t *c, struct fy_node *n, const char *where, _Complex double *out) |
| | Evaluates a numeric field: plain number or specexpr expression.
|
| |
| static int | ssim_install_rayleigh (ssim_ctx_t *c, const double bloch[3]) |
| |
|
static void | ssim_uninstall_rayleigh (ssim_ctx_t *c) |
| | Uninstalls the Rayleigh-expression hooks of the current experiment.
|
| |
|
static int | ssim_real (ssim_ctx_t *c, struct fy_node *n, const char *where, double *out) |
| | Evaluates a numeric field that must be real (imaginary part rejected).
|
| |
|
static int | ssim_int (ssim_ctx_t *c, struct fy_node *n, const char *where, long *out) |
| |
|
static int | ssim_positive_int (ssim_ctx_t *c, struct fy_node *n, const char *where, long *out) |
| |
|
static int | ssim_bool (ssim_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 | ssim_strdup_scalar (ssim_ctx_t *c, struct fy_node *n, const char *where, char **out) |
| | Duplicates a scalar node's text; fails on non-scalars and empty strings.
|
| |
|
static int | ssim_vec13 (ssim_ctx_t *c, struct fy_node *n, const char *where, double out[3]) |
| | Parses a sequence of 1-3 real numbers (missing components default to 0).
|
| |
|
static int | ssim_real_seq_fixed (ssim_ctx_t *c, struct fy_node *n, const char *where, double *out, int count) |
| | Parses a sequence of exactly count real numbers into out.
|
| |
|
static int | ssim_int_seq_fixed (ssim_ctx_t *c, struct fy_node *n, const char *where, long *out, int count) |
| | Parses a sequence of exactly count integers into out.
|
| |
|
static int | ssim_axis_segment_read (ssim_ctx_t *c, struct fy_node *n, const char *where, _Bool require_real, _Complex double *start, _Complex double *stop, _Complex double *step) |
| | Reads a {start, stop, step} mapping into the three complex values.
|
| |
| static long | ssim_axis_segment_count (ssim_ctx_t *c, const char *where, _Complex double start, _Complex double stop, _Complex double step) |
| |
| static _Bool | ssim_axis_vals_close (_Complex double a, _Complex double b) |
| |
| static int | ssim_axis (ssim_ctx_t *c, struct fy_node *n, const char *where, qpms_simspec_axis_t *out, _Bool require_real) |
| | Resolves one axis node (scalar | sequence | {start, stop, step} mapping).
|
| |
|
static void | ssim_axis_free (qpms_simspec_axis_t *a) |
| |
|
static void | ssim_tmatrix_free (qpms_simspec_tmatrix_t *e) |
| |
|
static void | ssim_cross_sections_free (qpms_simspec_cross_sections_t *e) |
| |
|
static void | ssim_driving_free (qpms_simspec_driving_t *e) |
| |
|
static void | ssim_resonances_free (qpms_simspec_resonances_t *e) |
| |
|
static void | ssim_experiment_free (qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_irreps (ssim_ctx_t *c, struct fy_node *n, const char *where, qpms_simspec_irreps_t *mode, char ***labels, size_t *nlabels) |
| | Parses the common irreps key ("all" | "full" | sequence of labels).
|
| |
|
static int | ssim_check_irreps_system (ssim_ctx_t *c, const qpms_simspec_irreps_t mode, const char *where) |
| | Validates the irreps selection against the parsed system half.
|
| |
|
static int | ssim_omega_forbidden (ssim_ctx_t *c, struct fy_node *node, const char *where) |
| | Rejects an omega axis for the kinds that do not use it (resonances).
|
| |
|
static int | ssim_omega_optional (ssim_ctx_t *c, struct fy_node *node, const char *where, qpms_simspec_axis_t *omega) |
| | Parses the common real omega axis; returns 0 if present, 1 if absent.
|
| |
|
static int | ssim_omega_single (ssim_ctx_t *c, struct fy_node *node, const char *where, qpms_simspec_axis_t *omega) |
| | Requires the omega axis to hold exactly one real value (driving).
|
| |
|
static int | ssim_parse_tmatrix (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_cross_sections (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_driving (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
| static int | ssim_contour_field (ssim_ctx_t *c, struct fy_node *n, const char *where, _Bool kdep_allowed, _Bool real_only, _Complex double *value, char **expr) |
| |
|
static int | ssim_parse_contour (ssim_ctx_t *c, struct fy_node *node, const char *where, qpms_simspec_resonances_t *r, _Bool kdep_allowed) |
| |
|
static int | ssim_solver_posreal (ssim_ctx_t *c, struct fy_node *opts, const char *key, const char *where, double *out) |
| | Parses one positive-real solver option; returns 1 if absent.
|
| |
|
static int | ssim_solver_nonneg (ssim_ctx_t *c, struct fy_node *opts, const char *key, const char *where, long *out) |
| | Parses one non-negative-long solver option; returns 1 if absent.
|
| |
| static int | ssim_parse_resonance_solver (ssim_ctx_t *c, struct fy_node *node, const char *kindname, qpms_simspec_resonances_t *r, _Bool kdep_allowed) |
| |
|
static int | ssim_parse_resonances (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_mode_svd (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_bandstructure_svd (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
| static int | ssim_resolve_kdep_at (const qpms_scatspec_t *spec, const qpms_specexpr_env_t *base_env, const qpms_simspec_resonances_t *r, cart3_t k, qpms_simspec_resonances_t *out, char *errbuf, size_t errlen) |
| |
| qpms_errno_t | qpms_simspec_resonances_resolve_kdep (const qpms_simspec_t *sim, const qpms_simspec_resonances_t *r, cart3_t k, qpms_simspec_resonances_t *out, char *errbuf, size_t errlen) |
| | Resolves the k-dependent contour expressions of a solver spec.
|
| |
|
static int | ssim_parse_bandstructure (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_transmission (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_experiment_t *e) |
| |
|
static int | ssim_parse_output (ssim_ctx_t *c, struct fy_node *node, qpms_simspec_output_t *out) |
| |
| static int | ssim_parse_vars (ssim_ctx_t *c, struct fy_node *node) |
| | Parses the file's vars section into the run-half environment.
|
| |
|
const char * | qpms_simspec_kind_name (qpms_simspec_kind_t kind) |
| | Name of an experiment kind ("tmatrix", ...), or NULL for invalid values.
|
| |
| void | qpms_simspec_free (qpms_simspec_t *s) |
| |
|
const qpms_scatspec_t * | qpms_simspec_system (const qpms_simspec_t *s) |
| | The system half of the spec (borrowed pointer; owned by the simspec).
|
| |
|
size_t | qpms_simspec_experiment_count (const qpms_simspec_t *s) |
| | Number of experiments.
|
| |
|
const qpms_simspec_experiment_t * | qpms_simspec_experiment (const qpms_simspec_t *s, size_t i) |
| | The i'th experiment (borrowed pointer), or NULL if i is out of range.
|
| |
|
const qpms_simspec_output_t * | qpms_simspec_output (const qpms_simspec_t *s) |
| | The global output policy (borrowed pointer; owned by the simspec).
|
| |
|
const char * | qpms_simspec_path (const qpms_simspec_t *s) |
| | The path the spec was parsed from (borrowed; NULL for parse_string()).
|
| |
|
static struct qpms_simspec_t * | ssim_parse_document (struct fy_document *doc, const char *path, const char *sys_yaml, ssize_t sys_yaml_len, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| |
|
static struct qpms_simspec_t * | ssim_parse_generic (int(*setup)(void *ud, struct fy_parser *fyp), void *ud, const char *display_path, const char *sys_yaml, ssize_t sys_yaml_len, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| |
|
static int | ssim_setup_file (void *ud, struct fy_parser *fyp) |
| |
|
static int | ssim_setup_string (void *ud, struct fy_parser *fyp) |
| |
| qpms_simspec_t * | qpms_simspec_parse_file (const char *path, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| | Parses and validates a simspec file (system half + run half).
|
| |
|
qpms_simspec_t * | qpms_simspec_parse_string (const char *yaml, ssize_t len, const qpms_scatspec_var_t *overrides, size_t noverrides, char *errbuf, size_t errlen) |
| | As qpms_simspec_parse_file(), but parses from a NUL-terminated string.
|
| |
| int | qpms_simspec_solver_fingerprint (const qpms_simspec_resonances_t *r, char hex[65]) |
| | Computes a SHA-256 fingerprint of the k-independent solver specification.
|
| |
Implementation of the simspec run-half loader (see simspec.h).
The parsing conventions mirror scatspec.c (context-based error reporting, strict unknown-key rejection, specexpr-evaluated numeric fields); the system half of the document is delegated to the scatspec parser.