Rodin::Tests::Unit namespace

Unitary tests.

Classes

class Assembly_OpenMP_Problem
Single-variable Problem: Default assembler (OpenMP when available) produces same operator as Sequential for all 2D geometries.
class FlowTest
Unit tests for Flow class basic functionality.
class FMMTest
Basic unit tests for Fast Marching Method (FMM)
class LagrangianTest
Unit tests for Lagrangian class basic functionality.

Functions

TEST_P(Assembly_OpenMP_LinearForm, ConstantLoad_MatchesSequential_P1)
Constant load f = 1: OpenMP result equals Sequential result.
TEST_P(Assembly_OpenMP_LinearForm, ConstantLoad_MatchesSequential_P0)
P0 constant load: OpenMP result equals Sequential result.
TEST_P(Assembly_OpenMP_BilinearForm, P1StiffnessMatrix_MatchesSequential)
P1 stiffness matrix: OpenMP result equals Sequential result.
TEST_P(Assembly_OpenMP_BilinearForm, P1MassMatrix_MatchesSequential)
P1 mass matrix: OpenMP result equals Sequential result.
TEST_P(Assembly_OpenMP_BilinearForm, P0MassMatrix_MatchesSequential)
P0 mass matrix: OpenMP result equals Sequential result.
TEST_P(Assembly_OpenMP_BilinearForm, NonSquare_P0test_P1trial_MatchesSequential)
Non-square mixed BF (P0 test × P1 trial): OpenMP equals Sequential.
TEST_P(Assembly_OpenMP_BilinearForm, SingleThread_EqualsSequential_P1Stiffness)
OpenMP with explicit thread count 1 gives same result as Sequential.
TEST(Assembly_Sequential_LinearForm, VectorSize_P1_4x4)
Assembled vector has the expected size (one entry per DOF).
TEST(Assembly_Sequential_LinearForm, VectorSize_P1_Quad_4x4)
Assembled vector has the expected size for Quadrilateral meshes.
TEST(Assembly_Sequential_LinearForm, ConstantRHS_EntriesPositive_P1)
All entries of ∫ 1·v dΩ are positive for a positive basis.
TEST(Assembly_Sequential_LinearForm, ConstantRHS_SumEqualsArea_P0)
∫ 1·v dΩ with P0 sums to area (each element has exactly one DOF and the mass is |K|).
TEST(Assembly_Sequential_LinearForm, LinearScaling_P1)
Scaling: ∫ 2·v dΩ = 2 · ∫ 1·v dΩ.
TEST(Assembly_Sequential_BilinearForm_Sparse, MatrixDimensions_P1_4x4)
Stiffness matrix has correct dimensions.
TEST(Assembly_Sequential_BilinearForm_Sparse, P0MassMatrix_IsDiagonal)
P0 mass matrix is diagonal (each element has one DOF).
TEST(Assembly_Sequential_BilinearForm_Sparse, P1MassMatrix_IsSymmetric)
P1 mass matrix is symmetric.
TEST(Assembly_Sequential_BilinearForm_Sparse, P1StiffnessMatrix_IsSymmetric)
P1 stiffness matrix is symmetric.
TEST(Assembly_Sequential_BilinearForm_Sparse, P1MassMatrix_SumEqualsArea)
P1 mass matrix row-sum equals domain area (∑_j M_ij summed over all i,j equals ∫_Ω 1 dΩ = area(Ω)). For UniformGrid({4,4}) the domain is [0,3]x[0,3] so area = 9.
TEST(Assembly_Sequential_BilinearForm_Sparse, NonSquare_P0test_P1trial_Dimensions)
Non-square BF: P1 trial, P0 test. Dimensions must match (testSize × trialSize).
TEST(Assembly_Sequential_Problem_SingleVar, Dimensions_P1_4x4)
Single-variable Problem: assembled system has correct dimensions.
TEST(Assembly_Sequential_Problem_SingleVar, DirichletBC_RowIsIdentity_P1)
DirichletBC is enforced: fixed DOF row is an identity row and RHS entry equals the prescribed value.
TEST(Assembly_Sequential_Problem_SingleVar, PreassembledBF_MatchesIntegral_P1)
Preassembled BF added to a single-variable Problem produces the same matrix as assembling the integral directly.
TEST(Assembly_Sequential_Problem_SingleVar, PreassembledLF_MatchesIntegral_P1)
Preassembled LF added to a single-variable Problem produces the same RHS vector as assembling the integral directly.
TEST(Assembly_Sequential_Problem_MultiVar, Dimensions_P0P1_4x4)
Multi-variable Problem: global system has combined DOF count.
TEST(Assembly_Sequential_Problem_MultiVar, PreassembledBF_BlockOffset_P0P1)
Multi-variable preassembled BF: block [p,q] placed at correct offset in the global matrix.
TEST(Assembly_Sequential_Problem_MultiVar, PreassembledLF_BlockOffset_P0P1)
Multi-variable preassembled LF: block [q] placed at correct offset in the global RHS vector.
static auto makeAllGeomMesh(Polytope::Type geom, size_t n = 4) -> Mesh<Context::Local>
Creates a mesh with minimal connectivity for cell integration.
TEST_P(Assembly_Sequential_AllGeometries, LF_VectorSize_P1)
P1 LinearForm vector size equals the FES DOF count for every supported geometry type.
TEST_P(Assembly_Sequential_AllGeometries, LF_VectorSize_P0)
P0 LinearForm vector size equals the FES DOF count (= cell count) for every supported geometry type.
TEST_P(Assembly_Sequential_AllGeometries, BF_StiffnessMatrix_Dimensions_P1)
P1 stiffness matrix has correct square dimensions for every supported geometry type.
TEST_P(Assembly_Sequential_AllGeometries, BF_MassMatrix_IsSymmetric_P1)
P1 mass matrix is symmetric for every supported geometry type.
TEST_P(Assembly_Sequential_AllGeometries, BF_StiffnessMatrix_IsSymmetric_P1)
P1 stiffness matrix is symmetric for every supported geometry type.
TEST_P(Assembly_Sequential_AllGeometries, BF_P0MassMatrix_IsDiagonal)
P0 mass matrix is diagonal for every supported geometry type (each cell has exactly one P0 DOF, so there is no inter-cell coupling).
TEST_P(Assembly_Sequential_AllGeometries, LF_LoadVector_P0_EntriesPositive)
P0 load vector: all entries are positive (element measure > 0) for every supported geometry type.
static auto makeMixed2DMesh() -> Mesh<Context::Local>
Helper to build a mixed 2D mesh with triangles and quadrilaterals.
static auto makeMixed3DMesh() -> Mesh<Context::Local>
Helper to build a mixed 3D mesh with tetrahedra and wedges.
static auto makeLargerMixed2DMesh() -> Mesh<Context::Local>
Builds a larger mixed 2D mesh: 4 triangles + 2 quadrilaterals.
TEST(Rodin_Geometry_Sharder, HDF5_ShardSaveLoad_TopologyRoundTrip)
Verifies that each shard's vertex and cell counts are preserved through an HDF5 save/load round-trip.
TEST(Rodin_Geometry_Sharder, HDF5_ShardSaveLoad_Reconcile_GlobalConsistency)
Verifies global mesh consistency after HDF5 shard save/load.
TEST(Rodin_Geometry_Shard, Builder_ParentMode_AllOwned)
Builds a shard from a parent mesh containing two triangles forming a unit square and includes all entities as owned.
TEST(Rodin_Geometry_Shard, Builder_ParentMode_MixedStates)
Builds two shards from a 4-triangle mesh and verifies ownership, shared, and ghost state for vertices and cells.
TEST(Rodin_Geometry_Shard, Builder_DirectMode_SingleTriangle)
Tests direct construction of a shard with explicit vertex and polytope insertion.
TEST(Rodin_Geometry_Shard, Builder_DirectMode_VertexIdempotent)
Verifies that inserting the same global vertex twice in direct mode is idempotent and returns the same local index.
TEST(Rodin_Geometry_Shard, PolytopeMap_ParentMode)
Verifies the bidirectional polytope map after building a shard from a parent mesh.
TEST(Rodin_Geometry_Shard, PolytopeMap_DirectMode)
Verifies the bidirectional polytope map after building a shard in direct mode.
TEST(Rodin_Geometry_Shard, GetState)
Verifies getState() returns the correct per-entity state vectors.
TEST(Rodin_Geometry_Shard, Builder_ParentMode_AttributePreservation)
Tests that Builder::include() preserves entity attributes from the parent mesh after shard finalization.
TEST(Rodin_Geometry_Shard, Builder_ParentMode_ConnectivityPreservation)
Tests that shard-local cell-to-vertex connectivity matches the parent mesh connectivity when mapped through the PolytopeMap.
TEST(Rodin_Geometry_Shard, Builder_DirectMode_Mixed3D)
Tests direct-mode construction of a mixed 3D shard containing one tetrahedron and one wedge that share a triangular face.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree1_Scalar)
Test saving and loading H1 GridFunction with degree 1 (scalar)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Scalar)
Test saving and loading H1 GridFunction with degree 2 (scalar)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree3_Scalar)
Test saving and loading H1 GridFunction with degree 3 (scalar)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadFile_H1_Degree2_Scalar)
Test saving H1 GridFunction to file and loading it back.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree4_Triangle)
Test H1 degree 4 on triangle mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree5_Triangle)
Test H1 degree 5 on triangle mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree6_Triangle)
Test H1 degree 6 on triangle mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree4_Quadrilateral)
Test H1 degree 4 on quadrilateral mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree5_Quadrilateral)
Test H1 degree 5 on quadrilateral mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree6_Quadrilateral)
Test H1 degree 6 on quadrilateral mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree4_Tetrahedron)
Test H1 degree 4 on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree5_Tetrahedron)
Test H1 degree 5 on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree6_Tetrahedron)
Test H1 degree 6 on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree4_Mixed2D)
Test H1 degree 4 on mixed 2D mesh (triangles and quads)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree5_Mixed2D)
Test H1 degree 5 on mixed 2D mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree6_Mixed2D)
Test H1 degree 6 on mixed 2D mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree1_Quadrilateral)
Test H1 degree 1 on quadrilateral mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Quadrilateral)
Test H1 degree 2 on quadrilateral mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree1_Tetrahedron)
Test H1 degree 1 on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Tetrahedron)
Test H1 degree 2 on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Triangle_Large)
Test H1 degree 2 on triangle mesh with >= 16 elements.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree1_Mixed2D)
Test H1 degree 1 on mixed 2D mesh (triangles and quads)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Mixed2D)
Test H1 degree 2 on mixed 2D mesh.
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree1_Segment)
Test H1 degree 1 on segment mesh (1D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree2_Segment)
Test H1 degree 2 on segment mesh (1D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree3_Segment)
Test H1 degree 3 on segment mesh (1D)
TEST(Rodin_IO_MFEM_H1_GridFunction, SaveLoadRoundTrip_H1_Degree4_Segment)
Test H1 degree 4 on segment mesh (1D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Triangle)
Test saving and loading P1 GridFunction on triangle mesh (2D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Quadrilateral)
Test saving and loading P1 GridFunction on quadrilateral mesh (2D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Tetrahedron)
Test saving and loading P1 GridFunction on tetrahedron mesh (3D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Wedge)
Test saving and loading P1 GridFunction on wedge mesh (3D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Segment)
Test saving and loading P1 GridFunction on segment mesh (1D)
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadRoundTrip_Mixed2D)
Test saving and loading P1 GridFunction on mixed 2D mesh.
TEST(Rodin_IO_MFEM_P1_GridFunction, SaveLoadFile)
Test file-based I/O for P1 GridFunction.
TEST_P(LagrangianTest, BasicConstruction)
Test basic Lagrangian class construction.
TEST_P(LagrangianTest, DifferentVelocityFields)
Test Lagrangian with different velocity field types.
TEST_P(LagrangianTest, StepFunction)
Test Lagrangian step function basic functionality.
TEST_P(LagrangianTest, DifferentInitialConditions)
Test with different initial conditions.
TEST(Assembly_MPI_Iteration, TriangleMesh_HasCells)
MPIIteration over a Triangle mesh yields at least one cell.
TEST(Assembly_MPI_Iteration, QuadrilateralMesh_HasCells)
MPIIteration over a Quadrilateral mesh yields at least one cell.
TEST(Assembly_MPI_Iteration, GlobalCellCount_MatchesLocal_Triangle)
Global cell count equals the sum of local counts across all ranks.
TEST(Assembly_MPI_DirichletBC, ConstantBC_NonEmpty_Triangle)
MPI DirichletBC assembly yields at least one boundary DOF entry on a Triangle mesh with a constant boundary condition.
TEST(Assembly_MPI_DirichletBC, SingleRank_MatchesSequentialCount_Triangle)
MPI DirichletBC assembly: boundary DOF count is consistent with the sequential assembly on the same mesh for a 1-rank run.
TEST(Assembly_MPI_DirichletBC, ConstantBC_Values_AllEqualPrescribed_Triangle)
MPI DirichletBC assembly: boundary DOF values are correct for a constant boundary condition.
TEST(Assembly_MPI_Iteration, SegmentMesh_HasCells)
MPIIteration over a 1D Segment mesh yields at least one cell.
TEST(Assembly_MPI_Iteration, GlobalCellCount_MatchesLocal_Segment)
Global cell count for a 1D Segment mesh equals the expected value.
TEST(Assembly_MPI_Iteration, TetrahedronMesh_HasCells)
MPIIteration over a Tetrahedron mesh yields at least one cell.
TEST(Assembly_MPI_Iteration, HexahedronMesh_HasCells)
MPIIteration over a Hexahedron mesh yields at least one cell.
TEST(Assembly_MPI_DirichletBC, ConstantBC_Segment)
MPI DirichletBC assembly on Segment (1D) mesh: at least one boundary DOF is found and its value matches the prescribed constant.
TEST(Assembly_MPI_DirichletBC, ConstantBC_NonEmpty_Tetrahedron)
MPI DirichletBC assembly on Tetrahedron (3D) mesh: at least one boundary DOF found globally.
TEST(Assembly_MPI_DirichletBC, ConstantBC_NonEmpty_Hexahedron)
MPI DirichletBC assembly on Hexahedron (3D) mesh: at least one boundary DOF found globally.
TEST(Rodin_MPI_Geometry_Mesh, GetPolytopeCount_Cells)
Verifies that MPIMesh::getPolytopeCount(D) for cells equals the parent mesh cell count (using the MPIMesh API directly, not manual shard iteration).
TEST(Rodin_MPI_Geometry_Mesh, GetPolytopeCount_Vertices)
Verifies that MPIMesh::getPolytopeCount(0) for vertices equals the parent mesh vertex count.
TEST(Rodin_MPI_Geometry_Mesh, GetPolytopeCount_ByType)
Verifies that MPIMesh::getPolytopeCount(Polytope::Type) correctly counts cells by geometry type.
TEST(Rodin_MPI_Geometry_Mesh, IndexMapping_RoundTrip)
Verifies that getLocalIndex and getGlobalIndex are inverses of each other for all local polytopes.
TEST(Rodin_MPI_Geometry_Mesh, IndexMapping_MissingReturnsNullopt)
Verifies that getLocalIndex returns nullopt for a global index that is not present in the local shard.
TEST(Rodin_MPI_Geometry_Mesh, GetContext)
Verifies that MPIMesh::getContext() returns the construction context.
TEST(Rodin_MPI_Geometry_Mesh, LocalIterators)
Verifies that local cell and vertex iterators on MPIMesh work correctly and iterate over the expected number of entities.
TEST(Rodin_MPI_Geometry_Mesh, GetGeometry_Cells)
Verifies that MPIMesh::getGeometry() returns correct geometry types for local cells.
TEST(Rodin_MPI_Geometry_Mesh, GetVertexCoordinates)
Verifies that MPIMesh::getVertexCoordinates() returns valid coordinates for all local vertices.
TEST(Rodin_MPI_Geometry_Mesh, Tetrahedron3D_GlobalCellCount)
Verifies that a 3D Tetrahedron mesh distributes correctly via MPIMesh and getPolytopeCount returns the correct global count.
TEST(Rodin_MPI_Geometry_Mesh, Scale)
Verifies that MPIMesh::scale() modifies vertex coordinates by the given factor on each rank.
TEST(Rodin_MPI_Geometry_Mesh, Flush)
Verifies that MPIMesh::flush() does not crash and the mesh remains valid afterward.
TEST(Rodin_MPI_Geometry_Mesh, IsSubMesh)
Verifies that MPIMesh::isSubMesh() returns false.
TEST(Rodin_MPI_Geometry_Mesh, GetConnectivity)
Verifies that MPIMesh::getConnectivity() returns the shard's connectivity and that cell-to-vertex incidence is valid.
TEST(Rodin_MPI_Geometry_Mesh, GetSetAttribute)
Verifies that getAttribute returns valid attributes and setAttribute modifies them.
TEST(Rodin_MPI_Geometry_Mesh, SetVertexCoordinates)
Verifies that setVertexCoordinates modifies vertex coordinates and the change is reflected in getVertexCoordinates.
TEST(Rodin_MPI_Geometry_Mesh, GetArea_Triangle2D)
Verifies that MPIMesh::getArea() returns the correct total area for a distributed 2D triangle mesh, matching the parent mesh area.
TEST(Rodin_MPI_Geometry_Mesh, GetVolume_Tetrahedron3D)
Verifies that MPIMesh::getVolume() returns the correct total volume for a distributed 3D tetrahedron mesh.
TEST(Rodin_MPI_Geometry_Mesh, GetPolytopeTransformation)
Verifies that MPIMesh::getPolytopeTransformation() returns valid transformations for all local cells.
TEST(Rodin_MPI_Geometry_Mesh, GetCellByIndex)
Verifies that MPIMesh::getCell(localIdx) returns a valid polytope for each local cell index.
TEST(Rodin_MPI_Geometry_Mesh, GetVertexByIndex)
Verifies that MPIMesh::getVertex(localIdx) returns a valid polytope for each local vertex index.
TEST(Rodin_MPI_Geometry_Mesh, GetMeasure_MatchesGetArea)
Verifies that MPIMesh::getMeasure(D) returns the same value as getArea() for a 2D mesh.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_GlobalOwnershipCount)
Verifies that after reconcile(1) on a 2D triangle mesh, the global sum of owned edges equals the total edge count in the parent mesh.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_PolytopeMapBidirectional)
Verifies that after reconcile(1), the edge polytope map is bidirectional (left and right are inverses).
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_StateExclusivity)
Verifies that after reconcile(1), each edge has exactly one state (Owned, Shared, or Ghost) — states are mutually exclusive.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_OwnerMapConsistency)
Verifies that after reconcile(1), the owner map for edges is consistent: ghost edges point to valid non-self ranks.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_NoDuplicateOwnership)
Verifies that after reconcile(1), no distributed edge ID is owned by multiple ranks — each edge has a unique global owner.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_HaloMapConsistency)
Verifies that after reconcile(1), the halo map for edges is consistent: halo entries reference owned entities and valid remote ranks.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_SingleRank_AllOwned)
Verifies that with a single MPI rank, reconcile(1) marks all edges as Owned (no ghosts since there are no neighbors).
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Faces3D_GlobalOwnershipCount)
Verifies that reconcile(2) on a 3D tetrahedron mesh produces correct global face ownership count.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Quad2D_GlobalEdgeCount)
Verifies that reconcile(1) works for a 2D quadrilateral mesh, producing the correct global edge ownership count.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Faces3D_StateExclusivity)
Verifies that reconcile(2) on a 3D tetrahedron mesh produces mutually exclusive states for every face entity (exactly one of Owned, Shared, or Ghost).
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Faces3D_PolytopeMapBidirectional)
Verifies that reconcile(2) on a 3D mesh produces a bidirectional polytope map for faces.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_Idempotent)
Verifies that calling reconcile(1) twice is idempotent: the distributed IDs and ownership state do not change on a second call.
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_StrictRoundCapThrows)
Verifies that strict round caps are enforced for reconcile().
TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Edges2D_GlobalCheckPeriodPreservesState)
Verifies that throttled global checks preserve reconcile correctness.
TEST(Rodin_MPI_Geometry_Mesh, Shard_HDF5_SaveLoad_BaseTopologyRoundTrip)
Verifies that each rank's shard can be saved to HDF5 and reloaded with base mesh topology preserved.
TEST(Rodin_MPI_Geometry_Mesh, Shard_HDF5_FullWorkflow_Reconcile)
Full HDF5 shard workflow: distribute → save → reload → reconcile.
TEST_P(FlowTest, BasicConstruction)
Test basic Flow class construction and coordinate handling.
TEST_P(FlowTest, VelocityFieldEvaluation)
Test different velocity field types and their evaluation.
TEST_P(FlowTest, MeshAccess)
Test mesh polytope access and validation.
auto computeTriangleFaceBarycentric(Real px, Real py, Real pz, Real x0, Real y0, Real z0, Real x1, Real y1, Real z1, Real x2, Real y2, Real z2) -> std::tuple<Real, Real, Real>
Checks if a 3D point lies on a triangular face and computes its barycentric coordinates.
auto computeQuadFaceParametric(Real px, Real py, Real pz, Real x0, Real y0, Real z0, Real x1, Real y1, Real z1, Real x2, Real y2, Real z2, Real x3, Real y3, Real z3) -> std::pair<Real, Real>
Checks if a 3D point lies on a planar quadrilateral face and computes parametric coords.
auto findInteriorFacePoint(Geometry::Mesh<Context::Local>& mesh) -> std::pair<bool, Geometry::Point>
Finds an interior face in the mesh and returns a point at its midpoint.
TEST(MixedProblem_PreassembledBF, SparseP0P1_MatrixMatchesIntegralOnly)
Mixed P0/P1 problem: compare integral-only vs preassembled BF.
TEST(MixedProblem_PreassembledLF, SparseP0P1_VectorMatchesIntegralOnly)
Same test for the RHS vector: compare integral-only vs preassembled LinearForm.
TEST(MixedProblem_PreassembledBF, SolveP0P1_SolutionMatches)
Verify that a solve using preassembled BF in a mixed Problem produces the same numerical solution as the integral-only version.
TEST(MixedProblem_PreassembledLF, SolveP0P1_SolutionMatches)
Verify that a solve using preassembled LF in a mixed Problem produces the same numerical solution as the integral-only version.

