Geom Module Unit Tests¶
Tests for the mesh geometry infrastructure in src/Geom/.
All C++ tests use doctest.
MPI-aware tests are registered with CTest at multiple process counts.
Building and Running¶
# Build all Geom C++ test executables
cmake --build build -t geom_unit_tests -j8
# Run every Geom CTest
ctest --test-dir build -R geom_ --output-on-failure
# Run a single suite
ctest --test-dir build -R geom_elements --output-on-failure
Target Summary¶
CMake target |
CTest name |
Source file |
Timeout |
|---|---|---|---|
|
|
test_Elements.cpp |
120 s |
|
|
test_Quadrature.cpp |
120 s |
|
|
test_MeshIndexConversion.cpp |
120 s |
|
|
test_MeshPipeline.cpp |
120 s |
|
|
test_MeshDistributedRead.cpp |
120 s |
|
|
test_MeshConnectivity.cpp |
120 s |
|
|
test_MeshConnectivity_Ghost.cpp |
120 s |
|
|
test_MeshConnectivity_Interpolate.cpp |
120 s |
|
|
test_MeshReorder.cpp |
120 s |
Element Types (test_Elements.cpp)¶
See also: test_Elements.cpp
Serial-only tests for element geometry definitions, node counts, and shape function evaluation.
Quadrature Rules (test_Quadrature.cpp)¶
See also: test_Quadrature.cpp
Serial-only tests for Gaussian quadrature points and weights on standard elements (triangles, quads, tetrahedra, hexahedra, prisms, pyramids).
Mesh Index Conversion (test_MeshIndexConversion.cpp)¶
See also: test_MeshIndexConversion.cpp
MPI-parallel tests verifying local-to-global and global-to-local index conversions on partitioned meshes.
Mesh Pipeline (test_MeshPipeline.cpp)¶
See also: test_MeshPipeline.cpp
MPI-parallel end-to-end tests for the mesh construction pipeline: reading, partitioning, ghost creation, and boundary extraction.
Distributed Mesh I/O (test_MeshDistributedRead.cpp)¶
See also: test_MeshDistributedRead.cpp
MPI-parallel tests for reading CGNS mesh files in parallel and redistributing across different partition counts.
MeshConnectivity DSL (test_MeshConnectivity.cpp)¶
See also: test_MeshConnectivity.cpp
MPI-parallel tests for the MeshConnectivity standalone DSL operations:
Inverse, Compose, ComposeFiltered, Interpolate, and adjacency
registry management. Validates cone/support inversion, compose with
predicates, and entity-kind registration.
Ghost Tree Evaluation (test_MeshConnectivity_Ghost.cpp)¶
See also: test_MeshConnectivity_Ghost.cpp
MPI-parallel tests for evaluateGhostTree, GhostSpec,
CompiledGhostTree, and multi-layer ghost cell support. Tests include
single-layer and multi-layer ghost chains, scratch-pull between BFS
levels, and 2D tiled synthetic grids with analytical ghost formulas.
Interpolation (test_MeshConnectivity_Interpolate.cpp)¶
See also: test_MeshConnectivity_Interpolate.cpp
MPI-parallel tests for InterpolateGlobal — distributed sub-entity
extraction with global deduplication and periodic-aware matching.
Mesh Reordering (test_MeshReorder.cpp)¶
See also: test_MeshReorder.cpp
MPI-parallel tests for the distributed entity reordering framework:
ReorderPlan, ReorderRegistry, ReorderInput, and
UnstructuredMesh::ReorderEntities. See
Distributed Reorder Design for the
architecture, and PermutationTransfer Tests
for the underlying MPI primitive.
Classification and registry¶
classifyAdjbasic classification — exhaustively covers all fiveAdjActionoutcomes (SKIP, RELOCATE, REMAP, RELOCATE_REMAP, SELF) across cell-only, node-only, both-reordered, and intra-level adjacency scenarios.ReorderRegistryregister and query —registerAdj,registerCompanion,registerGlobalMapping, andgetGlobalMappingwith both hits and misses. Verifies callback storage and retrieval.
Synthetic plan application¶
ReorderPlan::applycell-only local permutation — synthetic cell/node arrays with identity cell partition; validates that the registered RELOCATE callback is invoked and data is preserved.ReorderPlan::applynode-only remap — node reorder with cells unchanged; validates REMAP path and companion relocate for the node-parallelcoordsanalog.ReorderPlan::applyRELOCATE_REMAP (both source and target reordered) — explicitly exercises the fourthAdjActioncase:cell2nodewith both Cell and Node in the reorder set. AssertsclassifyAdjreturnsRELOCATE_REMAPand confirms data integrity after both phases.
Real-mesh ReorderEntities¶
Cell-only local on
UniformSquare_10.cgns— identity partition, full rebuild pipeline (RecoverNode2Cell → BuildGhost → Global2Local); verifies counts and entry validity.Cell-only with face destruction — destroys faces via
destroyKinds={EntityKind::Face}, then rebuilds from scratch viaInterpolateFace.Cell distributed round-robin with follow — non-identity partition (
i % nRanks); Node and Bnd automatically follow Cell via the default follow policy. Validates global count preservation, entry validity, and post-reorder mesh rebuild.Node-only local — node reorder only, cells stay; verifies coord preservation under identity partition and mesh rebuild success.
Expected-value verification¶
PermutationTransfer + buildLookup: reverse permutation value tracking — uses
fromLocalPermutationwith a non-identity permutation and verifies that each old global maps to the exact expected new global vialookup.resolve(). Also verifies that row data moves to the permuted slot.Distributed value tracking cross-rank — covered in PermutationTransfer Tests.
Framework extension¶
ReorderEntitieswith external companion array (solver-like) — creates an externalArrayAdjacencyPair<3>tagged with per-cell DOF patterns (column pattern(g*10+0, g*10+1, g*10+2)), registers it as a companion viaregisterCompanionon the registry returned bybuildReorderRegistry, applies the plan, and verifies that all three columns of each row travel together (DOF layout preserved across distribution). Demonstrates the pattern for solver arrays that must participate in mesh reordering.
Registry invariants¶
buildReorderRegistrypopulates pullSets — validates that pull-set entries are off-rank, within[0, globalSize), sorted, and unique. Confirms all expected adjacency and companion entries are registered byUnstructuredMesh::buildReorderRegistry.