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. The user-facing keys these options come from are
7 * documented in @ref p09_field_statistics_sec.
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. Each resolved definition is reported at `LOG_INFO` through
29 * `LOG_ALLOW`, so it carries the usual dual gate and is surfaced by allow-listing the
30 * emitting function. Whether statistics were active at all is recorded
31 * unconditionally by the startup banner.
32 *
33 * Leaves the context untouched when statistics are disabled or no window is
34 * configured, so a run that does not ask for statistics allocates nothing.
35 *
36 * Must run before `CreateAndInitializeAllVectors`, which sizes the per-window
37 * accumulators from the window count resolved here.
38 *
39 * @param[in,out] simCtx Simulation context to populate.
40 * @return Zero on success, or a PETSc error for a malformed or inconsistent
41 * configuration. Python validation rejects these earlier with better
42 * messages; these checks guard a hand-written control file.
43 */
44PetscErrorCode ParseFieldStatisticsConfig(SimCtx *simCtx);
45
46/**
47 * @brief Releases the window definitions resolved by ParseFieldStatisticsConfig().
48 * @param[in,out] simCtx Simulation context to clear; safe when nothing was resolved.
49 * @return Zero on success.
50 */
51PetscErrorCode DestroyFieldStatisticsConfig(SimCtx *simCtx);
52
53#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:866