Function documentation

static Mesh<Context::Local> Rodin::Tests::Unit::makeAllGeomMesh(Polytope::Type geom, size_t n = 4)

Creates a mesh with minimal connectivity for cell integration.

For each geometry, computes cell→face incidence (needed for boundary detection by BC assemblers) and cell→vertex incidence (for DOF mapping).

static Mesh<Context::Local> Rodin::Tests::Unit::makeMixed2DMesh()

Helper to build a mixed 2D mesh with triangles and quadrilaterals.

Layout (6 vertices, 3 cells): 2—3—4 |\ | Q | | \ | | 0–1-—5

T0: (0,1,2), T1: (1,3,2), Q0: (1,5,4,3)

static Mesh<Context::Local> Rodin::Tests::Unit::makeMixed3DMesh()

Helper to build a mixed 3D mesh with tetrahedra and wedges.

Tet: (0,1,2,6) Wedge: (0,1,2,3,4,5) — prism extruding the base triangle upward

static Mesh<Context::Local> Rodin::Tests::Unit::makeLargerMixed2DMesh()

Builds a larger mixed 2D mesh: 4 triangles + 2 quadrilaterals.

Layout (8 vertices): 5—6—7 | Q1| Q0| 2—3—4 |\ T1 /| |T0\ /T3| 0—1 |\ T2 (uses vertex 4 from above)

