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

Comprehensive doctest-based unit tests for element traits and shape functions. More...

#include "doctest.h"
#include "Geom/Elements.hpp"
#include "Geom/Quadrature.hpp"
#include <cmath>
#include <random>
#include <array>
#include <iostream>
#include <set>
Include dependency graph for test_Elements.cpp:

Go to the source code of this file.

Macros

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
 

Functions

 TEST_CASE ("ElementTraits: basic identification fields are consistent")
 
 TEST_CASE ("ElementTraits: standard coordinates have correct dimensions")
 
 TEST_CASE ("ElementTraits: face definitions are consistent for 2D elements")
 
 TEST_CASE ("ElementTraits: face definitions are consistent for 3D elements")
 
 TEST_CASE ("ElementTraits: ExtractFaceNodes works correctly")
 
 TEST_CASE ("ElementTraits: order elevation data is consistent for O1 elements")
 
 TEST_CASE ("ElementTraits: order elevation data for specific elements")
 
 TEST_CASE ("ElementTraits: O2 elements do not have further elevation")
 
 TEST_CASE ("ElementTraits: ExtractElevNodeSpanNodes works correctly")
 
 TEST_CASE ("ElementTraits: bisection data is valid for O2 elements")
 
 TEST_CASE ("ElementTraits: VTK conversion works correctly")
 
 TEST_CASE ("ElementTraits: VTK node order is a valid permutation for simple elements")
 
 TEST_CASE ("Shape functions: partition of unity")
 

Detailed Description

Comprehensive doctest-based unit tests for element traits and shape functions.

Tests cover: A. ElementTraits data integrity:

  1. Basic identification fields (elemType, dim, order, etc.)
  2. Standard coordinates consistency
  3. Face definitions (GetFaceType, faceNodes)
  4. Order elevation (elevatedType, elevSpans, elevNodeSpanTypes)
  5. Bisection refinement (numBisect, bisectElements)
  6. VTK compatibility (vtkCellType, vtkNodeOrder)

B. Shape function correctness:

  1. Partition of unity: sum_j N_j(p) == 1
  2. Nodal interpolation: N_i(node_j) == delta_ij
  3. First derivative consistency (FD vs analytic)
  4. Second derivative consistency (FD of D1)

This is a serial test (no MPI required).

Definition in file test_Elements.cpp.

Macro Definition Documentation

◆ DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

Definition at line 23 of file test_Elements.cpp.

Function Documentation

◆ TEST_CASE() [1/13]

TEST_CASE ( "ElementTraits: basic identification fields are consistent"  )

Definition at line 131 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/13]

TEST_CASE ( "ElementTraits: bisection data is valid for O2 elements"  )

Definition at line 365 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/13]

TEST_CASE ( "ElementTraits: ExtractElevNodeSpanNodes works correctly"  )

Definition at line 347 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [4/13]

TEST_CASE ( "ElementTraits: ExtractFaceNodes works correctly"  )

Definition at line 233 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [5/13]

TEST_CASE ( "ElementTraits: face definitions are consistent for 2D elements"  )

Definition at line 187 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [6/13]

TEST_CASE ( "ElementTraits: face definitions are consistent for 3D elements"  )

Definition at line 210 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [7/13]

TEST_CASE ( "ElementTraits: O2 elements do not have further elevation"  )

Definition at line 333 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [8/13]

TEST_CASE ( "ElementTraits: order elevation data for specific elements"  )

Definition at line 298 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [9/13]

TEST_CASE ( "ElementTraits: order elevation data is consistent for O1 elements"  )

Definition at line 274 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [10/13]

TEST_CASE ( "ElementTraits: standard coordinates have correct dimensions"  )

Definition at line 152 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [11/13]

TEST_CASE ( "ElementTraits: VTK conversion works correctly"  )

Definition at line 420 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [12/13]

TEST_CASE ( "ElementTraits: VTK node order is a valid permutation for simple elements"  )

Definition at line 445 of file test_Elements.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [13/13]

TEST_CASE ( "Shape functions: partition of unity"  )

Definition at line 488 of file test_Elements.cpp.

Here is the call graph for this function: