C unit tests for particle walking-search helpers and the initial-value expression engine. More...
#include "test_support.h"#include "Metric.h"#include "walkingsearch.h"#include "ParticleInitialConditions.h"#include <stdio.h>#include <stdlib.h>#include <string.h>Go to the source code of this file.
Functions | |
| static PetscErrorCode | TestCheckCellWithinLocalGrid (void) |
| Tests whether a cell index lies within the local grid ownership range. | |
| static PetscErrorCode | TestInitializeTraversalParameters (void) |
| Tests initialization of traversal parameters for particle search. | |
| static PetscErrorCode | TestRetrieveCurrentCell (void) |
| Tests retrieval of the current cell from logical particle coordinates. | |
| static void | BuildShearedUnitCell (PetscReal shear, Cell *cell) |
Fills a cell with the unit cube's vertices in walking-search order, x sheared by shear * z. | |
| static PetscErrorCode | TestReflectParticleAcrossCellFace (void) |
| Tests the face mirror on a flat face, a sheared face, and a two-face corner. | |
| static PetscErrorCode | TestPlaceParticleInsideCell (void) |
| Tests that the reflection-cap fallback places a far-outside point just inside the cell. | |
| static PetscErrorCode | TestExpressionConformance (void) |
| Tests the runtime evaluator against every shared conformance case. | |
| static PetscErrorCode | TestExpressionSpecialFunctions (void) |
| Tests the Bessel and Kelvin functions against 30-digit references from their series, and that a non-integer Bessel order gives NaN. | |
| static PetscErrorCode | TestExpressionClosedFormProfiles (void) |
| Tests the documented closed-form sources. | |
| static PetscErrorCode | TestExpressionRejectsOutsideLanguage (void) |
| Tests that the compiler refuses what the Python validator also refuses. | |
| static PetscErrorCode | TestExpressionDrawsArePureAndKeyed (void) |
| Tests that random draws are pure functions of their key. | |
| int | main (int argc, char **argv) |
| Runs the unit-particles PETSc test binary. | |
Variables | |
| static const char *const | kConformanceNames [] = {"x", "y", "z"} |
C unit tests for particle walking-search helpers and the initial-value expression engine.
Definition in file test_particle_kernels.c.
|
static |
Tests whether a cell index lies within the local grid ownership range.
Definition at line 19 of file test_particle_kernels.c.
|
static |
Tests initialization of traversal parameters for particle search.
Definition at line 41 of file test_particle_kernels.c.
|
static |
Tests retrieval of the current cell from logical particle coordinates.
Definition at line 70 of file test_particle_kernels.c.
|
static |
Fills a cell with the unit cube's vertices in walking-search order, x sheared by shear * z.
Definition at line 94 of file test_particle_kernels.c.
|
static |
Tests the face mirror on a flat face, a sheared face, and a two-face corner.
Definition at line 108 of file test_particle_kernels.c.
|
static |
Tests that the reflection-cap fallback places a far-outside point just inside the cell.
Definition at line 146 of file test_particle_kernels.c.
|
static |
Tests the runtime evaluator against every shared conformance case.
tests/fixtures/expression_conformance.txt is also evaluated by generators/ic.gen in tests/test_expression_language.py, so the two implementations of the language cannot drift apart unnoticed.
Definition at line 175 of file test_particle_kernels.c.
|
static |
Tests the Bessel and Kelvin functions against 30-digit references from their series, and that a non-integer Bessel order gives NaN.
Definition at line 214 of file test_particle_kernels.c.
|
static |
Tests the documented closed-form sources.
The Womersley source, written in real arithmetic with ber and bei, against the complex solution Re{(K/i w)(1 - J0(i^1.5 a s)/J0(i^1.5 a)) e^{iwt}} evaluated independently from its series (K = 1, w = 2 pi, a = 5, R = 0.5); the rectangular-duct series against the Python evaluator.
Definition at line 259 of file test_particle_kernels.c.
|
static |
Tests that the compiler refuses what the Python validator also refuses.
Definition at line 301 of file test_particle_kernels.c.
|
static |
Tests that random draws are pure functions of their key.
The same particle always draws the same number; a different particle, event, or field default stream draws independently; an explicit stream is shared across fields; and the normal draw has zero mean and unit variance.
Definition at line 337 of file test_particle_kernels.c.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Runs the unit-particles PETSc test binary.
Definition at line 393 of file test_particle_kernels.c.
|
static |
Definition at line 167 of file test_particle_kernels.c.