Actually, simpler to just build a strip: 4—5—6—7 |T1/| Q1 | | / | Q0| | 0—1—2—3

Rodin::Tests::Unit::TEST(Rodin_Geometry_Sharder, HDF5_ShardSaveLoad_TopologyRoundTrip)

Verifies that each shard's vertex and cell counts are preserved through an HDF5 save/load round-trip.

Shard inherits from Mesh<Context::Local>, so it can be persisted with the standard local HDF5 printer. After reloading, the base mesh topology (space dimension, topological dimension, vertex count, cell count) must match the original shard exactly.

Rodin::Tests::Unit::TEST(Rodin_Geometry_Sharder, HDF5_ShardSaveLoad_Reconcile_GlobalConsistency)

Verifies global mesh consistency after HDF5 shard save/load.

After reloading each shard from HDF5:

  • Vertex coordinates are preserved (geometric reconcile check): for each global vertex ID appearing in multiple shards, all loaded copies carry the same spatial coordinates as in the original shard.
  • Owned cell and vertex counts from the original shards sum to the global mesh totals (partition reconcile check).

Rodin::Tests::Unit::TEST_P(LagrangianTest, BasicConstruction)

Test basic Lagrangian class construction.

This test verifies that Lagrangian objects can be constructed with proper trial/test functions, initial conditions, and velocity fields.

