|
DNDSR 0.2.1
Distributed Numeric Data Structure for CFV
|
Unit tests for MeshConnectivity DSL operations: Inverse, Compose, ComposeFiltered. Also tests MeshConnectivity struct management (cone/support). More...
#include "doctest.h"#include "SyntheticMeshBuilders.hpp"#include "Geom/Mesh/MeshConnectivity.hpp"#include "Geom/Mesh/Mesh.hpp"#include <string>#include <vector>#include <set>#include <algorithm>#include <unordered_set>#include <numeric>Go to the source code of this file.
Macros | |
| #define | DOCTEST_CONFIG_IMPLEMENT |
Functions | |
| TEST_CASE ("Inverse: 4-quad serial correctness") | |
| TEST_CASE ("Inverse: round-trip covers original cell2node") | |
| TEST_CASE ("ComposeFiltered: 4-quad cell2cell via node-neighbor") | |
| c2n father | createGlobalMapping () |
| for (DNDS::index iCell=0;iCell< nCellLocal;iCell++) for(auto iNode | |
| std::vector< DNDS::index > | ghostNodes (ghostNodeSet.begin(), ghostNodeSet.end()) |
| n2c | TransAttach () |
| n2c trans | createFatherGlobalMapping () |
| n2c trans | createGhostMapping (ghostNodes) |
| n2c trans | createMPITypes () |
| n2c trans | pullOnce () |
| std::vector< std::set< DNDS::index > > | globalC2CFace (4) |
| TEST_CASE ("Regression: Inverse matches RecoverNode2CellAndNode2Bnd on UniformSquare_10") | |
| TEST_CASE ("Regression: ComposeFiltered matches RecoverCell2CellAndBnd2Cell on UniformSquare_10") | |
| TEST_CASE ("MeshConnectivity: cone management") | |
| TEST_CASE ("MeshConnectivity: support management") | |
| TEST_CASE ("ConeAdj: AdjVariant typed access") | |
| TEST_CASE ("SupportAdj: no pbi member") | |
| TEST_CASE ("Inverse<2>: fixed-width face2cell input") | |
| TEST_CASE ("narrowAdjToFixed: variable-to-fixed-2 conversion") | |
| TEST_CASE ("Periodic 2x2x2: ComposeFiltered cell2cellFace is WRONG without pbi filter") | |
| int | main (int argc, char **argv) |
Variables | |
| auto | nodeGM = makeNodeGlobalMapping4Quad(g_mpi) |
| DNDS::index | nNodeLocal = nodeLocalCount4Quad(g_mpi) |
| DNDS::index | nCellLocal = c2n.father->Size() |
| auto | n2c |
| std::unordered_set< DNDS::index > | ghostNodeSet |
| n2c | son = make_ssp<decltype(n2c.son)::element_type>(ObjName{"n2c.son"}, g_mpi) |
| std::unordered_map< DNDS::index, DNDS::index > | nodeG2L |
| auto | c2c_face |
| std::vector< std::set< DNDS::index > > | expected |
Unit tests for MeshConnectivity DSL operations: Inverse, Compose, ComposeFiltered. Also tests MeshConnectivity struct management (cone/support).
Definition in file test_MeshConnectivity.cpp.
| #define DOCTEST_CONFIG_IMPLEMENT |
Definition at line 7 of file test_MeshConnectivity.cpp.
| n2c trans createGhostMapping | ( | ghostNodes | ) |
| c2n father createGlobalMapping | ( | ) |
| for | ( | ) |
Definition at line 273 of file test_MeshConnectivity.cpp.
| std::vector< DNDS::index > ghostNodes | ( | ghostNodeSet. | begin(), |
| ghostNodeSet. | end() | ||
| ) |
| std::vector< std::set< DNDS::index > > globalC2CFace | ( | 4 | ) |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Verify that cell2cellFace on periodic meshes should be derived from Interpolate (face→cell), not from ComposeFiltered. The compose-based approach cannot correctly distinguish face-neighbors from non-face-neighbors when all cells share all nodes (as on 2×2 doubly-periodic or 2×2×2 triply-periodic meshes).
The correct cell2cellFace derivation is tested in "Periodic 2x2: cell2face from Interpolate" and "Periodic 2x2x2: face interpolation" tests above.
Definition at line 810 of file test_MeshConnectivity.cpp.
| TEST_CASE | ( | "ComposeFiltered: 4-quad cell2cell via node-neighbor" | ) |
| TEST_CASE | ( | "ConeAdj: AdjVariant typed access" | ) |
| TEST_CASE | ( | "Inverse: 4-quad serial correctness" | ) |
| TEST_CASE | ( | "Inverse: round-trip covers original cell2node" | ) |
| TEST_CASE | ( | "Inverse<2>: fixed-width face2cell input" | ) |
| TEST_CASE | ( | "MeshConnectivity: cone management" | ) |
| TEST_CASE | ( | "MeshConnectivity: support management" | ) |
| TEST_CASE | ( | "narrowAdjToFixed: variable-to-fixed-2 conversion" | ) |
| TEST_CASE | ( | "Periodic 2x2x2: ComposeFiltered cell2cellFace is WRONG without pbi filter" | ) |
| TEST_CASE | ( | "Regression: ComposeFiltered matches RecoverCell2CellAndBnd2Cell on UniformSquare_10" | ) |
| TEST_CASE | ( | "Regression: Inverse matches RecoverNode2CellAndNode2Bnd on UniformSquare_10" | ) |
Build a mesh through the legacy pipeline up to node2cell state, then compare with DSL Inverse.
Definition at line 356 of file test_MeshConnectivity.cpp.
| TEST_CASE | ( | "SupportAdj: no pbi member" | ) |
| cellElemInfo TransAttach | ( | ) |
| auto c2c_face |
Definition at line 294 of file test_MeshConnectivity.cpp.
| std::vector<std::set<DNDS::index> > expected |
Definition at line 331 of file test_MeshConnectivity.cpp.
| std::unordered_set<DNDS::index> ghostNodeSet |
Definition at line 272 of file test_MeshConnectivity.cpp.
| auto n2c |
Definition at line 263 of file test_MeshConnectivity.cpp.
| DNDS::index nCellLocal = c2n.father->Size() |
Definition at line 261 of file test_MeshConnectivity.cpp.
| DNDS::index nNodeLocal = nodeLocalCount4Quad(g_mpi) |
Definition at line 260 of file test_MeshConnectivity.cpp.
| std::unordered_map<DNDS::index, DNDS::index> nodeG2L |
Definition at line 289 of file test_MeshConnectivity.cpp.
| auto nodeGM = makeNodeGlobalMapping4Quad(g_mpi) |
Definition at line 258 of file test_MeshConnectivity.cpp.
Definition at line 282 of file test_MeshConnectivity.cpp.