DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
Loading...
Searching...
No Matches
test_MeshConnectivity_Ghost.cpp File Reference

Unit tests for ghost chain types, compilation, and BFS evaluation. More...

#include "doctest.h"
#include "SyntheticMeshBuilders.hpp"
#include "Geom/Mesh/MeshConnectivity.hpp"
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <unordered_set>
Include dependency graph for test_MeshConnectivity_Ghost.cpp:

Go to the source code of this file.

Classes

struct  SyntheticTiledGrid
 

Macros

#define DOCTEST_CONFIG_IMPLEMENT
 

Functions

 TEST_CASE ("GhostChain: defaultPrimary compiles")
 
 TEST_CASE ("GhostChain: prefix merging")
 
 TEST_CASE ("GhostChain: invalid chain detection")
 
 TEST_CASE ("GhostChain: checkAvailable")
 
 TEST_CASE ("GhostChain: dump")
 
 TEST_CASE ("GhostChain: face ghost chain")
 
 TEST_CASE ("GhostChain: AdjKind equality and hash")
 
 TEST_CASE ("GhostChain: entityDepth")
 
 TEST_CASE ("GhostChain: adjKindName")
 
 TEST_CASE ("evaluateGhostTree: performance benchmark")
 
 TEST_CASE ("evaluateGhostTree: single hop cell2cell")
 
 TEST_CASE ("evaluateGhostTree: two-hop cell2cell2node with manual ghost")
 
 TEST_CASE ("evaluateGhostTree: 2-ring cell chain")
 
 TEST_CASE ("evaluateGhostTree: union of multiple chains")
 
 TEST_CASE ("evaluateGhostTree: np=1 produces no ghosts")
 
 TEST_CASE ("evaluateGhostTree: doubly-periodic tiled grid")
 
 TEST_CASE ("evaluateGhostTree: small periodic tiled grid")
 
int main (int argc, char **argv)
 

Detailed Description

Unit tests for ghost chain types, compilation, and BFS evaluation.

Tests:

  • GhostChain: defaultPrimary compiles into correct tree structure
  • GhostChain: prefix merging (shared trie paths)
  • GhostChain: invalid chain detection (empty, mismatch)
  • GhostChain: checkAvailable (missing adjacency detection)
  • GhostChain: dump (diagnostic output)
  • GhostChain: face ghost chain
  • AdjKind: equality and hash (direct vs intra-level)
  • entityDepth: 2D and 3D
  • adjKindName: formatted names
  • evaluateGhostTree: single hop cell2cell
  • evaluateGhostTree: two-hop cell2cell2node with manual ghost
  • evaluateGhostTree: 2-ring cell chain
  • evaluateGhostTree: union of multiple chains
  • evaluateGhostTree: np=1 produces no ghosts
  • evaluateGhostTree: performance benchmark (NxN grids with correctness)

Running: cmake –build build -t geom_test_mesh_connectivity_ghost -j8 ctest –test-dir build -R geom_mesh_connectivity_ghost –output-on-failure

Running benchmark only: mpirun -np 2 ./build/test/cpp/geom_test_mesh_connectivity_ghost -tc="*performance*" mpirun -np 4 ./build/test/cpp/geom_test_mesh_connectivity_ghost -tc="*performance*"

The benchmark generates synthetic NxN quad grids (N=100,500,1000), verifies exact ghost cell counts against analytical expectations, and prints timing for 1-hop (cell2cell) and 2-hop (cell2cell + cell2node) ghost evaluation.

Definition in file test_MeshConnectivity_Ghost.cpp.

Macro Definition Documentation

◆ DOCTEST_CONFIG_IMPLEMENT

#define DOCTEST_CONFIG_IMPLEMENT

Definition at line 36 of file test_MeshConnectivity_Ghost.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1050 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [1/17]

TEST_CASE ( "evaluateGhostTree: 2-ring cell chain"  )

Definition at line 781 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/17]

TEST_CASE ( "evaluateGhostTree: doubly-periodic tiled grid"  )

Generate a doubly-periodic NxN-per-rank tiled grid.

Tiled rectangular grid with optional periodic wrapping in both directions. 2D rank decomposition per sqrt(np); falls back to 1×np when not factorable.

Definition at line 937 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/17]

TEST_CASE ( )

Definition at line 909 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [4/17]

TEST_CASE ( "evaluateGhostTree: performance benchmark"  )

Definition at line 573 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [5/17]

TEST_CASE ( "evaluateGhostTree: single hop cell2cell"  )

Definition at line 642 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [6/17]

TEST_CASE ( "evaluateGhostTree: small periodic tiled grid"  )

Definition at line 999 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [7/17]

TEST_CASE ( "evaluateGhostTree: two-hop cell2cell2node with manual ghost"  )

Definition at line 692 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [8/17]

TEST_CASE ( "evaluateGhostTree: union of multiple chains"  )

Definition at line 824 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [9/17]

TEST_CASE ( "GhostChain: AdjKind equality and hash"  )

Definition at line 300 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [10/17]

TEST_CASE ( "GhostChain: adjKindName"  )

Definition at line 334 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [11/17]

TEST_CASE ( "GhostChain: checkAvailable"  )

Definition at line 245 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [12/17]

TEST_CASE ( "GhostChain: defaultPrimary compiles"  )

Definition at line 112 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [13/17]

TEST_CASE ( "GhostChain: dump"  )

Definition at line 265 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [14/17]

TEST_CASE ( "GhostChain: entityDepth"  )

Definition at line 319 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [15/17]

TEST_CASE ( "GhostChain: face ghost chain"  )

Definition at line 277 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [16/17]

TEST_CASE ( "GhostChain: invalid chain detection"  )

Definition at line 218 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [17/17]

TEST_CASE ( "GhostChain: prefix merging"  )

Definition at line 190 of file test_MeshConnectivity_Ghost.cpp.

Here is the call graph for this function: