DNDSR 0.1.0.dev1+gcd065ad
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
test_MeshPipeline.cpp File Reference

Parameterized doctest tests for the full mesh pipeline. More...

#include "doctest.h"
#include "Geom/Mesh.hpp"
#include <string>
#include <vector>
#include <array>
Include dependency graph for test_MeshPipeline.cpp:

Go to the source code of this file.

Classes

struct  MeshConfig
 

Macros

#define DOCTEST_CONFIG_IMPLEMENT
 
#define FOR_EACH_MESH_CONFIG(body)
 

Functions

int main (int argc, char **argv)
 
 TEST_CASE ("Pipeline: all five states are Local")
 
 TEST_CASE ("Pipeline: global cell count matches expected")
 
 TEST_CASE ("Pipeline: global bnd count matches expected")
 
 TEST_CASE ("InterpolateFace: face count is positive")
 
 TEST_CASE ("InterpolateFace: face2cell has exactly 2 entries per face")
 
 TEST_CASE ("InterpolateFace: face2cell owner is a valid local cell")
 
 TEST_CASE ("InterpolateFace: face2node indices in valid range")
 
 TEST_CASE ("InterpolateFace: cell2face row sizes match expected face count")
 
 TEST_CASE ("InterpolateFace: cell2face entries are valid face indices")
 
 TEST_CASE ("InterpolateFace: bnd2face maps to valid faces")
 
 TEST_CASE ("InterpolateFace: face element types are valid")
 
 TEST_CASE ("N2CB: every local node has at least one adjacent cell")
 
 TEST_CASE ("N2CB: node2cell entries are valid local indices")
 
 TEST_CASE ("BuildCell2CellFace: row sizes match cell2face")
 
 TEST_CASE ("BuildCell2CellFace: entries are valid cells or negative")
 
 TEST_CASE ("ConstructBndMesh: correct dimensions and state")
 
 TEST_CASE ("ConstructBndMesh: node2parentNode valid")
 
 TEST_CASE ("BuildVTKConnectivity: arrays populated correctly")
 
 TEST_CASE ("ReorderLocalCells: all states preserved")
 
 TEST_CASE ("ReorderLocalCells: cell count preserved")
 
 TEST_CASE ("ReorderLocalCells: partition starts valid")
 
 TEST_CASE ("ReorderLocalCells: cell2node still valid")
 
 TEST_CASE ("ReorderLocalCells: face count preserved")
 
 TEST_CASE ("AdjFacial round-trip: face2node and face2cell identity")
 
 TEST_CASE ("AdjC2F round-trip: cell2face and bnd2face identity")
 
 TEST_CASE ("AdjN2CB round-trip: node2cell and node2bnd identity")
 
 TEST_CASE ("AdjC2CFace round-trip: cell2cellFace identity")
 
 TEST_CASE ("AdjPrimary round-trip: serial-out pattern")
 
 TEST_CASE ("AdjForBnd round-trip: ConstructBndMesh + ForBnd")
 
 TEST_CASE ("Ball2: mixed 3D element types")
 
 TEST_CASE ("Elevation: O2 mesh cell count equals O1 cell count")
 
 TEST_CASE ("Elevation: O2 mesh has more nodes than O1")
 
 TEST_CASE ("Bisection: O1 mesh has more cells than O2")
 
 TEST_CASE ("Bisection: global node count is preserved from O2 mesh")
 
 TEST_CASE ("Elevation+Bisection: exact cell count progression")
 

Detailed Description

Parameterized doctest tests for the full mesh pipeline.

Each mesh configuration (file, dimension, periodic settings, expected counts) is tested through the complete pipeline:

  • Pipeline state tracking: every state variable checked
  • InterpolateFace: face topology, face2cell, bnd2face
  • ReorderLocalCells: cell permutation, partition starts
  • N2CB, C2F, Facial, C2CFace adjacency validation
  • ConstructBndMesh, BuildVTKConnectivity
  • Global count conservation
  • All 5 Adj round-trip inverses (on one mesh config)

Mesh configurations: [0] UniformSquare_10 – 2D, 100 quad cells, non-periodic [1] IV10_10 – 2D, 100 quad cells, periodic (isentropic vortex) [2] NACA0012_H2 – 2D, 20816 unstructured quad cells, non-periodic (airfoil) [3] IV10U_10 – 2D, 322 unstructured tri cells, periodic (isentropic vortex)

Definition in file test_MeshPipeline.cpp.

Macro Definition Documentation

◆ DOCTEST_CONFIG_IMPLEMENT

#define DOCTEST_CONFIG_IMPLEMENT

Definition at line 22 of file test_MeshPipeline.cpp.

◆ FOR_EACH_MESH_CONFIG

