|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
C unit tests for window lifecycle, scheduling, and weighting. More...
Go to the source code of this file.
Functions | |
| static PicurvWindowDefinition | StepWindow (const char *name, PetscReal start, PetscReal end, PetscBool bounded, PicurvWeighting weighting, PetscInt cadence) |
| Builds a step-cadence definition. | |
| static PetscErrorCode | RunUniform (PicurvWindow *w, PetscInt steps, PetscReal dt, PetscReal *total_weight, PetscInt *count) |
| Drives a uniform-dt sequence and returns the accumulated weight and count. | |
| static PetscErrorCode | TestWeightingsAgreeAtConstantTimestep (void) |
| The two weightings must agree on a constant-timestep run. | |
| static PetscErrorCode | TestOriginStateAnchorsWithoutSampling (void) |
| A state at the window origin anchors without becoming a sample. | |
| static PetscErrorCode | TestLateFirstObservationMovesOrigin (void) |
| A window first seen after its requested start moves its origin forward. | |
| static PetscErrorCode | TestVariableTimestepWeighting (void) |
| Variable timestep weighting follows the actual elapsed intervals. | |
| static PetscErrorCode | TestStrideAndOffScheduleNoOp (void) |
| Stride skips states, and the accepted weight still spans the whole gap. | |
| static PetscErrorCode | TestEndClippingAndCompletion (void) |
| A bounded window clips its final interval and then accepts nothing. | |
| static PetscErrorCode | TestDuplicateEventRejected (void) |
| The same completed step offered twice is counted once. | |
| static PetscErrorCode | TestTimeCadenceOvershootAcceptedOnce (void) |
| A step overshooting several time targets is accepted once, losing no time. | |
| static PetscErrorCode | TestInvalidDefinitionsRejected (void) |
| Invalid definitions are rejected at initialization. | |
| static PetscErrorCode | HashAndCompare (const PicurvWindowDefinition *baseline, const PicurvWindowDefinition *variant, PetscBool *same, PetscInt *first_difference) |
| Hashes a definition and reports which property group changed against a baseline. | |
| static PicurvWindowDefinition | HashWindow (void) |
| Builds the hash fixture: a Ucat/P window with a second moment and a covariance. | |
| static PetscErrorCode | TestHashExclusionsAndStability (void) |
| The hash is stable, and excludes exactly the properties the spec excludes. | |
| static PetscErrorCode | TestHashDetectsEachProperty (void) |
| Every hashed property changes the digest and is named by its group digest. | |
| static PetscErrorCode | SerializeGroupDigests (const PicurvWindowDefinition *definition, char *out, size_t out_size) |
| Serializes a definition's group digests the way a checkpoint records them. | |
| static PetscErrorCode | TestFirstHashDifferenceLocalization (void) |
| Saved group digests must localize a change to the property that caused it. | |
| int | main (int argc, char **argv) |
| Entry point for the window lifecycle suite. | |
C unit tests for window lifecycle, scheduling, and weighting.
Covers the Stage 3 acceptance items in Field Statistics Phase 2 Implementation Specification section 14: cadence stride, start and end clipping, variable timestep weighting, duplicate event rejection, off-schedule no-ops, and the property that sample and physical-time weighting agree on a constant-timestep run.
Definition in file test_statistics_window.c.
|
static |
Builds a step-cadence definition.
Definition at line 18 of file test_statistics_window.c.
|
static |
Drives a uniform-dt sequence and returns the accumulated weight and count.
Definition at line 31 of file test_statistics_window.c.
|
static |
The two weightings must agree on a constant-timestep run.
This is the property that fixed the initial-state rule: counting the state at the window origin under sample weighting alone would make the two disagree by O(1/N) for no physical reason.
Definition at line 52 of file test_statistics_window.c.
|
static |
A state at the window origin anchors without becoming a sample.
Definition at line 89 of file test_statistics_window.c.
|
static |
A window first seen after its requested start moves its origin forward.
Definition at line 120 of file test_statistics_window.c.
|
static |
Variable timestep weighting follows the actual elapsed intervals.
Definition at line 144 of file test_statistics_window.c.
|
static |
Stride skips states, and the accepted weight still spans the whole gap.
Definition at line 167 of file test_statistics_window.c.
|
static |
A bounded window clips its final interval and then accepts nothing.
Definition at line 198 of file test_statistics_window.c.
|
static |
The same completed step offered twice is counted once.
Definition at line 231 of file test_statistics_window.c.
|
static |
A step overshooting several time targets is accepted once, losing no time.
This is the self-correcting property of right-rectangle weighting: the accepted weight is the actual elapsed interval, not the nominal cadence, so skipped targets neither drop nor double-count represented time.
Definition at line 259 of file test_statistics_window.c.
|
static |
Invalid definitions are rejected at initialization.
Definition at line 296 of file test_statistics_window.c.
|
static |
Hashes a definition and reports which property group changed against a baseline.
Definition at line 327 of file test_statistics_window.c.
|
static |
Builds the hash fixture: a Ucat/P window with a second moment and a covariance.
Definition at line 350 of file test_statistics_window.c.
|
static |
The hash is stable, and excludes exactly the properties the spec excludes.
Definition at line 364 of file test_statistics_window.c.
|
static |
Every hashed property changes the digest and is named by its group digest.
Definition at line 400 of file test_statistics_window.c.
|
static |
Serializes a definition's group digests the way a checkpoint records them.
Definition at line 457 of file test_statistics_window.c.
|
static |
Saved group digests must localize a change to the property that caused it.
This is the only path that turns a refused continuation into an actionable message, and it is reachable at runtime only through a fatal error, so it is exercised directly here rather than through that path.
Definition at line 481 of file test_statistics_window.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Entry point for the window lifecycle suite.
Definition at line 532 of file test_statistics_window.c.