C unit tests for runtime, particle, wall, and walltime-guard helpers. More...
#include "test_support.h"#include "BC_Handlers.h"#include "ParticleMotion.h"#include "ParticlePhysics.h"#include "ParticleSwarm.h"#include "interpolation.h"#include "initialcondition.h"#include "les.h"#include "runloop.h"#include "setup.h"#include "wallfunction.h"#include "walkingsearch.h"Go to the source code of this file.
Functions | |
| static PetscErrorCode | SyncRuntimeFieldGhosts (UserCtx *user) |
| Synchronizes the minimal runtime fixture's global fields into their persistent local ghosts. | |
| static PetscErrorCode | SeedSingleParticle (UserCtx *user, PetscInt ci, PetscInt cj, PetscInt ck, PetscReal x, PetscReal y, PetscReal z, PetscReal wx, PetscReal wy, PetscReal wz, PetscInt status_value) |
| Seeds one localized swarm particle with the cell, position, weight, and status data used by runtime tests. | |
| static PetscErrorCode | TestDistributeParticlesRemainderHandling (void) |
| Tests particle distribution remainder handling across ranks. | |
| static PetscErrorCode | TestIsParticleInsideBoundingBoxBasicCases (void) |
| Tests basic particle-inside-bounding-box classification cases. | |
| static PetscErrorCode | TestUpdateParticleWeightsComputesExpectedRatios (void) |
| Tests particle weight updates against expected ratios. | |
| static PetscErrorCode | TestUpdateParticlePositionWithoutBrownianContribution (void) |
| Tests particle position updates without Brownian forcing. | |
| static PetscErrorCode | TestUpdateParticlePositionDiffusivityGradientOnly (void) |
| Tests particle position updates driven only by diffusivity-gradient drift. | |
| static PetscErrorCode | TestUpdateParticleFieldIEMRelaxation (void) |
| Tests IEM relaxation updates for particle-carried fields. | |
| static PetscErrorCode | TestSetInitialInteriorFieldIgnoresNonUcontRequest (void) |
| Tests that non-Ucont requests do not modify interior field initialization. | |
| static PetscErrorCode | TestSetInitialInteriorFieldCartesianConstantSetsContravariantFlux (void) |
| Tests cartesian Constant IC: Cart2Contra sets contravariant flux via metric dot product. | |
| static PetscErrorCode | TestSetInitialInteriorFieldCurvilinearConstantViaFlowDirection (void) |
| Tests curvilinear Constant IC: flow_direction selects the streamwise axis. | |
| static PetscErrorCode | TestSetInitialInteriorFieldZeroClearsInterior (void) |
| Tests zero IC clears physical-cell contravariant velocity. | |
| static PetscErrorCode | TestSetInitialInteriorFieldPoiseuilleProfile (void) |
| Tests Poiseuille IC is the product parabola that vanishes on the walls. | |
| static PetscErrorCode | TestSetInitialInteriorFieldPoiseuilleUniformAlongPeriodicAxis (void) |
| Tests Poiseuille IC is uniform along a periodic cross-stream axis. | |
| static PetscErrorCode | TestCart2ContraConvertsCartesianField (void) |
| Tests spatially varying Cartesian-field conversion to contravariant fluxes. | |
| static PetscErrorCode | TestCart2ContraUsesFinalizedPeriodicUcat (void) |
| Verifies periodic Ucat endpoints are repaired before Cart2Contra terminal faces. | |
| static PetscErrorCode | TestPopulateInitialUcontLoadsStagedUcat (void) |
| Tests loading a staged Ucat file IC and converting it to Ucont. | |
| static PetscErrorCode | TestWriteLESFieldsCopiesOwnedPeriodicValues (void) |
| Tests LES output staging from local vectors on a multiply periodic DMDA. | |
| static PetscErrorCode | StagedFourierModeMaxDivergence (UserCtx *user, PetscInt mode_x, PetscInt mode_y, PetscInt mode_z, Cmpnts amplitude, const char *tmpdir, PetscReal *max_divergence) |
| Stages a real Cartesian Fourier mode through the production file-IC path. | |
| static PetscErrorCode | TestStagedUcatFourierModesUsePicurvDiscreteSymbol (void) |
| Cross-checks selected exact Fourier modes against PICurv's native discrete symbol. | |
| static PetscErrorCode | TestPopulateInitialUcontLoadsStagedUcont (void) |
| Tests loading a staged Ucont file IC without Cartesian conversion. | |
| static PetscErrorCode | TestInterpolateAllFieldsToSwarmConstantFields (void) |
| Tests direct interpolation from Eulerian fields to one localized swarm particle. | |
| static PetscErrorCode | TestInterpolateAllFieldsToSwarmCornerAveragedConstantFields (void) |
| Tests the corner-averaged (legacy) interpolation path on constant fields. | |
| static PetscErrorCode | TestScatterAllParticleFieldsToEulerFieldsAveragesPsi (void) |
| Tests particle-to-grid scattering using known cell occupancy and scalar values. | |
| static PetscErrorCode | TestCalculateParticleCountPerCellCountsGlobalCellIDs (void) |
| Tests particle counting by geometric cell IDs using the production +1 storage shift. | |
| static PetscErrorCode | TestResetAllParticleStatusesLeavesLostParticlesUntouched (void) |
| Tests localized particle-status reset behavior for restart of the location workflow. | |
| static PetscErrorCode | TestCheckAndRemoveOutOfBoundsParticlesRemovesEscapedParticle (void) |
| Tests direct removal of particles that leave every rank bounding box. | |
| static PetscErrorCode | TestCheckAndRemoveLostParticlesRemovesLostEntries (void) |
| Tests direct removal of particles already marked LOST by the location workflow. | |
| static PetscErrorCode | TestCalculateBrownianDisplacementDeterministicSeed (void) |
| Tests Brownian displacement generation against a duplicated seeded RNG stream. | |
| static PetscErrorCode | TestUpdateAllParticlePositionsMovesSwarmEntries (void) |
| Tests swarm-wide particle position updates using the same transport path as the runtime loop. | |
| static PetscErrorCode | TestLocateAllParticlesInGridPriorCellFastPath (void) |
| Tests the location orchestrator fast path when a particle already carries a valid prior cell. | |
| static PetscErrorCode | TestLocateAllParticlesInGridGuessPathResolvesLocalParticle (void) |
| Tests the guess-then-verify orchestrator path for a local particle with an unknown prior cell. | |
| static PetscErrorCode | TestLocateParticleOrFindMigrationTargetCountsReSearch (void) |
| Verifies that later settlement passes increment re-search metrics. | |
| static PetscErrorCode | TestWallNoSlipAndFreeSlipHelpers (void) |
| Tests no-slip and free-slip wall helper kernels. | |
| static PetscErrorCode | TestWallModelScalarHelpers (void) |
| Tests wall-model scalar helper kernels. | |
| static PetscErrorCode | TestWallModelVelocityHelpers (void) |
| Tests closed-form and iterative wall-model velocity helpers against inverse reconstructions. | |
| static PetscErrorCode | TestWallFunctionVectorWrappers (void) |
| Tests the vector wall-function wrappers on a tangential reference flow. | |
| static PetscErrorCode | TestValidateDrivenFlowConfigurationNoDrivenHandlers (void) |
| Tests driven-flow validation when no driven handlers are present. | |
| static PetscErrorCode | TestMinimalFixtureMirrorsProductionDMLayout (void) |
| Tests that the shared minimal fixture mirrors the production DA contract. | |
| static PetscErrorCode | TestMinimalFixtureRegistersProductionSwarmFields (void) |
| Tests that the shared swarm fixture registers the production field set. | |
| static PetscErrorCode | TestUpdateSolverHistoryVectorsShiftsStates (void) |
| Tests solver history-vector shifting between time levels. | |
| static PetscErrorCode | TestGetOwnedCellRangeSingleRankAccounting (void) |
| Tests owned-cell range accounting on a single MPI rank. | |
| static PetscErrorCode | TestComputeAndStoreNeighborRanksSingleRank (void) |
| Tests neighbor-rank discovery on a single MPI rank. | |
| static PetscErrorCode | TestRuntimeWalltimeGuardParsesPositiveSeconds (void) |
| Tests parsing of positive runtime walltime metadata values. | |
| static PetscErrorCode | TestRuntimeWalltimeGuardEstimatorHelpers (void) |
| Tests walltime-guard estimator helper calculations. | |
| static PetscErrorCode | TestRuntimeWalltimeGuardTriggerDecision (void) |
| Tests runtime walltime-guard shutdown trigger decisions. | |
| int | main (int argc, char **argv) |
| Runs the unit-runtime PETSc test binary. | |
C unit tests for runtime, particle, wall, and walltime-guard helpers.
Definition in file test_runtime_kernels.c.
|
static |
Synchronizes the minimal runtime fixture's global fields into their persistent local ghosts.
Definition at line 23 of file test_runtime_kernels.c.
|
static |
Seeds one localized swarm particle with the cell, position, weight, and status data used by runtime tests.
Definition at line 44 of file test_runtime_kernels.c.
|
static |
Tests particle distribution remainder handling across ranks.
Definition at line 88 of file test_runtime_kernels.c.
|
static |
Tests basic particle-inside-bounding-box classification cases.
Definition at line 107 of file test_runtime_kernels.c.
|
static |
Tests particle weight updates against expected ratios.
Definition at line 136 of file test_runtime_kernels.c.
|
static |
Tests particle position updates without Brownian forcing.
Definition at line 159 of file test_runtime_kernels.c.
|
static |
Tests particle position updates driven only by diffusivity-gradient drift.
Definition at line 193 of file test_runtime_kernels.c.
|
static |
Tests IEM relaxation updates for particle-carried fields.
Definition at line 227 of file test_runtime_kernels.c.
|
static |
Tests that non-Ucont requests do not modify interior field initialization.
Definition at line 253 of file test_runtime_kernels.c.
|
static |
Tests cartesian Constant IC: Cart2Contra sets contravariant flux via metric dot product.
The minimal runtime fixture uses identity face metrics. UniformCart2Contra therefore maps (u,v,w)=(0,0,2) directly to a Zeta flux of 2.
Definition at line 274 of file test_runtime_kernels.c.
|
static |
Tests curvilinear Constant IC: flow_direction selects the streamwise axis.
icVelocityPhysical=2.0, FLOW_DIR_POS_ZETA. The minimal runtime fixture uses identity face metrics, so ucont.z = 2.0. Xi and Eta components are left at zero regardless of InitialConstantContra.
Definition at line 306 of file test_runtime_kernels.c.
|
static |
Tests zero IC clears physical-cell contravariant velocity.
Definition at line 338 of file test_runtime_kernels.c.
|
static |
Tests Poiseuille IC is the product parabola that vanishes on the walls.
Four cells per cross-stream axis: cell centres sit at logical 0.5..3.5 with the walls at 0 and 4, so the normalized coordinate is -0.75, -0.25, 0.25, 0.75.
Definition at line 365 of file test_runtime_kernels.c.
|
static |
Tests Poiseuille IC is uniform along a periodic cross-stream axis.
A channel periodic in i has walls only in j, so its start is the exact one-dimensional parabola in j.
Definition at line 398 of file test_runtime_kernels.c.
|
static |
Tests spatially varying Cartesian-field conversion to contravariant fluxes.
Definition at line 430 of file test_runtime_kernels.c.
|
static |
Verifies periodic Ucat endpoints are repaired before Cart2Contra terminal faces.
Definition at line 462 of file test_runtime_kernels.c.
|
static |
Tests loading a staged Ucat file IC and converting it to Ucont.
Definition at line 492 of file test_runtime_kernels.c.
|
static |
Tests LES output staging from local vectors on a multiply periodic DMDA.
Definition at line 527 of file test_runtime_kernels.c.
|
static |
Stages a real Cartesian Fourier mode through the production file-IC path.
The returned maximum is the native face-interpolation/backward-difference divergence. On the uniform periodic fixture its symbol is (sin(theta_x), sin(theta_y), sin(theta_z)).
Definition at line 572 of file test_runtime_kernels.c.
|
static |
Cross-checks selected exact Fourier modes against PICurv's native discrete symbol.
Definition at line 630 of file test_runtime_kernels.c.
|
static |
Tests loading a staged Ucont file IC without Cartesian conversion.
Definition at line 676 of file test_runtime_kernels.c.
|
static |
Tests direct interpolation from Eulerian fields to one localized swarm particle.
Definition at line 706 of file test_runtime_kernels.c.
|
static |
Tests the corner-averaged (legacy) interpolation path on constant fields.
Definition at line 758 of file test_runtime_kernels.c.
|
static |
Tests particle-to-grid scattering using known cell occupancy and scalar values.
Definition at line 811 of file test_runtime_kernels.c.
|
static |
Tests particle counting by geometric cell IDs using the production +1 storage shift.
Definition at line 846 of file test_runtime_kernels.c.
|
static |
Tests localized particle-status reset behavior for restart of the location workflow.
Definition at line 877 of file test_runtime_kernels.c.
|
static |
Tests direct removal of particles that leave every rank bounding box.
Definition at line 908 of file test_runtime_kernels.c.
|
static |
Tests direct removal of particles already marked LOST by the location workflow.
Definition at line 939 of file test_runtime_kernels.c.
|
static |
Tests Brownian displacement generation against a duplicated seeded RNG stream.
Definition at line 979 of file test_runtime_kernels.c.
|
static |
Tests swarm-wide particle position updates using the same transport path as the runtime loop.
Definition at line 1012 of file test_runtime_kernels.c.
|
static |
Tests the location orchestrator fast path when a particle already carries a valid prior cell.
Definition at line 1077 of file test_runtime_kernels.c.
|
static |
Tests the guess-then-verify orchestrator path for a local particle with an unknown prior cell.
Definition at line 1135 of file test_runtime_kernels.c.
|
static |
Verifies that later settlement passes increment re-search metrics.
Definition at line 1193 of file test_runtime_kernels.c.
|
static |
Tests no-slip and free-slip wall helper kernels.
Definition at line 1234 of file test_runtime_kernels.c.
|
static |
Tests wall-model scalar helper kernels.
Definition at line 1257 of file test_runtime_kernels.c.
|
static |
Tests closed-form and iterative wall-model velocity helpers against inverse reconstructions.
Definition at line 1281 of file test_runtime_kernels.c.
|
static |
Tests the vector wall-function wrappers on a tangential reference flow.
Definition at line 1370 of file test_runtime_kernels.c.
|
static |
Tests driven-flow validation when no driven handlers are present.
Definition at line 1422 of file test_runtime_kernels.c.
|
static |
Tests that the shared minimal fixture mirrors the production DA contract.
Definition at line 1437 of file test_runtime_kernels.c.
|
static |
Tests that the shared swarm fixture registers the production field set.
Definition at line 1466 of file test_runtime_kernels.c.
|
static |
Tests solver history-vector shifting between time levels.
Definition at line 1517 of file test_runtime_kernels.c.
|
static |
Tests owned-cell range accounting on a single MPI rank.
Definition at line 1549 of file test_runtime_kernels.c.
|
static |
Tests neighbor-rank discovery on a single MPI rank.
Definition at line 1577 of file test_runtime_kernels.c.
|
static |
Tests parsing of positive runtime walltime metadata values.
Definition at line 1600 of file test_runtime_kernels.c.
|
static |
Tests walltime-guard estimator helper calculations.
Definition at line 1617 of file test_runtime_kernels.c.
|
static |
Tests runtime walltime-guard shutdown trigger decisions.
Definition at line 1643 of file test_runtime_kernels.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Runs the unit-runtime PETSc test binary.
Definition at line 1665 of file test_runtime_kernels.c.