|
Nektar++
|
#include <TestNormOps.hpp>
Public Member Functions | |
| TestNormOps ()=default | |
| ~TestNormOps ()=default | |
| void | Configure () |
| Read the session, build the expansion list and allocate the field the test cases work on. | |
| void | Configure3DH1 (const unsigned int nhomo) |
| As Configure, on a 3DH1 expansion list with nhomo planes. | |
| void | SetTestCase () |
| Fill the input field with an analytic expression and record the norms it is expected to have. | |
| void | RunTestCase () |
| Apply the norm operators, once on the non-interleaved storage reduced to every rank and once on the interleaved storage reduced to rank zero alone. | |
| bool | Compare (const TData tol) |
| Compare both sets of norms against the expected ones, with absolute tolerance tol. | |
Protected Member Functions | |
| void | SetSession () |
| void | SetExpList () |
| void | SetExpList3DH1 () |
| void | SetFixture () |
| void | ExpectedSolution () |
| The oracle: the norms the expansion list computes from the same data, independently of the operators under test. | |
Protected Attributes | |
| std::string | m_meshName = "" |
| unsigned int | m_nhomo = 1 |
| Number of planes; 1 without a homogeneous direction. | |
| SessionReaderSharedPtr | m_session |
| ExpListSharedPtr | m_expList |
| Field< TData, FieldState::Phys > | m_in |
| std::vector< TData > | m_l2Test |
| std::vector< TData > | m_linfTest |
| std::vector< TData > | m_l2Test2 |
| std::vector< TData > | m_linfTest2 |
| std::vector< TData > | m_l2NormalisedTest |
| std::vector< TData > | m_l2NormalisedTest2 |
| std::vector< TData > | m_l2Expected |
| std::vector< TData > | m_l2NormalisedExpected |
| std::vector< TData > | m_linfExpected |
Static Protected Attributes | |
| static constexpr double | m_homoLen = 2.0 |
| Homogeneous length of the 3DH1 cases, other than 1 so that it shows. | |
A test fixture that fills a physical-space field with an analytic expression and checks NormL2Op (plain and normalised by the mesh volume) and NormLinfOp against the norms the expansion list computes itself, both for the non-interleaved storage and for the interleaved storage the vectorised and device paths use. The 3DH1 cases give every plane its own data, so the norms depend on how the planes are combined.
The fixture constructor (destructor) is called before (after) each call to the BOOST_FIXTURE_TEST_CASE(<test name>, <fixture>) macro.
See "Single test case fixture" on the Boost.Test documentation for more details: https://www.boost.org/doc/libs/1_82_0/libs/test/doc/html/boost_test/tests_organization/fixtures/case.html
Definition at line 83 of file TestNormOps.hpp.
|
default |
|
default |
|
inline |
Compare both sets of norms against the expected ones, with absolute tolerance tol.
Definition at line 211 of file TestNormOps.hpp.
References Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), TestNormOps< TData >::m_in, TestNormOps< TData >::m_l2Expected, TestNormOps< TData >::m_l2NormalisedExpected, TestNormOps< TData >::m_l2NormalisedTest, TestNormOps< TData >::m_l2NormalisedTest2, TestNormOps< TData >::m_l2Test, TestNormOps< TData >::m_l2Test2, TestNormOps< TData >::m_linfExpected, TestNormOps< TData >::m_linfTest, and TestNormOps< TData >::m_linfTest2.
|
inline |
Read the session, build the expansion list and allocate the field the test cases work on.
Definition at line 93 of file TestNormOps.hpp.
References TestNormOps< TData >::SetExpList(), TestNormOps< TData >::SetFixture(), and TestNormOps< TData >::SetSession().
|
inline |
As Configure, on a 3DH1 expansion list with nhomo planes.
Definition at line 103 of file TestNormOps.hpp.
References TestNormOps< TData >::m_nhomo, TestNormOps< TData >::SetExpList3DH1(), TestNormOps< TData >::SetFixture(), and TestNormOps< TData >::SetSession().
|
inlineprotected |
The oracle: the norms the expansion list computes from the same data, independently of the operators under test.
Definition at line 381 of file TestNormOps.hpp.
References Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), TestNormOps< TData >::m_expList, TestNormOps< TData >::m_homoLen, TestNormOps< TData >::m_in, TestNormOps< TData >::m_l2Expected, TestNormOps< TData >::m_l2NormalisedExpected, TestNormOps< TData >::m_linfExpected, and TestNormOps< TData >::m_nhomo.
Referenced by TestNormOps< TData >::SetTestCase().
|
inline |
Apply the norm operators, once on the non-interleaved storage reduced to every rank and once on the interleaved storage reduced to rank zero alone.
Definition at line 174 of file TestNormOps.hpp.
References Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), TestNormOps< TData >::m_expList, TestNormOps< TData >::m_in, TestNormOps< TData >::m_l2NormalisedTest, TestNormOps< TData >::m_l2NormalisedTest2, TestNormOps< TData >::m_l2Test, TestNormOps< TData >::m_l2Test2, TestNormOps< TData >::m_linfTest, TestNormOps< TData >::m_linfTest2, TestNormOps< TData >::m_session, and Nektar::LibUtilities::Field< TData, TState >::ReshapeStorage().
|
inlineprotected |
Definition at line 346 of file TestNormOps.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::eNoCollection, graph, TestNormOps< TData >::m_expList, TestNormOps< TData >::m_session, and Nektar::SpatialDomains::MeshGraphIO::Read().
Referenced by TestNormOps< TData >::Configure().
|
inlineprotected |
Definition at line 354 of file TestNormOps.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::eFourier, Nektar::LibUtilities::eFourierEvenlySpaced, Nektar::Collections::eNoCollection, graph, TestNormOps< TData >::m_expList, TestNormOps< TData >::m_homoLen, TestNormOps< TData >::m_nhomo, TestNormOps< TData >::m_session, and Nektar::SpatialDomains::MeshGraphIO::Read().
Referenced by TestNormOps< TData >::Configure3DH1().
|
inlineprotected |
Definition at line 367 of file TestNormOps.hpp.
References TestNormOps< TData >::m_expList, TestNormOps< TData >::m_in, TestNormOps< TData >::m_nhomo, and TestNormOps< TData >::m_session.
Referenced by TestNormOps< TData >::Configure(), and TestNormOps< TData >::Configure3DH1().
|
inlineprotected |
Definition at line 322 of file TestNormOps.hpp.
References Nektar::LibUtilities::SessionReader::CreateInstance(), TestNormOps< TData >::m_meshName, and TestNormOps< TData >::m_session.
Referenced by TestNormOps< TData >::Configure(), and TestNormOps< TData >::Configure3DH1().
|
inline |
Fill the input field with an analytic expression and record the norms it is expected to have.
Definition at line 115 of file TestNormOps.hpp.
References el, TestNormOps< TData >::ExpectedSolution(), Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), TestNormOps< TData >::m_expList, and TestNormOps< TData >::m_in.
|
protected |
Definition at line 309 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::ExpectedSolution(), TestNormOps< TData >::RunTestCase(), TestNormOps< TData >::SetExpList(), TestNormOps< TData >::SetExpList3DH1(), TestNormOps< TData >::SetFixture(), and TestNormOps< TData >::SetTestCase().
|
staticconstexprprotected |
Homogeneous length of the 3DH1 cases, other than 1 so that it shows.
Definition at line 307 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::ExpectedSolution(), and TestNormOps< TData >::SetExpList3DH1().
|
protected |
Definition at line 310 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), TestNormOps< TData >::ExpectedSolution(), TestNormOps< TData >::RunTestCase(), TestNormOps< TData >::SetFixture(), and TestNormOps< TData >::SetTestCase().
|
protected |
Definition at line 318 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::ExpectedSolution().
|
protected |
Definition at line 319 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::ExpectedSolution().
|
protected |
Definition at line 316 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 317 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 312 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 314 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 320 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::ExpectedSolution().
|
protected |
Definition at line 313 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 315 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Compare(), and TestNormOps< TData >::RunTestCase().
|
protected |
Definition at line 303 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::SetSession().
|
protected |
Number of planes; 1 without a homogeneous direction.
Definition at line 305 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::Configure3DH1(), TestNormOps< TData >::ExpectedSolution(), TestNormOps< TData >::SetExpList3DH1(), and TestNormOps< TData >::SetFixture().
|
protected |
Definition at line 308 of file TestNormOps.hpp.
Referenced by TestNormOps< TData >::RunTestCase(), TestNormOps< TData >::SetExpList(), TestNormOps< TData >::SetExpList3DH1(), TestNormOps< TData >::SetFixture(), and TestNormOps< TData >::SetSession().