Rodin::Tests::Unit::TEST_P(LagrangianTest, DifferentVelocityFields)

Test Lagrangian with different velocity field types.

This test verifies that Lagrangian can work with various velocity fields.

Rodin::Tests::Unit::TEST_P(LagrangianTest, StepFunction)

Test Lagrangian step function basic functionality.

This test verifies that the step function can be called without errors. Note: The current implementation may have template deduction issues, so this test focuses on basic construction.

Rodin::Tests::Unit::TEST_P(LagrangianTest, DifferentInitialConditions)

Test with different initial conditions.

This test verifies that Lagrangian works with various initial conditions.

Rodin::Tests::Unit::TEST(Rodin_MPI_Geometry_Mesh, Reconcile_Faces3D_GlobalOwnershipCount)

Verifies that reconcile(2) on a 3D tetrahedron mesh produces correct global face ownership count.

Uses distributeFromRoot because the MPI UniformGrid for 3D types may produce degenerate partitions with small grids.

Rodin::Tests::Unit::TEST(Rodin_MPI_Geometry_Mesh, Shard_HDF5_SaveLoad_BaseTopologyRoundTrip)

Verifies that each rank's shard can be saved to HDF5 and reloaded with base mesh topology preserved.

Exercises steps 1–3 of the shard HDF5 workflow:

  1. Mesh is sharded (distributed via distributeFromRoot).
  2. Each rank saves its shard using MeshPrinter<FileFormat::HDF5, Context::MPI>, which writes both the base mesh topology and the /Shard/... metadata datasets.
  3. Each rank rereads its shard from HDF5 through the MPI mesh loader.

