|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
Shared declarations for the PICurv C test fixture and assertion layer. More...
Go to the source code of this file.
Data Structures | |
| struct | PicurvTestCase |
Named test case descriptor consumed by PicurvRunTests. More... | |
Typedefs | |
| typedef PetscErrorCode(* | PicurvTestFn) (void) |
| Signature for a single C unit-test entry point. | |
| typedef struct PicurvTestCase | PicurvTestCase |
Named test case descriptor consumed by PicurvRunTests. | |
Functions | |
| PetscErrorCode | PicurvRunTests (const char *suite_name, const PicurvTestCase *cases, size_t case_count) |
| Executes a table of unit tests and reports aggregated pass/fail status. | |
| PetscErrorCode | PicurvCreateMinimalContexts (SimCtx **simCtx_out, UserCtx **user_out, PetscInt mx, PetscInt my, PetscInt mz) |
| Creates minimal PETSc/solver contexts used by isolated kernel tests. | |
| PetscErrorCode | PicurvCreateMinimalContextsWithPeriodicity (SimCtx **simCtx_out, UserCtx **user_out, PetscInt mx, PetscInt my, PetscInt mz, PetscBool x_periodic, PetscBool y_periodic, PetscBool z_periodic) |
| Creates minimal PETSc/solver contexts with optional periodic DM boundaries. | |
| PetscErrorCode | PicurvDestroyMinimalContexts (SimCtx **simCtx, UserCtx **user) |
Destroys contexts previously created by PicurvCreateMinimalContexts. | |
| PetscErrorCode | PicurvBuildTinyRuntimeContext (const char *bcs_contents, PetscBool enable_particles, SimCtx **simCtx_out, UserCtx **user_out, char *tmpdir, size_t tmpdir_len) |
| Builds a tiny runtime context through the real setup path for behavior-level tests. | |
| PetscErrorCode | PicurvDestroyRuntimeContext (SimCtx **simCtx_ptr) |
Finalizes and frees a runtime context built by PicurvBuildTinyRuntimeContext. | |
| PetscErrorCode | PicurvPopulateUniformCellCenters (UserCtx *user) |
| Populates cell center coordinates for a uniform grid on [0,1]^3. | |
| PetscErrorCode | PicurvPopulateIdentityMetrics (UserCtx *user) |
| Fills metric vectors with identity metrics for Cartesian-reference tests. | |
| PetscErrorCode | PicurvCreateSwarmPair (UserCtx *user, PetscInt nlocal, const char *post_field_name) |
| Creates paired runtime/post swarms with optional extra post-processing field registration. | |
| PetscErrorCode | PicurvMakeTempDir (char *path, size_t path_len) |
| Creates a unique temporary directory path and materializes the directory. | |
| PetscErrorCode | PicurvRemoveTempDir (const char *path) |
| Recursively removes a temporary directory created by PicurvMakeTempDir. | |
| PetscErrorCode | PicurvEnsureDir (const char *path) |
| Ensures a directory exists, creating it if required. | |
| PetscErrorCode | PicurvAssertRealNear (PetscReal expected, PetscReal actual, PetscReal tol, const char *context) |
| Asserts two real values are within tolerance for test validation. | |
| PetscErrorCode | PicurvAssertIntEqual (PetscInt expected, PetscInt actual, const char *context) |
| Asserts two integer values are exactly equal for test validation. | |
| PetscErrorCode | PicurvAssertBool (PetscBool value, const char *context) |
| Asserts a boolean condition is true for test validation. | |
| PetscErrorCode | PicurvAssertFileExists (const char *path, const char *context) |
| Asserts a filesystem path exists. | |
| PetscErrorCode | PicurvAssertVecConstant (Vec vec, PetscScalar expected, PetscReal tol, const char *context) |
| Asserts every entry of a vector equals a constant within tolerance. | |
Shared declarations for the PICurv C test fixture and assertion layer.
Definition in file test_support.h.
| struct PicurvTestCase |
Named test case descriptor consumed by PicurvRunTests.
Definition at line 17 of file test_support.h.
| Data Fields | ||
|---|---|---|
| const char * | name | |
| PicurvTestFn | fn | |
| typedef PetscErrorCode(* PicurvTestFn) (void) |
Signature for a single C unit-test entry point.
Definition at line 14 of file test_support.h.
| typedef struct PicurvTestCase PicurvTestCase |
Named test case descriptor consumed by PicurvRunTests.
| PetscErrorCode PicurvRunTests | ( | const char * | suite_name, |
| const PicurvTestCase * | cases, | ||
| size_t | case_count | ||
| ) |
Executes a table of unit tests and reports aggregated pass/fail status.
Executes a table of unit tests and reports aggregated pass/fail status.
Definition at line 138 of file test_support.c.
| PetscErrorCode PicurvCreateMinimalContexts | ( | SimCtx ** | simCtx_out, |
| UserCtx ** | user_out, | ||
| PetscInt | mx, | ||
| PetscInt | my, | ||
| PetscInt | mz | ||
| ) |
Creates minimal PETSc/solver contexts used by isolated kernel tests.
Creates minimal PETSc/solver contexts used by isolated kernel tests.
Definition at line 530 of file test_support.c.
| PetscErrorCode PicurvCreateMinimalContextsWithPeriodicity | ( | SimCtx ** | simCtx_out, |
| UserCtx ** | user_out, | ||
| PetscInt | mx, | ||
| PetscInt | my, | ||
| PetscInt | mz, | ||
| PetscBool | x_periodic, | ||
| PetscBool | y_periodic, | ||
| PetscBool | z_periodic | ||
| ) |
Creates minimal PETSc/solver contexts with optional periodic DM boundaries.
Creates minimal PETSc/solver contexts with optional periodic DM boundaries.
Definition at line 325 of file test_support.c.
Destroys contexts previously created by PicurvCreateMinimalContexts.
Destroys contexts previously created by PicurvCreateMinimalContexts.
Definition at line 783 of file test_support.c.
| PetscErrorCode PicurvBuildTinyRuntimeContext | ( | const char * | bcs_contents, |
| PetscBool | enable_particles, | ||
| SimCtx ** | simCtx_out, | ||
| UserCtx ** | user_out, | ||
| char * | tmpdir, | ||
| size_t | tmpdir_len | ||
| ) |
Builds a tiny runtime context through the real setup path for behavior-level tests.
Definition at line 735 of file test_support.c.
| PetscErrorCode PicurvDestroyRuntimeContext | ( | SimCtx ** | simCtx_ptr | ) |
Finalizes and frees a runtime context built by PicurvBuildTinyRuntimeContext.
Definition at line 768 of file test_support.c.
| PetscErrorCode PicurvPopulateUniformCellCenters | ( | UserCtx * | user | ) |
Populates cell center coordinates for a uniform grid on [0,1]^3.
Uses the shifted-index convention: cell (i,j,k) is stored at array index (i+1, j+1, k+1). For mx cells on [0,1], cell i has center at (i+0.5)/mx.
Definition at line 543 of file test_support.c.
| PetscErrorCode PicurvPopulateIdentityMetrics | ( | UserCtx * | user | ) |
Fills metric vectors with identity metrics for Cartesian-reference tests.
Fills metric vectors with identity metrics for Cartesian-reference tests.
Definition at line 571 of file test_support.c.
| PetscErrorCode PicurvCreateSwarmPair | ( | UserCtx * | user, |
| PetscInt | nlocal, | ||
| const char * | post_field_name | ||
| ) |
Creates paired runtime/post swarms with optional extra post-processing field registration.
Creates paired runtime/post swarms with optional extra post-processing field registration.
Definition at line 698 of file test_support.c.
| PetscErrorCode PicurvMakeTempDir | ( | char * | path, |
| size_t | path_len | ||
| ) |
Creates a unique temporary directory path and materializes the directory.
Creates a unique temporary directory path and materializes the directory.
Definition at line 168 of file test_support.c.
| PetscErrorCode PicurvRemoveTempDir | ( | const char * | path | ) |
Recursively removes a temporary directory created by PicurvMakeTempDir.
Definition at line 185 of file test_support.c.
| PetscErrorCode PicurvEnsureDir | ( | const char * | path | ) |
Ensures a directory exists, creating it if required.
Ensures a directory exists, creating it if required.
Definition at line 156 of file test_support.c.
| PetscErrorCode PicurvAssertRealNear | ( | PetscReal | expected, |
| PetscReal | actual, | ||
| PetscReal | tol, | ||
| const char * | context | ||
| ) |
Asserts two real values are within tolerance for test validation.
Asserts two real values are within tolerance for test validation.
Definition at line 902 of file test_support.c.
| PetscErrorCode PicurvAssertIntEqual | ( | PetscInt | expected, |
| PetscInt | actual, | ||
| const char * | context | ||
| ) |
Asserts two integer values are exactly equal for test validation.
Asserts two integer values are exactly equal for test validation.
Definition at line 917 of file test_support.c.
| PetscErrorCode PicurvAssertBool | ( | PetscBool | value, |
| const char * | context | ||
| ) |
Asserts a boolean condition is true for test validation.
Asserts a boolean condition is true for test validation.
Definition at line 932 of file test_support.c.
| PetscErrorCode PicurvAssertFileExists | ( | const char * | path, |
| const char * | context | ||
| ) |
Asserts a filesystem path exists.
Asserts a filesystem path exists.
Definition at line 945 of file test_support.c.
| PetscErrorCode PicurvAssertVecConstant | ( | Vec | vec, |
| PetscScalar | expected, | ||
| PetscReal | tol, | ||
| const char * | context | ||
| ) |
Asserts every entry of a vector equals a constant within tolerance.
Asserts every entry of a vector equals a constant within tolerance.
Definition at line 961 of file test_support.c.