#define FOR_EACH_MESH_CONFIG (   body)
Value:
for (int _ci = 0; _ci < N_CONFIGS; _ci++) \
{ \
/* Ball2 (index 4) is only tested with np=8 */ \
if (_ci == 4 && g_mpi.size != 8) continue; \
CAPTURE(_ci); \
const auto &cfg = g_configs[_ci]; \
auto m = g_full[_ci]; \
SUBCASE(cfg.name) { body } \
}
int size
Number of ranks in comm (-1 until initialised).
Definition MPI.hpp:221
if(g_mpi.rank==0) std auto[rhsDensity, rhsEnergy, incL2]

Definition at line 219 of file test_MeshPipeline.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 196 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [1/35]

TEST_CASE ( "AdjC2CFace round-trip: cell2cellFace identity"  )

Definition at line 606 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/35]

TEST_CASE ( "AdjC2F round-trip: cell2face and bnd2face identity"  )

Definition at line 567 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/35]

TEST_CASE ( "AdjFacial round-trip: face2node and face2cell identity"  )

Definition at line 539 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [4/35]

TEST_CASE ( "AdjForBnd round-trip: ConstructBndMesh + ForBnd"  )

Definition at line 659 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [5/35]

TEST_CASE ( "AdjN2CB round-trip: node2cell and node2bnd identity"  )

Definition at line 587 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [6/35]

TEST_CASE ( "AdjPrimary round-trip: serial-out pattern"  )

Definition at line 623 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [7/35]

TEST_CASE ( "Ball2: mixed 3D element types"  )

Definition at line 691 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [8/35]

TEST_CASE ( "Bisection: global node count is preserved from O2 mesh"  )

Definition at line 949 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [9/35]

TEST_CASE ( "Bisection: O1 mesh has more cells than O2"  )

Definition at line 891 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [10/35]

TEST_CASE ( "BuildCell2CellFace: entries are valid cells or negative"  )

Definition at line 401 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [11/35]

TEST_CASE ( "BuildCell2CellFace: row sizes match cell2face"  )

Definition at line 393 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [12/35]

TEST_CASE ( "BuildVTKConnectivity: arrays populated correctly"  )

Definition at line 450 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [13/35]

TEST_CASE ( "ConstructBndMesh: correct dimensions and state"  )

Definition at line 417 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [14/35]

TEST_CASE ( "ConstructBndMesh: node2parentNode valid"  )

Definition at line 430 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [15/35]

TEST_CASE ( "Elevation+Bisection: exact cell count progression"  )

Definition at line 999 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [16/35]

TEST_CASE ( "Elevation: O2 mesh cell count equals O1 cell count"  )

Definition at line 787 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [17/35]

TEST_CASE ( "Elevation: O2 mesh has more nodes than O1"  )

Definition at line 843 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [18/35]

TEST_CASE ( "InterpolateFace: bnd2face maps to valid faces"  )

Definition at line 340 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [19/35]

TEST_CASE ( "InterpolateFace: cell2face entries are valid face indices"  )

Definition at line 326 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [20/35]

TEST_CASE ( "InterpolateFace: cell2face row sizes match expected face count"  )

Definition at line 314 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [21/35]

TEST_CASE ( "InterpolateFace: face count is positive"  )

Definition at line 272 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [22/35]

TEST_CASE ( "InterpolateFace: face element types are valid"  )

Definition at line 353 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [23/35]

TEST_CASE ( "InterpolateFace: face2cell has exactly 2 entries per face"  )

Definition at line 279 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [24/35]

TEST_CASE ( "InterpolateFace: face2cell owner is a valid local cell"  )

Definition at line 287 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [25/35]

TEST_CASE ( "InterpolateFace: face2node indices in valid range"  )

Definition at line 300 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [26/35]

TEST_CASE ( "N2CB: every local node has at least one adjacent cell"  )

Definition at line 363 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [27/35]

TEST_CASE ( "N2CB: node2cell entries are valid local indices"  )

Definition at line 377 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [28/35]

TEST_CASE ( "Pipeline: all five states are Local"  )

Definition at line 232 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [29/35]

TEST_CASE ( "Pipeline: global bnd count matches expected"  )

Definition at line 257 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [30/35]

TEST_CASE ( "Pipeline: global cell count matches expected"  )

Definition at line 245 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [31/35]

TEST_CASE ( "ReorderLocalCells: all states preserved"  )

Definition at line 467 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [32/35]

TEST_CASE ( "ReorderLocalCells: cell count preserved"  )

Definition at line 479 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [33/35]

TEST_CASE ( "ReorderLocalCells: cell2node still valid"  )

Definition at line 506 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [34/35]

TEST_CASE ( "ReorderLocalCells: face count preserved"  )

Definition at line 521 of file test_MeshPipeline.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [35/35]

TEST_CASE ( "ReorderLocalCells: partition starts valid"  )

Definition at line 493 of file test_MeshPipeline.cpp.

Here is the call graph for this function: