|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Window lifecycle, scheduling, and weighting for the field-statistics pipeline. More...
#include "statistics_window.h"#include "variables.h"#include "logging.h"#include "statistics_accumulator.h"#include "field_catalog.h"#include "checksum.h"Go to the source code of this file.
Macros | |
| #define | WINDOW_TIME_EPSILON 1.0e-12 |
| Tolerance for treating two physical times as the same instant. | |
Functions | |
| const char * | PicurvWindowStateName (PicurvWindowState state) |
| Implementation of PicurvWindowStateName(). | |
| PetscErrorCode | PicurvWindowInit (PicurvWindow *window, const PicurvWindowDefinition *definition) |
| Implementation of PicurvWindowInit(). | |
| static PetscBool | WindowStateIsDue (const PicurvWindow *window, PetscInt step, PetscReal time) |
| Internal helper: reports whether a state is due under the window's schedule. | |
| static void | WindowAdvanceTimeTarget (PicurvWindow *window, PetscReal time) |
| Internal helper: advances the time-cadence target past the accepted time. | |
| PetscErrorCode | PicurvWindowOfferState (PicurvWindow *window, PetscInt step, PetscReal time, PetscBool *accepted, PetscReal *weight) |
| Implementation of PicurvWindowOfferState(). | |
| const char * | PicurvWindowHashGroupName (PetscInt group) |
| Implementation of PicurvWindowHashGroupName(). | |
| static void | SortRequestOrder (PetscInt count, const PetscInt *primary, const PetscInt *secondary, PetscInt *order) |
| Internal helper: orders request indices so listing order cannot change the hash. | |
| PetscErrorCode | PicurvWindowComputeHash (const PicurvWindowDefinition *definition, char digest_hex[65], char group_digest_hex[][PICURV_WINDOW_HASH_GROUP_LENGTH]) |
| Implementation of PicurvWindowComputeHash(). | |
| PetscErrorCode | PicurvWindowFirstHashDifference (const PicurvWindowDefinition *definition, const char *saved_group_digests, PetscInt *group) |
| Implementation of PicurvWindowFirstHashDifference(). | |
| PetscReal | PicurvWindowProgress (const PicurvWindow *window) |
| Implementation of PicurvWindowProgress(). | |
| PetscBool | FieldStatisticsIsActive (const SimCtx *simCtx) |
| Implementation of FieldStatisticsIsActive(). | |
| PetscErrorCode | FieldStatisticsUpdateWindows (SimCtx *simCtx, PetscInt step, PetscReal time) |
| Implementation of FieldStatisticsUpdateWindows(). | |
Variables | |
| static const char *const | kHashGroupNames [PICURV_WINDOW_HASH_GROUP_COUNT] |
| Stable names of the hashed property groups, in serialization order. | |
Window lifecycle, scheduling, and weighting for the field-statistics pipeline.
Full API contract is documented with the declarations in include/statistics_window.h.
Definition in file statistics_window.c.
| #define WINDOW_TIME_EPSILON 1.0e-12 |
Tolerance for treating two physical times as the same instant.
Definition at line 17 of file statistics_window.c.
| const char * PicurvWindowStateName | ( | PicurvWindowState | state | ) |
Implementation of PicurvWindowStateName().
Returns a stable human-readable name for a window state.
Definition at line 23 of file statistics_window.c.
| PetscErrorCode PicurvWindowInit | ( | PicurvWindow * | window, |
| const PicurvWindowDefinition * | definition | ||
| ) |
Implementation of PicurvWindowInit().
Validates a definition and initializes a window to the pending state.
Definition at line 37 of file statistics_window.c.
|
static |
Internal helper: reports whether a state is due under the window's schedule.
Local to this translation unit. Advances no state.
Definition at line 76 of file statistics_window.c.
|
static |
Internal helper: advances the time-cadence target past the accepted time.
Local to this translation unit. A single large step may overshoot several targets; they are consumed at once, because the accepted state's weight is the actual elapsed interval and so already accounts for the whole span.
Definition at line 99 of file statistics_window.c.
| PetscErrorCode PicurvWindowOfferState | ( | PicurvWindow * | window, |
| PetscInt | step, | ||
| PetscReal | time, | ||
| PetscBool * | accepted, | ||
| PetscReal * | weight | ||
| ) |
Implementation of PicurvWindowOfferState().
Offers one completed state to a window and reports the decision.
Definition at line 113 of file statistics_window.c.
| const char * PicurvWindowHashGroupName | ( | PetscInt | group | ) |
Implementation of PicurvWindowHashGroupName().
Returns the stable name of one hashed property group.
Definition at line 193 of file statistics_window.c.
|
static |
Internal helper: orders request indices so listing order cannot change the hash.
Local to this translation unit. Insertion sort over at most PICURV_WINDOW_MAX_REQUESTS entries, keyed on a primary and secondary integer so the same routine serves both fields and covariance pairs.
Definition at line 205 of file statistics_window.c.
| PetscErrorCode PicurvWindowComputeHash | ( | const PicurvWindowDefinition * | definition, |
| char | digest_hex[65], | ||
| char | group_digest_hex[][PICURV_WINDOW_HASH_GROUP_LENGTH] | ||
| ) |
Implementation of PicurvWindowComputeHash().
Definition at line 228 of file statistics_window.c.
| PetscErrorCode PicurvWindowFirstHashDifference | ( | const PicurvWindowDefinition * | definition, |
| const char * | saved_group_digests, | ||
| PetscInt * | group | ||
| ) |
Implementation of PicurvWindowFirstHashDifference().
Reports which hashed property group first differs from saved group digests.
Definition at line 366 of file statistics_window.c.
| PetscReal PicurvWindowProgress | ( | const PicurvWindow * | window | ) |
Implementation of PicurvWindowProgress().
Reports the fraction of a bounded window's span that has been represented.
Definition at line 406 of file statistics_window.c.
| PetscBool FieldStatisticsIsActive | ( | const SimCtx * | simCtx | ) |
Implementation of FieldStatisticsIsActive().
Definition at line 420 of file statistics_window.c.
| PetscErrorCode FieldStatisticsUpdateWindows | ( | SimCtx * | simCtx, |
| PetscInt | step, | ||
| PetscReal | time | ||
| ) |
Implementation of FieldStatisticsUpdateWindows().
Offers one completed state to every configured window.
Definition at line 431 of file statistics_window.c.
|
static |
Stable names of the hashed property groups, in serialization order.
Definition at line 185 of file statistics_window.c.