|
Nektar++
|
#include <TestTimeOps.hpp>
Public Member Functions | |
| TestTimeOps ()=default | |
| ~TestTimeOps ()=default | |
| void | Configure () |
| Read the session, build the expansion list and allocate the fields the test cases work on. | |
| void | SetTestCase (const TData alpha, const TData beta) |
| Set the initial condition and the analytic solution it is expected to reach at the final time. | |
| void | RunTestCase (const std::string scheme, const std::string variant, const unsigned int order, const std::vector< TData > freeParams, const unsigned int numsteps) |
Integrate the test problem for numsteps steps of the scheme given, leaving the result in the output field. | |
| void | ExpectedSolution (const double final_time) |
Fill the expected field with the analytic solution at final_time. | |
| bool | CheckOrderOfAccuracy (const std::string scheme, const std::string variant, const unsigned int order, const std::vector< TData > freeParams={}) |
| Integrate the test problem over a sequence of timesteps and check the order the error converges at against the order claimed by the scheme. | |
Protected Member Functions | |
| void | SetSession () |
| Create the session from the mesh named by the derived fixture and the execution space given on the command line. | |
| void | SetExpList () |
| void | SetFixture () |
| void | DoLHS (Field< TData, FieldState::Phys > &in, Field< TData, FieldState::Phys > &out, const TData &time, const TData &lambda) |
| Implicit solve of the stiff part of the test problem. | |
| void | DoExplicitRHS (Field< TData, FieldState::Phys > &in, Field< TData, FieldState::Phys > &out, const TData &time, const TData &factor) |
| Right-hand side of the non-stiff part of the test problem. | |
| void | DoImplicitRHS (Field< TData, FieldState::Phys > &in, Field< TData, FieldState::Phys > &out, const TData &time, const TData &factor) |
| Right-hand side of the stiff part of the test problem. | |
| void | DoProjection (Field< TData, FieldState::Phys > &in, Field< TData, FieldState::Phys > &out, const TData &time) |
| Projection between timesteps, the identity for this test problem. | |
Protected Attributes | |
| std::string | m_meshName = "" |
| TData | m_alpha = 0 |
| TData | m_beta = 0 |
| Math::MathHelper | m_math |
| Field< TData, FieldState::Phys > | m_in |
| Field< TData, FieldState::Phys > | m_out |
| Field< TData, FieldState::Phys > | m_expected |
| ExpListSharedPtr | m_expList |
| SessionReaderSharedPtr | m_session |
A test fixture that integrates the scalar test problem du/dt = (alpha + beta) u in time, alpha being the non-stiff factor carried by the explicit part of a scheme and beta the stiff factor carried by the implicit part. The exact solution u = e^((alpha + beta) t) with u(t=0) = 1 gives the reference the observed order of accuracy is measured against.
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 79 of file TestTimeOps.hpp.
|
default |
|
default |
|
inline |
Integrate the test problem over a sequence of timesteps and check the order the error converges at against the order claimed by the scheme.
Definition at line 187 of file TestTimeOps.hpp.
|
inline |
Read the session, build the expansion list and allocate the fields the test cases work on.
Definition at line 89 of file TestTimeOps.hpp.
References TestTimeOps< TData >::SetExpList(), TestTimeOps< TData >::SetFixture(), and TestTimeOps< TData >::SetSession().
|
inlineprotected |
Right-hand side of the non-stiff part of the test problem.
Definition at line 357 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_alpha, TestTimeOps< TData >::m_math, and Nektar::Math::MathHelper::mul().
Referenced by TestTimeOps< TData >::RunTestCase().
|
inlineprotected |
Right-hand side of the stiff part of the test problem.
Definition at line 368 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_beta, TestTimeOps< TData >::m_math, and Nektar::Math::MathHelper::mul().
Referenced by TestTimeOps< TData >::RunTestCase().
|
inlineprotected |
Implicit solve of the stiff part of the test problem.
Definition at line 343 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_beta, TestTimeOps< TData >::m_math, and Nektar::Math::MathHelper::mul().
Referenced by TestTimeOps< TData >::RunTestCase().
|
inlineprotected |
Projection between timesteps, the identity for this test problem.
Definition at line 379 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_math, and Nektar::Math::MathHelper::mul().
Referenced by TestTimeOps< TData >::RunTestCase().
|
inline |
Fill the expected field with the analytic solution at final_time.
Definition at line 171 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_alpha, TestTimeOps< TData >::m_beta, TestTimeOps< TData >::m_expected, TestTimeOps< TData >::m_in, TestTimeOps< TData >::m_math, and Nektar::Math::MathHelper::mul().
Referenced by TestTimeOps< TData >::SetTestCase().
|
inline |
Integrate the test problem for numsteps steps of the scheme given, leaving the result in the output field.
Definition at line 142 of file TestTimeOps.hpp.
References TestTimeOps< TData >::DoExplicitRHS(), TestTimeOps< TData >::DoImplicitRHS(), TestTimeOps< TData >::DoLHS(), TestTimeOps< TData >::DoProjection(), TestTimeOps< TData >::m_expList, TestTimeOps< TData >::m_in, TestTimeOps< TData >::m_out, and TestTimeOps< TData >::m_session.
|
inlineprotected |
Definition at line 321 of file TestTimeOps.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::eNoCollection, graph, TestTimeOps< TData >::m_expList, TestTimeOps< TData >::m_session, and Nektar::SpatialDomains::MeshGraphIO::Read().
Referenced by TestTimeOps< TData >::Configure().
|
inlineprotected |
Definition at line 329 of file TestTimeOps.hpp.
References TestTimeOps< TData >::m_expected, TestTimeOps< TData >::m_expList, TestTimeOps< TData >::m_in, TestTimeOps< TData >::m_out, and TestTimeOps< TData >::m_session.
Referenced by TestTimeOps< TData >::Configure().
|
inlineprotected |
Create the session from the mesh named by the derived fixture and the execution space given on the command line.
Definition at line 297 of file TestTimeOps.hpp.
References Nektar::LibUtilities::SessionReader::CreateInstance(), TestTimeOps< TData >::m_meshName, and TestTimeOps< TData >::m_session.
Referenced by TestTimeOps< TData >::Configure().
|
inline |
Set the initial condition and the analytic solution it is expected to reach at the final time.
| alpha | non-stiff factor, integrated by the explicit part |
| beta | stiff factor, integrated by the implicit part |
Definition at line 103 of file TestTimeOps.hpp.
References Nektar::LibUtilities::beta, el, TestTimeOps< TData >::ExpectedSolution(), Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), TestTimeOps< TData >::m_alpha, TestTimeOps< TData >::m_beta, TestTimeOps< TData >::m_in, TestTimeOps< TData >::m_math, and TestTimeOps< TData >::m_session.
|
protected |
Definition at line 282 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::DoExplicitRHS(), TestTimeOps< TData >::ExpectedSolution(), and TestTimeOps< TData >::SetTestCase().
|
protected |
Definition at line 283 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::DoImplicitRHS(), TestTimeOps< TData >::DoLHS(), TestTimeOps< TData >::ExpectedSolution(), and TestTimeOps< TData >::SetTestCase().
|
protected |
Definition at line 289 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::ExpectedSolution(), and TestTimeOps< TData >::SetFixture().
|
protected |
Definition at line 290 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::RunTestCase(), TestTimeOps< TData >::SetExpList(), and TestTimeOps< TData >::SetFixture().
|
protected |
Definition at line 287 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::ExpectedSolution(), TestTimeOps< TData >::RunTestCase(), TestTimeOps< TData >::SetFixture(), and TestTimeOps< TData >::SetTestCase().
|
protected |
Definition at line 285 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::DoExplicitRHS(), TestTimeOps< TData >::DoImplicitRHS(), TestTimeOps< TData >::DoLHS(), TestTimeOps< TData >::DoProjection(), TestTimeOps< TData >::ExpectedSolution(), and TestTimeOps< TData >::SetTestCase().
|
protected |
Definition at line 281 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::SetSession().
|
protected |
Definition at line 288 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::RunTestCase(), and TestTimeOps< TData >::SetFixture().
|
protected |
Definition at line 291 of file TestTimeOps.hpp.
Referenced by TestTimeOps< TData >::RunTestCase(), TestTimeOps< TData >::SetExpList(), TestTimeOps< TData >::SetFixture(), TestTimeOps< TData >::SetSession(), and TestTimeOps< TData >::SetTestCase().