After reloading, the vertex and cell counts must match the original shard.

Rodin::Tests::Unit::TEST(Rodin_MPI_Geometry_Mesh, Shard_HDF5_FullWorkflow_Reconcile)

Full HDF5 shard workflow: distribute → save → reload → reconcile.

Exercises all four steps of the workflow:

  1. Mesh is sharded (distributed via distributeFromRoot).
  2. Each rank saves its shard to a per-rank HDF5 file using the MPI printer (writes base mesh + /Shard/... metadata).
  3. Each rank rereads its shard from HDF5 through the MPI mesh loader.
  4. Edge connectivity is then computed and reconciled.

After reconciliation, the global sum of locally-owned edges must equal the total edge count of the reference mesh.

Rodin::Tests::Unit::TEST_P(FlowTest, BasicConstruction)

Test basic Flow class construction and coordinate handling.

This test verifies that Flow objects can be constructed with valid velocity fields and that basic coordinate system handling works.

Rodin::Tests::Unit::TEST_P(FlowTest, VelocityFieldEvaluation)

Test different velocity field types and their evaluation.

This test verifies that different types of velocity fields can be properly constructed and evaluated at specific points.

Rodin::Tests::Unit::TEST_P(FlowTest, MeshAccess)

Test mesh polytope access and validation.

