|
Nektar++
|
Compares a preconditioner operator against its legacy counterpart. More...
#include <TestPreconOps.hpp>
Public Member Functions | |
| TestPreconOps ()=default | |
| ~TestPreconOps ()=default | |
| void | Configure () |
| Read the session, build the continuous expansion list and allocate the fields the test cases work on. | |
| void | SetTestCase (const std::string &method) |
| Set the input coefficients and the problem parameters, and record the result the preconditioner is expected to produce. | |
| void | RunTestCase (const std::string &method) |
Build the preconditioner for method, configure it against the Helmholtz operator and apply it to the assembled input. | |
| void | ExpectedSolution (const std::string &method) |
| The oracle: the legacy MultiRegions preconditioner of the same name, built on a GlobalLinSys for the same Helmholtz problem. | |
| bool | Compare (TData tol) |
| Compare the computed field to the expected one, with absolute tolerance tol. The two must have the same blocks and components; their interleave widths may differ. | |
Protected Member Functions | |
| void | SetSession () |
| void | SetExpList () |
| A continuous field: the preconditioners act on the assembled, globally continuous coefficients, and the oracle needs the local to global map that only ContField carries. | |
| void | SetFixture () |
Protected Attributes | |
| std::string | m_meshName = "" |
| SessionReaderSharedPtr | m_session |
| ExpListSharedPtr | m_expList |
| Field< TData, FieldState::Coeff > | m_in |
| Field< TData, FieldState::Coeff > | m_out |
| Field< TData, FieldState::Coeff > | m_expected |
| TData | m_lambda |
| std::vector< TData > | m_diffCoeff |
| bool | m_isReconfigured = false |
Compares a preconditioner operator against its legacy counterpart.
The operator under test is built through PreconOp::Create for the requested method and configured against a Helmholtz operator; the expected result comes from the MultiRegions preconditioner of the same name, built on a legacy GlobalLinSys for the same problem. The two reach the same numbers by different routes, so the comparison checks the operator, its configuration from the element operator, and its handling of the assembled storage.
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 90 of file TestPreconOps.hpp.
|
default |
|
default |
|
inline |
Compare the computed field to the expected one, with absolute tolerance tol. The two must have the same blocks and components; their interleave widths may differ.
Definition at line 252 of file TestPreconOps.hpp.
References el, Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::LibUtilities::Field< TData, TState >::GetNumHomoModes(), TestPreconOps< TData >::m_expected, TestPreconOps< TData >::m_out, TestPreconOps< TData >::m_session, and rank.
|
inline |
Read the session, build the continuous expansion list and allocate the fields the test cases work on.
Definition at line 100 of file TestPreconOps.hpp.
References TestPreconOps< TData >::SetExpList(), TestPreconOps< TData >::SetFixture(), and TestPreconOps< TData >::SetSession().
|
inline |
The oracle: the legacy MultiRegions preconditioner of the same name, built on a GlobalLinSys for the same Helmholtz problem.
Definition at line 216 of file TestPreconOps.hpp.
References Nektar::LibUtilities::NekFactoryBase< tKey, tBase, tBasePtr, tParam >::CreateInstance(), Nektar::StdRegions::eFactorLambda, Nektar::StdRegions::eHelmholtz, Nektar::MultiRegions::GetGlobalLinSysFactory(), Nektar::MultiRegions::GetPreconFactory(), TestPreconOps< TData >::m_expected, TestPreconOps< TData >::m_expList, TestPreconOps< TData >::m_in, TestPreconOps< TData >::m_lambda, TestPreconOps< TData >::m_session, and Nektar::LibUtilities::Field< TData, TState >::ToArray().
Referenced by TestPreconOps< TData >::SetTestCase().
|
inline |
Build the preconditioner for method, configure it against the Helmholtz operator and apply it to the assembled input.
Definition at line 163 of file TestPreconOps.hpp.
References Nektar::MultiRegions::AssmbScatrZeroDirOp< TData >::Create(), Nektar::MultiRegions::HelmholtzOp< TData >::Create(), Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), TestPreconOps< TData >::m_diffCoeff, TestPreconOps< TData >::m_expList, TestPreconOps< TData >::m_in, TestPreconOps< TData >::m_isReconfigured, TestPreconOps< TData >::m_lambda, TestPreconOps< TData >::m_out, TestPreconOps< TData >::m_session, and Nektar::LibUtilities::Field< TData, TState >::ReshapeStorage().
|
inlineprotected |
A continuous field: the preconditioners act on the assembled, globally continuous coefficients, and the oracle needs the local to global map that only ContField carries.
Definition at line 391 of file TestPreconOps.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::eNoCollection, graph, TestPreconOps< TData >::m_expList, TestPreconOps< TData >::m_session, and Nektar::SpatialDomains::MeshGraphIO::Read().
Referenced by TestPreconOps< TData >::Configure().
|
inlineprotected |
Definition at line 399 of file TestPreconOps.hpp.
References TestPreconOps< TData >::m_expected, TestPreconOps< TData >::m_expList, TestPreconOps< TData >::m_in, TestPreconOps< TData >::m_out, and TestPreconOps< TData >::m_session.
Referenced by TestPreconOps< TData >::Configure().
|
inlineprotected |
Definition at line 360 of file TestPreconOps.hpp.
References Nektar::LibUtilities::SessionReader::CreateInstance(), TestPreconOps< TData >::m_meshName, and TestPreconOps< TData >::m_session.
Referenced by TestPreconOps< TData >::Configure().
|
inline |
Set the input coefficients and the problem parameters, and record the result the preconditioner is expected to produce.
Definition at line 111 of file TestPreconOps.hpp.
References el, TestPreconOps< TData >::ExpectedSolution(), Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), TestPreconOps< TData >::m_diffCoeff, TestPreconOps< TData >::m_expList, TestPreconOps< TData >::m_in, TestPreconOps< TData >::m_lambda, and TestPreconOps< TData >::m_session.
|
protected |
Definition at line 354 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::RunTestCase(), and TestPreconOps< TData >::SetTestCase().
|
protected |
Definition at line 351 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::Compare(), TestPreconOps< TData >::ExpectedSolution(), and TestPreconOps< TData >::SetFixture().
|
protected |
Definition at line 348 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::ExpectedSolution(), TestPreconOps< TData >::RunTestCase(), TestPreconOps< TData >::SetExpList(), TestPreconOps< TData >::SetFixture(), and TestPreconOps< TData >::SetTestCase().
|
protected |
Definition at line 349 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::ExpectedSolution(), TestPreconOps< TData >::RunTestCase(), TestPreconOps< TData >::SetFixture(), and TestPreconOps< TData >::SetTestCase().
|
protected |
Definition at line 358 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::RunTestCase().
|
protected |
Definition at line 353 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::ExpectedSolution(), TestPreconOps< TData >::RunTestCase(), and TestPreconOps< TData >::SetTestCase().
|
protected |
Definition at line 346 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::SetSession().
|
protected |
Definition at line 350 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::Compare(), TestPreconOps< TData >::RunTestCase(), and TestPreconOps< TData >::SetFixture().
|
protected |
Definition at line 347 of file TestPreconOps.hpp.
Referenced by TestPreconOps< TData >::Compare(), TestPreconOps< TData >::ExpectedSolution(), TestPreconOps< TData >::RunTestCase(), TestPreconOps< TData >::SetExpList(), TestPreconOps< TData >::SetFixture(), TestPreconOps< TData >::SetSession(), and TestPreconOps< TData >::SetTestCase().