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

Phase-0 regression tests for CFV Variational Reconstruction. More...

#include "doctest.h"
#include "CFV/VariationalReconstruction.hpp"
#include <array>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <functional>
#include <nlohmann/json.hpp>
#include <map>
#include <string>
#include <vector>
#include "CFV/VariationalReconstruction_LimiterProcedure.hxx"
Include dependency graph for test_Reconstruction.cpp:

Go to the source code of this file.

Classes

struct  PeriodicTestCase
 
struct  LimiterTestCase
 

Macros

#define DOCTEST_CONFIG_IMPLEMENT
 
#define POLY_TEST(testName, method, polyFunc, polyDeg)
 

Typedefs

using tVR = CFV::VariationalReconstruction< g_dim >
 
using ScalarFunc = std::function< DNDS::real(const tPoint &)>
 

Enumerations

enum class  RecMethod {
  GaussGreen , VFV_P1_HQM , VFV_P2_HQM , VFV_P3_HQM ,
  VFV_P1_Default , VFV_P2_Default , VFV_P3_Default
}
 

Functions

int main (int argc, char **argv)
 
 TEST_CASE ("Periodic reconstruction convergence series")
 
 TEST_CASE ("VFV P2 HQM converges on IV10 base mesh")
 
 TEST_CASE ("Limiter procedure: reconstruction + smooth indicator + WBAP limiter")
 

Detailed Description

Phase-0 regression tests for CFV Variational Reconstruction.

Parameterized over [mesh+function, reconstruction_method].

All iterative VR uses Jacobi iteration (SORInstead=false) so that golden values are deterministic across MPI partitionings (np=1,2,4).

Error metric: L1 pointwise error at 6th-degree quadrature points, divided by domain volume (so the dimension matches the field function).

Meshes:

  • Uniform_3x3_wall (9 quads, wall BC) – polynomial exactness tests
  • IV10_10 (100 quads, periodic) + bisections -> 400, 1600 cells
  • IV10U_10 (322 tris, periodic) + bisections -> ~1288, ~5152 cells

Golden values captured from commit c774b89 on dev/harry_refac1.

Definition in file test_Reconstruction.cpp.

Macro Definition Documentation

◆ DOCTEST_CONFIG_IMPLEMENT

#define DOCTEST_CONFIG_IMPLEMENT

Definition at line 21 of file test_Reconstruction.cpp.

◆ POLY_TEST

#define POLY_TEST (   testName,
  method,
  polyFunc,
  polyDeg 
)
Value:
TEST_CASE("Wall/" testName "/" #method) \
{ \
ScalarFunc f = polyFunc; \
auto vr = buildVR(g_wall_mesh, RecMethod::method); \
auto bc = makeDirichletBC(f); \
DNDS::real err = runTest(vr, RecMethod::method, f, bc, 100, 1e-15, false); \
if (g_mpi.rank == 0) \
std::cout << "[Wall/" testName "/" #method "] err = " \
<< std::scientific << err << std::endl; \
if (polyDeg == 0) \
CHECK(err < 1e-12); \
else \
CHECK(err < 10.0); /* golden-value regression checked separately */ \
}
double real
Canonical floating-point scalar used throughout DNDSR (double precision).
Definition Defines.hpp:105
int rank
This rank's 0-based index within comm (-1 until initialised).
Definition MPI.hpp:219
real err
TEST_CASE("3D: VFV P2 HQM error < P1 on sinCos3D")
std::function< DNDS::real(const tPoint &)> ScalarFunc

Definition at line 435 of file test_Reconstruction.cpp.

Typedef Documentation

◆ ScalarFunc

using ScalarFunc = std::function<DNDS::real(const tPoint &)>

Definition at line 213 of file test_Reconstruction.cpp.

◆ tVR

using tVR = CFV::VariationalReconstruction<g_dim>

Definition at line 41 of file test_Reconstruction.cpp.

Enumeration Type Documentation

◆ RecMethod

enum class RecMethod
strong
Enumerator
GaussGreen 
VFV_P1_HQM 
VFV_P2_HQM 
VFV_P3_HQM 
VFV_P1_Default 
VFV_P2_Default 
VFV_P3_Default 

Definition at line 120 of file test_Reconstruction.cpp.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 380 of file test_Reconstruction.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [1/3]

TEST_CASE ( "Limiter procedure: reconstruction + smooth indicator + WBAP limiter"  )

Definition at line 796 of file test_Reconstruction.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/3]

TEST_CASE ( "Periodic reconstruction convergence series"  )

Definition at line 529 of file test_Reconstruction.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/3]

TEST_CASE ( "VFV P2 HQM converges on IV10 base mesh"  )

Definition at line 566 of file test_Reconstruction.cpp.

Here is the call graph for this function: