|
PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
|
C test module for PICurv. More...
#include "test_support.h"#include <errno.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys/stat.h>#include <sys/types.h>#include <unistd.h>Go to the source code of this file.
Functions | |
| static PetscErrorCode | DestroyVecIfSet (Vec *vec) |
| Test-local routine. | |
| static PetscErrorCode | DestroyDMIfSet (DM *dm) |
| Test-local routine. | |
| static PetscErrorCode | RegisterSwarmFieldForTests (DM swarm, const char *field_name, PetscInt field_dim, PetscDataType dtype) |
| Test-local routine. | |
| PetscErrorCode | PicurvRunTests (const char *suite_name, const PicurvTestCase *cases, size_t case_count) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvEnsureDir (const char *path) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvMakeTempDir (char *path, size_t path_len) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvCreateMinimalContexts (SimCtx **simCtx_out, UserCtx **user_out, PetscInt mx, PetscInt my, PetscInt mz) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvPopulateIdentityMetrics (UserCtx *user) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvCreateSwarmPair (UserCtx *user, PetscInt nlocal, const char *post_field_name) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvDestroyMinimalContexts (SimCtx **simCtx_ptr, UserCtx **user_ptr) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvAssertRealNear (PetscReal expected, PetscReal actual, PetscReal tol, const char *context) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvAssertIntEqual (PetscInt expected, PetscInt actual, const char *context) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvAssertBool (PetscBool value, const char *context) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvAssertFileExists (const char *path, const char *context) |
| Shared test-support routine. | |
| PetscErrorCode | PicurvAssertVecConstant (Vec vec, PetscScalar expected, PetscReal tol, const char *context) |
| Shared test-support routine. | |
C test module for PICurv.
Definition in file test_support.c.
|
static |
Test-local routine.
Definition at line 19 of file test_support.c.
|
static |
Test-local routine.
Definition at line 31 of file test_support.c.
|
static |
Test-local routine.
Definition at line 43 of file test_support.c.
| PetscErrorCode PicurvRunTests | ( | const char * | suite_name, |
| const PicurvTestCase * | cases, | ||
| size_t | case_count | ||
| ) |
Shared test-support routine.
Executes a table of unit tests and reports aggregated pass/fail status.
Definition at line 53 of file test_support.c.
| PetscErrorCode PicurvEnsureDir | ( | const char * | path | ) |
Shared test-support routine.
Ensures a directory exists, creating it if required.
Definition at line 71 of file test_support.c.
| PetscErrorCode PicurvMakeTempDir | ( | char * | path, |
| size_t | path_len | ||
| ) |
Shared test-support routine.
Creates a unique temporary directory path and materializes the directory.
Definition at line 83 of file test_support.c.
| PetscErrorCode PicurvCreateMinimalContexts | ( | SimCtx ** | simCtx_out, |
| UserCtx ** | user_out, | ||
| PetscInt | mx, | ||
| PetscInt | my, | ||
| PetscInt | mz | ||
| ) |
Shared test-support routine.
Creates minimal PETSc/solver contexts used by isolated kernel tests.
Definition at line 100 of file test_support.c.
| PetscErrorCode PicurvPopulateIdentityMetrics | ( | UserCtx * | user | ) |
Shared test-support routine.
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 | ||
| ) |
Shared test-support routine.
Creates paired runtime/post swarms with optional extra post-processing field registration.
Definition at line 255 of file test_support.c.
Shared test-support routine.
Destroys contexts previously created by PicurvCreateMinimalContexts.
Definition at line 288 of file test_support.c.
| PetscErrorCode PicurvAssertRealNear | ( | PetscReal | expected, |
| PetscReal | actual, | ||
| PetscReal | tol, | ||
| const char * | context | ||
| ) |
Shared test-support routine.
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 | ||
| ) |
Shared test-support routine.
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 | ||
| ) |
Shared test-support routine.
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 | ||
| ) |
Shared test-support routine.
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 | ||
| ) |
Shared test-support routine.
Asserts every entry of a vector equals a constant within tolerance.
Definition at line 427 of file test_support.c.