This test verifies basic mesh functionality needed for Flow operations.

std::tuple<Real, Real, Real> Rodin::Tests::Unit::computeTriangleFaceBarycentric(Real px, Real py, Real pz, Real x0, Real y0, Real z0, Real x1, Real y1, Real z1, Real x2, Real y2, Real z2)

Checks if a 3D point lies on a triangular face and computes its barycentric coordinates.

Parameters
px The query point coordinates
py The query point coordinates
pz The query point coordinates
x0 First vertex of the triangle (corresponds to barycentric u=1)
y0 First vertex of the triangle (corresponds to barycentric u=1)
z0 First vertex of the triangle (corresponds to barycentric u=1)
x1 Second vertex of the triangle (corresponds to barycentric v=1)
y1 Second vertex of the triangle (corresponds to barycentric v=1)
z1 Second vertex of the triangle (corresponds to barycentric v=1)
x2 Third vertex of the triangle (corresponds to barycentric w=1)
y2 Third vertex of the triangle (corresponds to barycentric w=1)
z2 Third vertex of the triangle (corresponds to barycentric w=1)
Returns Tuple of (u, v, w) barycentric coordinates if point is on face; (NaN, NaN, NaN) if point is not on the triangular face

Uses the barycentric coordinate method to determine if point (px, py, pz) lies on the triangle defined by vertices (x0,y0,z0), (x1,y1,z1), (x2,y2,z2).

