|
Nektar++
|
Compares MaxStdVelocityOp against the legacy formula. More...
#include <TestMaxStdVelocity.hpp>
Public Member Functions | |
| TestMaxStdVelocity ()=default | |
| ~TestMaxStdVelocity ()=default | |
| void | Configure () |
| Read the session, build the expansion list and allocate the field the test cases work on. | |
| void | SetTestCase () |
| Fill the velocity components and the wave speed, and record the value the operator is expected to return. | |
| void | RunTestCase () |
| Apply the operator with and without the wave speed, 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 weightings and both storage layouts against the expected values, with relative tolerance tol. | |
Protected Member Functions | |
| void | SetSession () |
| void | SetExpList () |
| void | SetFixture () |
| void | ExpectedSolution () |
| The oracle: the legacy computation, element by element on the host. | |
Protected Attributes | |
| std::string | m_meshName = "" |
| SessionReaderSharedPtr | m_session |
| ExpListSharedPtr | m_expList |
| Field< TData, FieldState::Phys > | m_in |
| TData | m_testNoSound = 0 |
| TData | m_testWithSound = 0 |
| TData | m_testNoSound2 = 0 |
| TData | m_testWithSound2 = 0 |
| TData | m_expectedNoSound = 0 |
| TData | m_expectedWithSound = 0 |
Compares MaxStdVelocityOp against the legacy formula.
The expected value is computed here from the legacy expansion interface - GetGeomFactors()->GetDerivFactors() element by element - rather than from the packed factors the operator reads out of the data warehouse. The two reach the same numbers by different routes, so the comparison checks the packing and its indexing, the deformed and regular layouts, the exclusion of padded elements and the per block order weighting, on every mesh the fixture offers.
The field carries one velocity component per coordinate direction followed by a wave speed, and the operator is asked for both weightings: zero, the incompressible and scalar advection case, and one, where the wave speed contributes as a sound speed does.
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 TestMaxStdVelocity.hpp.
|
default |
|
default |
|
inline |
Compare both weightings and both storage layouts against the expected values, with relative tolerance tol.
Definition at line 203 of file TestMaxStdVelocity.hpp.
References TestMaxStdVelocity< TData >::m_expectedNoSound, TestMaxStdVelocity< TData >::m_expectedWithSound, TestMaxStdVelocity< TData >::m_testNoSound, TestMaxStdVelocity< TData >::m_testNoSound2, TestMaxStdVelocity< TData >::m_testWithSound, and TestMaxStdVelocity< TData >::m_testWithSound2.
|
inline |
Read the session, build the expansion list and allocate the field the test cases work on.
Definition at line 100 of file TestMaxStdVelocity.hpp.
References TestMaxStdVelocity< TData >::m_expList, TestMaxStdVelocity< TData >::SetExpList(), TestMaxStdVelocity< TData >::SetFixture(), and TestMaxStdVelocity< TData >::SetSession().
|
inlineprotected |
The oracle: the legacy computation, element by element on the host.
Mirrors CompressibleFlowSystem::v_GetMaxStdVelocity, including its indexing of the derivative factors and its treatment of the wave speed as acting equally in every direction, then applies the order weight the operator folds in per block.
Definition at line 310 of file TestMaxStdVelocity.hpp.
References Nektar::SpatialDomains::eDeformed, el, TestMaxStdVelocity< TData >::m_expectedNoSound, TestMaxStdVelocity< TData >::m_expectedWithSound, TestMaxStdVelocity< TData >::m_expList, and TestMaxStdVelocity< TData >::m_in.
Referenced by TestMaxStdVelocity< TData >::SetTestCase().
|
inline |
Apply the operator with and without the wave speed, once on the non-interleaved storage reduced to every rank and once on the interleaved storage reduced to rank zero alone.
Definition at line 172 of file TestMaxStdVelocity.hpp.
References Nektar::MultiRegions::Operator< TData >::GetOpExecSpace(), TestMaxStdVelocity< TData >::m_expList, TestMaxStdVelocity< TData >::m_in, TestMaxStdVelocity< TData >::m_session, TestMaxStdVelocity< TData >::m_testNoSound, TestMaxStdVelocity< TData >::m_testNoSound2, TestMaxStdVelocity< TData >::m_testWithSound, TestMaxStdVelocity< TData >::m_testWithSound2, and Nektar::LibUtilities::Field< TData, TState >::ReshapeStorage().
|
inlineprotected |
Definition at line 282 of file TestMaxStdVelocity.hpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::Collections::eNoCollection, graph, TestMaxStdVelocity< TData >::m_expList, TestMaxStdVelocity< TData >::m_session, and Nektar::SpatialDomains::MeshGraphIO::Read().
Referenced by TestMaxStdVelocity< TData >::Configure().
|
inlineprotected |
Definition at line 289 of file TestMaxStdVelocity.hpp.
References TestMaxStdVelocity< TData >::m_expList, and TestMaxStdVelocity< TData >::m_in.
Referenced by TestMaxStdVelocity< TData >::Configure().
|
inlineprotected |
Definition at line 258 of file TestMaxStdVelocity.hpp.
References Nektar::LibUtilities::SessionReader::CreateInstance(), TestMaxStdVelocity< TData >::m_meshName, and TestMaxStdVelocity< TData >::m_session.
Referenced by TestMaxStdVelocity< TData >::Configure().
|
inline |
Fill the velocity components and the wave speed, and record the value the operator is expected to return.
Definition at line 112 of file TestMaxStdVelocity.hpp.
References el, TestMaxStdVelocity< TData >::ExpectedSolution(), Nektar::LibUtilities::Field< TData, TState >::GetBlocks(), Nektar::LibUtilities::Field< TData, TState >::GetNumComponents(), TestMaxStdVelocity< TData >::m_expList, and TestMaxStdVelocity< TData >::m_in.
|
protected |
Definition at line 255 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::ExpectedSolution().
|
protected |
Definition at line 256 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::ExpectedSolution().
|
protected |
Definition at line 248 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Configure(), TestMaxStdVelocity< TData >::ExpectedSolution(), TestMaxStdVelocity< TData >::RunTestCase(), TestMaxStdVelocity< TData >::SetExpList(), TestMaxStdVelocity< TData >::SetFixture(), and TestMaxStdVelocity< TData >::SetTestCase().
|
protected |
Definition at line 249 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::ExpectedSolution(), TestMaxStdVelocity< TData >::RunTestCase(), TestMaxStdVelocity< TData >::SetFixture(), and TestMaxStdVelocity< TData >::SetTestCase().
|
protected |
Definition at line 246 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::SetSession().
|
protected |
Definition at line 247 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::RunTestCase(), TestMaxStdVelocity< TData >::SetExpList(), and TestMaxStdVelocity< TData >::SetSession().
|
protected |
Definition at line 251 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::RunTestCase().
|
protected |
Definition at line 253 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::RunTestCase().
|
protected |
Definition at line 252 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::RunTestCase().
|
protected |
Definition at line 254 of file TestMaxStdVelocity.hpp.
Referenced by TestMaxStdVelocity< TData >::Compare(), and TestMaxStdVelocity< TData >::RunTestCase().