|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
C test module for PICurv. 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 | PicurvDestroyMinimalContexts (SimCtx **simCtx, UserCtx **user) |
Destroys contexts previously created by PicurvCreateMinimalContexts. | |
| 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 | 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. | |
C test module for PICurv.
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 53 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 100 of file test_support.c.
Destroys contexts previously created by PicurvCreateMinimalContexts.
Destroys contexts previously created by PicurvCreateMinimalContexts.
Definition at line 288 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 206 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 255 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 83 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 71 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 368 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 383 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 398 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 411 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 427 of file test_support.c.