|
Nektar++
|
Classes | |
| struct | ScratchDirectory |
| A uniquely named directory under the system temporary directory, removed with everything in it when the object goes out of scope. More... | |
Functions | |
| static void | Substitute (std::string &text, const std::string &token, const std::string &value) |
| Write a coefficient vector to a field file and read it back. | |
| static void | RoundTrip (const std::string &expansionType) |
| static void | RoundTripOrderChange (const std::string &expansionType) |
| Round trip a coefficient vector through a different polynomial order and back. | |
| BOOST_AUTO_TEST_CASE (TestFieldFileRoundTripHybridMeshModified) | |
| The modified basis, which is what almost every session uses. | |
| BOOST_AUTO_TEST_CASE (TestFieldFileRoundTripHybridMeshOrthogonal) | |
| BOOST_AUTO_TEST_CASE (TestFieldFileOrderChangeModified) | |
| Restarting at a different order, which is what reaches the per element extraction, for each basis. | |
| BOOST_AUTO_TEST_CASE (TestFieldFileOrderChangeOrthogonal) | |
Variables | |
| static const std::string | sessionTemplate |
| Nektar::FieldFileRoundTripTest::BOOST_AUTO_TEST_CASE | ( | TestFieldFileOrderChangeModified | ) |
Restarting at a different order, which is what reaches the per element extraction, for each basis.
Definition at line 408 of file TestFieldFileRoundTrip.cpp.
References RoundTripOrderChange().
| Nektar::FieldFileRoundTripTest::BOOST_AUTO_TEST_CASE | ( | TestFieldFileOrderChangeOrthogonal | ) |
Definition at line 413 of file TestFieldFileRoundTrip.cpp.
References RoundTripOrderChange().
| Nektar::FieldFileRoundTripTest::BOOST_AUTO_TEST_CASE | ( | TestFieldFileRoundTripHybridMeshModified | ) |
The modified basis, which is what almost every session uses.
Definition at line 389 of file TestFieldFileRoundTrip.cpp.
References RoundTrip().
| Nektar::FieldFileRoundTripTest::BOOST_AUTO_TEST_CASE | ( | TestFieldFileRoundTripHybridMeshOrthogonal | ) |
The orthogonal basis, whose second direction is eOrtho_B rather than eModified_B. The per-element extraction asserts on the basis it is given, so a basis it does not name cannot be read back at all - the failure is an assertion rather than wrong numbers, and no modified-basis session reaches it.
Definition at line 401 of file TestFieldFileRoundTrip.cpp.
References RoundTrip().
|
static |
Definition at line 189 of file TestFieldFileRoundTrip.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::FieldIO::CreateDefault(), Nektar::LibUtilities::SessionReader::CreateInstance(), graph, Nektar::FieldFileRoundTripTest::ScratchDirectory::m_path, Nektar::SpatialDomains::MeshGraphIO::Read(), session, sessionTemplate, and Substitute().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Round trip a coefficient vector through a different polynomial order and back.
Restarting at the order the file was written at is the easy case: ExpList::ExtractDataToCoeffs() sees a matching mode count and basis and copies the element's coefficients straight across, never consulting the expansion. Restarting at a different order is what sends it into the per element routine, which switches on the basis type and knows how to place mode (i,j) of one order among the modes of another. A basis that switch does not name cannot be read at all.
Writing at one order, reading at a higher one and coming back is exact for a hierarchical basis - the added modes are zero and are dropped again - so the original coefficients are the expected answer, without the test needing to know how the modes are laid out.
Definition at line 282 of file TestFieldFileRoundTrip.cpp.
References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::FieldIO::CreateDefault(), Nektar::LibUtilities::SessionReader::CreateInstance(), Nektar::FieldFileRoundTripTest::ScratchDirectory::m_path, Nektar::SpatialDomains::MeshGraphIO::Read(), session, sessionTemplate, and Substitute().
Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().
|
static |
Write a coefficient vector to a field file and read it back.
This is the path a restart takes: the solver projects its state to coefficients, ExpList::AppendFieldData() lays them out per field definition, and on resumption ExpList::ExtractDataToCoeffs() puts them back. The coefficients are the state, so anything the round trip loses is state the resumed run does not have.
The reader is called once per field definition and accumulates into one vector, which is what makes a mesh of more than one element shape the interesting case: a reader that starts from zero each call returns only the shape it was given last and silently zeros the others. On this mesh that would leave the two quadrilaterals - the first 32 coefficients - at zero while the triangles survived. Substitute every occurrence of token in text with value.
Definition at line 148 of file TestFieldFileRoundTrip.cpp.
Referenced by RoundTrip(), and RoundTripOrderChange().
|
static |
A mesh of two quadrilaterals and four triangles over the unit square. The two shapes are the point of it: ExpList::GetFieldDefinitions() emits one field definition per shape, and a reader that handles only the last of them is the failure this test exists to catch. A single shape mesh cannot see it.
Definition at line 58 of file TestFieldFileRoundTrip.cpp.
Referenced by RoundTrip(), and RoundTripOrderChange().