Algorithm:

  1. Express the point as P = u*V0 + v*(V1-V0) + w*(V2-V0) where u + v + w = 1
  2. Solve for v, w using dot products (Cramer's rule)
  3. Point is on triangle if 0 <= u,v,w <= 1 and point lies on the plane

std::pair<Real, Real> Rodin::Tests::Unit::computeQuadFaceParametric(Real px, Real py, Real pz, Real x0, Real y0, Real z0, Real x1, Real y1, Real z1, Real x2, Real y2, Real z2, Real x3, Real y3, Real z3)

Checks if a 3D point lies on a planar quadrilateral face and computes parametric coords.

Parameters
px The query point coordinates
py The query point coordinates
pz The query point coordinates
x0 First vertex (maps to parametric (0,0))
y0 First vertex (maps to parametric (0,0))
z0 First vertex (maps to parametric (0,0))
x1 Second vertex (maps to parametric (1,0))
y1 Second vertex (maps to parametric (1,0))
z1 Second vertex (maps to parametric (1,0))
x2 Third vertex (maps to parametric (1,1))
y2 Third vertex (maps to parametric (1,1))
z2 Third vertex (maps to parametric (1,1))
x3 Fourth vertex (maps to parametric (0,1))
y3 Fourth vertex (maps to parametric (0,1))
z3 Fourth vertex (maps to parametric (0,1))
Returns Pair of (s, t) parametric coordinates if point is on face; (NaN, NaN) if point is not on the quadrilateral face

For a planar quadrilateral with vertices ordered counter-clockwise, determines if point (px, py, pz) lies on the face and computes its parametric coordinates (s, t) in [0,1]x[0,1].

Algorithm:

  1. Compute the face normal using cross product of edge vectors
  2. Check if point lies on the plane within tolerance
  3. Project to 2D by dropping the axis with largest normal component
  4. Solve for parametric coordinates in the projected space

Note: This simplified algorithm assumes axis-aligned or near-axis-aligned quads, which is appropriate for reference element faces.

std::pair<bool, Geometry::Point> Rodin::Tests::Unit::findInteriorFacePoint(Geometry::Mesh<Context::Local>& mesh)

Finds an interior face in the mesh and returns a point at its midpoint.

Parameters
mesh in The mesh (face-to-cell connectivity will be computed)
Returns A pair: (true, Point on interior face) or (false, dummy Point)

Rodin::Tests::Unit::TEST(MixedProblem_PreassembledBF, SparseP0P1_MatrixMatchesIntegralOnly)

Mixed P0/P1 problem: compare integral-only vs preassembled BF.

System: Integral(u, v) – Integral(p, v) = 0 (test v in P1) Integral(p, q) = (f, q) (test q in P0)

We replace the Integral(p, q) block with a preassembled BilinearForm and verify the global matrix matches.