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

Unit tests for standalone limiter functions in CFV/Limiters.hpp. More...

#include "doctest.h"
#include "CFV/Limiters.hpp"
#include <Eigen/Core>
#include <cmath>
#include <vector>
Include dependency graph for test_Limiters.cpp:

Go to the source code of this file.

Macros

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
 

Functions

 theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 > (theta)
 
 CHECK (result.size()==3)
 
 CHECK (result(0)==doctest::Approx(1.0+16.0))
 
 CHECK (result(1)==doctest::Approx(4.0+25.0))
 
 CHECK (result(2)==doctest::Approx(9.0+36.0))
 
 theta<< 2.0, 1.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 > (theta)
 
 theta<< 1.0, 2.0, 3.0, 4.0;auto result=PolynomialSquaredNorm< 2 > (theta)
 
 theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 3 > (theta)
 
 for (int i=0;i< 10;i++) theta(i = theta(i, 0) * theta(i, 0)
 
 TEST_CASE ("PolynomialDotProduct<2> self-product equals PolynomialSquaredNorm")
 
 TEST_CASE ("PolynomialDotProduct<2> linearity")
 
 TEST_CASE ("FMINMOD_Biway: same-sign inputs")
 
 TEST_CASE ("FMINMOD_Biway: opposite-sign inputs produce zero")
 
 TEST_CASE ("FMINMOD_Biway: zero input")
 
 TEST_CASE ("FVanLeer_Biway: same-sign inputs")
 
 TEST_CASE ("FVanLeer_Biway: opposite-sign produces zero")
 
 TEST_CASE ("FVanLeer_Biway: equal inputs return same value")
 
 TEST_CASE ("FWBAP_L2_Biway: identical inputs pass through")
 
 TEST_CASE ("FWBAP_L2_Biway: no NaN for random inputs")
 
 TEST_CASE ("FWBAP_L2_Biway: output bounded by inputs for same-sign")
 
 TEST_CASE ("FWBAP_L2_Cut_Biway: opposite-sign cut to zero")
 
 TEST_CASE ("FWBAP_L2_Cut_Biway: no NaN")
 
 TEST_CASE ("FWBAP_L2_Multiway: all identical inputs pass through")
 
 TEST_CASE ("FWBAP_L2_Multiway: no NaN for random inputs")
 
 TEST_CASE ("FWBAP_L2_Multiway_Polynomial2D: all identical pass through")
 

Variables

real expected = 0
 
auto result = PolynomialSquaredNorm<3>(theta)
 

Detailed Description

Unit tests for standalone limiter functions in CFV/Limiters.hpp.

Tests cover:

  • PolynomialSquaredNorm<2> and <3> for all supported row counts
  • PolynomialDotProduct<2> for all supported row counts
  • FWBAP_L2_Biway: sign preservation, identical-input pass-through, NaN-free
  • FWBAP_L2_Cut_Biway: sign preservation with cutting
  • FMINMOD_Biway: classical minmod properties
  • FVanLeer_Biway: classical Van-Leer limiter properties
  • FWBAP_L2_Multiway: multi-stencil weighted averaging
  • FWBAP_L2_Multiway_Polynomial2D: polynomial-norm weighted multi-stencil
  • FWBAP_L2_Multiway_PolynomialOrth: orthogonal polynomial multi-stencil
  • FWBAP_L2_Biway_PolynomialNorm<2>: polynomial-norm biway
  • FMEMM_Biway_PolynomialNorm<2>: MEMM biway
  • FMEMM_Multiway_Polynomial2D: MEMM multi-stencil
  • FWBAP_L2_Biway_PolynomialOrth: orthogonal biway

Definition in file test_Limiters.cpp.

Macro Definition Documentation

◆ DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

Definition at line 21 of file test_Limiters.cpp.

Function Documentation

◆ CHECK() [1/4]

CHECK ( result(0)  = =doctest::Approx(1.0+16.0))

◆ CHECK() [2/4]

CHECK ( result(1)  = =doctest::Approx(4.0+25.0))

◆ CHECK() [3/4]

CHECK ( result(2)  = =doctest::Approx(9.0+36.0))

◆ CHECK() [4/4]

CHECK ( result.  size() = =3)

◆ for()

for ( ) = theta(i, 0) * theta(i, 0)

Definition at line 266 of file test_Direct.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [1/16]

TEST_CASE ( "FMINMOD_Biway: opposite-sign inputs produce zero"  )

Definition at line 178 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [2/16]

TEST_CASE ( "FMINMOD_Biway: same-sign inputs"  )

Definition at line 161 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [3/16]

TEST_CASE ( "FMINMOD_Biway: zero input"  )

Definition at line 191 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [4/16]

TEST_CASE ( "FVanLeer_Biway: equal inputs return same value"  )

Definition at line 229 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [5/16]

TEST_CASE ( "FVanLeer_Biway: opposite-sign produces zero"  )

Definition at line 219 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [6/16]

TEST_CASE ( "FVanLeer_Biway: same-sign inputs"  )

Definition at line 205 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [7/16]

TEST_CASE ( "FWBAP_L2_Biway: identical inputs pass through"  )

Definition at line 244 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [8/16]

TEST_CASE ( "FWBAP_L2_Biway: no NaN for random inputs"  )

Definition at line 259 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [9/16]

TEST_CASE ( "FWBAP_L2_Biway: output bounded by inputs for same-sign"  )

Definition at line 268 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [10/16]

TEST_CASE ( "FWBAP_L2_Cut_Biway: no NaN"  )

Definition at line 302 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [11/16]

TEST_CASE ( "FWBAP_L2_Cut_Biway: opposite-sign cut to zero"  )

Definition at line 289 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [12/16]

TEST_CASE ( "FWBAP_L2_Multiway: all identical inputs pass through"  )

Definition at line 315 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [13/16]

TEST_CASE ( "FWBAP_L2_Multiway: no NaN for random inputs"  )

Definition at line 332 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [14/16]

TEST_CASE ( "FWBAP_L2_Multiway_Polynomial2D: all identical pass through"  )

Definition at line 350 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [15/16]

TEST_CASE ( "PolynomialDotProduct<2> linearity"  )

Definition at line 135 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ TEST_CASE() [16/16]

TEST_CASE ( "PolynomialDotProduct<2> self-product equals PolynomialSquaredNorm"  )

Definition at line 118 of file test_Limiters.cpp.

Here is the call graph for this function:

◆ theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 >()

theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 > ( theta  )

◆ theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 3 >()

theta<< 1.0, 2.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 3 > ( theta  )

◆ theta<< 1.0, 2.0, 3.0, 4.0;auto result=PolynomialSquaredNorm< 2 >()

theta<< 1.0, 2.0, 3.0, 4.0;auto result=PolynomialSquaredNorm< 2 > ( theta  )

◆ theta<< 2.0, 1.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 >()

theta<< 2.0, 1.0, 3.0, 4.0, 5.0, 6.0;auto result=PolynomialSquaredNorm< 2 > ( theta  )

Variable Documentation

◆ expected

expected = 0

Definition at line 104 of file test_Limiters.cpp.

◆ result

auto result = PolynomialSquaredNorm<3>(theta)

Definition at line 110 of file test_Limiters.cpp.