Nektar++
Loading...
Searching...
No Matches
Classes | Macros
TestFusedElmt.hpp File Reference
#include <UnitTests/MultiRegions/TestOp.hpp>
#include <MultiRegions/ElmtOps/IProductWRTDerivBase/IProductWRTDerivBaseOp.hpp>
#include <MultiRegions/ElmtOps/PhysDeriv/PhysDerivOp.hpp>
#include <MultiRegions/ElmtOps/PhysTraceExtract/PhysTraceExtractOp.hpp>
#include <SolverCore/AdvDiffusion/AdvDiffFusedElmt/AdvDiffFusedElmtOp.hpp>
#include <SolverCore/Advection/AdvectionFusedElmt/AdvectionFusedElmtOp.hpp>
#include <UnitTests/SolverCore/TestFusedElmtPolicies.hpp>
#include <cmath>
#include <limits>
#include <string>
#include <type_traits>
#include <vector>

Go to the source code of this file.

Classes

class  TestFusedElmt< Policy, VISCOUS >
 A fused element-local operator against the separate operators it replaces, for the flux policy Policy, on the mesh of the derived fixture with its expansions replaced: every element of the given expansion type, number of modes and number of points per direction. More...
 

Macros

#define TEST_FUSEDELMT_FIXTURE(type, policy, viscous, filename)
 A fixture for policy on the mesh filename, testing the advection-diffusion operator for viscous and the advection one otherwise.
 
#define TEST_FUSEDELMT_CASE(test_name, test, tol)
 
#define TEST_FUSEDELMT_DEFAULT_CASE(test_name, test)
 

Macro Definition Documentation

◆ TEST_FUSEDELMT_CASE

#define TEST_FUSEDELMT_CASE (   test_name,
  test,
  tol 
)
Value:
BOOST_FIXTURE_TEST_CASE(test_name, test) \
{ \
std::cout << std::string("Run: ") + std::string(#test_name) \
<< std::endl; \
const bool orderZero = !HasDeformedQuad(); \
for (const auto type : \
{ \
const int minModes = \
type == SpatialDomains::eOrthogonal && orderZero ? 1 : 2; \
for (int nmodes = minModes; nmodes <= 9; ++nmodes) \
{ \
for (const int npts : {-1, nmodes + 1}) \
{ \
const bool match = RunExpansion(type, nmodes, npts, tol); \
if (!match) \
{ \
std::cout << "Failed: type " << type << ", modes " \
<< nmodes << ", points " << npts \
<< std::endl; \
} \
BOOST_TEST(match); \
} \
} \
} \
}

Definition at line 681 of file TestFusedElmt.hpp.

683 { \
684 std::cout << std::string("Run: ") + std::string(#test_name) \
685 << std::endl; \
686 const bool orderZero = !HasDeformedQuad(); \
687 for (const auto type : \
689 { \
690 const int minModes = \
691 type == SpatialDomains::eOrthogonal && orderZero ? 1 : 2; \
692 for (int nmodes = minModes; nmodes <= 9; ++nmodes) \
693 { \
694 for (const int npts : {-1, nmodes + 1}) \
695 { \
696 const bool match = RunExpansion(type, nmodes, npts, tol); \
697 if (!match) \
698 { \
699 std::cout << "Failed: type " << type << ", modes " \
700 << nmodes << ", points " << npts \
701 << std::endl; \
702 } \
703 BOOST_TEST(match); \
704 } \
705 } \
706 } \
707 }

◆ TEST_FUSEDELMT_DEFAULT_CASE

#define TEST_FUSEDELMT_DEFAULT_CASE (   test_name,
  test 
)
Value:
BOOST_FIXTURE_TEST_CASE(test_name, test) \
{ \
std::cout << std::string("Run: ") + std::string(#test_name) \
<< std::endl; \
for (int nmodes = 2; nmodes <= 9; ++nmodes) \
{ \
BOOST_TEST( \
DefaultImplementation(SpatialDomains::eModified, nmodes)); \
} \
}

Definition at line 711 of file TestFusedElmt.hpp.

713 { \
714 std::cout << std::string("Run: ") + std::string(#test_name) \
715 << std::endl; \
716 for (int nmodes = 2; nmodes <= 9; ++nmodes) \
717 { \
718 BOOST_TEST( \
719 DefaultImplementation(SpatialDomains::eModified, nmodes)); \
720 } \
721 }

◆ TEST_FUSEDELMT_FIXTURE

#define TEST_FUSEDELMT_FIXTURE (   type,
  policy,
  viscous,
  filename 
)
Value:
class type \
: public TestFusedElmt<Nektar::UnitTests::policy, viscous> \
{ \
public: \
type() \
{ \
meshName = filename; \
} \
};
A fused element-local operator against the separate operators it replaces, for the flux policy Policy...

A fixture for policy on the mesh filename, testing the advection-diffusion operator for viscous and the advection one otherwise.

Definition at line 663 of file TestFusedElmt.hpp.

666 { \
667 public: \
668 type() \
669 { \
670 meshName = filename; \
671 } \
672 };