PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
Loading...
Searching...
No Matches
statistics_config.h
Go to the documentation of this file.
1/**
2 * @file statistics_config.h
3 * @brief Control ingress for the field-statistics pipeline.
4 *
5 * Resolves the generated master `control` into the window definitions the rest of
6 * the pipeline consumes, per
7 * @ref 60_Field_Statistics_Phase2_Implementation_Specification section 8.
8 *
9 * A window list is variable arity, so its option names are constructed rather than
10 * literal. Every constructed name belongs to a family declared in the ingress audit
11 * manifest, which is what keeps the audit's guarantee intact rather than opening a
12 * hole in it.
13 *
14 * This module owns only configuration. It creates no PETSc vectors: the accumulator
15 * factory runs later and sizes itself from the definitions resolved here.
16 */
17
18#ifndef PICURV_STATISTICS_CONFIG_H
19#define PICURV_STATISTICS_CONFIG_H
20
21#include "variables.h"
22
23/**
24 * @brief Resolves field-statistics configuration from the control file.
25 *
26 * Reads the option families, resolves every field name through the typed catalog,
27 * validates each definition through `PicurvWindowInit`, and stores the resulting
28 * windows on the context. Reports every resolved definition at `LOG_INFO` so a run's
29 * log records exactly what was accumulated.
30 *
31 * Leaves the context untouched when statistics are disabled or no window is
32 * configured, so a run that does not ask for statistics allocates nothing.
33 *
34 * Must run before `CreateAndInitializeAllVectors`, which sizes the per-window
35 * accumulators from the window count resolved here.
36 *
37 * @param[in,out] simCtx Simulation context to populate.
38 * @return Zero on success, or a PETSc error for a malformed or inconsistent
39 * configuration. Python validation rejects these earlier with better
40 * messages; these checks guard a hand-written control file.
41 */
42PetscErrorCode ParseFieldStatisticsConfig(SimCtx *simCtx);
43
44/**
45 * @brief Releases the window definitions resolved by ParseFieldStatisticsConfig().
46 * @param[in,out] simCtx Simulation context to clear; safe when nothing was resolved.
47 * @return Zero on success.
48 */
49PetscErrorCode DestroyFieldStatisticsConfig(SimCtx *simCtx);
50
51#endif /* PICURV_STATISTICS_CONFIG_H */
PetscErrorCode DestroyFieldStatisticsConfig(SimCtx *simCtx)
Releases the window definitions resolved by ParseFieldStatisticsConfig().
PetscErrorCode ParseFieldStatisticsConfig(SimCtx *simCtx)
Resolves field-statistics configuration from the control file.
Main header file for a complex fluid dynamics solver.
The master context for the entire simulation.
Definition variables.h:695