mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
AquiferCarterTracy: add serialization of dynamic state
This commit is contained in:
@@ -134,6 +134,42 @@ BOOST_AUTO_TEST_CASE(EclGenericProblem)
|
||||
BOOST_CHECK_MESSAGE(data_out == data_in, "Deserialized EclGenericProblem differ");
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
struct AquiferFixture {
|
||||
AquiferFixture() {
|
||||
using TT = Opm::Properties::TTag::EbosTypeTag;
|
||||
const char* argv[] = {
|
||||
"test_RestartSerialization",
|
||||
"--ecl-deck-file-name=GLIFT1.DATA"
|
||||
};
|
||||
Opm::setupParameters_<TT>(2, argv, /*registerParams=*/true);
|
||||
Opm::EclGenericVanguard::setCommunication(std::make_unique<Opm::Parallel::Communication>());
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
BOOST_GLOBAL_FIXTURE(AquiferFixture);
|
||||
|
||||
BOOST_AUTO_TEST_CASE(AquiferCarterTracy)
|
||||
{
|
||||
using TT = Opm::Properties::TTag::EbosTypeTag;
|
||||
Opm::EclGenericVanguard::readDeck("GLIFT1.DATA");
|
||||
using Simulator = Opm::GetPropType<TT, Opm::Properties::Simulator>;
|
||||
Simulator sim;
|
||||
auto data_out = Opm::AquiferCarterTracy<TT>::serializationTestObject(sim);
|
||||
Opm::Serialization::MemPacker packer;
|
||||
Opm::Serializer ser(packer);
|
||||
ser.pack(data_out);
|
||||
size_t pos1 = ser.position();
|
||||
decltype(data_out) data_in({}, sim, {});
|
||||
ser.unpack(data_in);
|
||||
size_t pos2 = ser.position();
|
||||
BOOST_CHECK_MESSAGE(pos1 == pos2, "Packed size differ from unpack size for AquiferCarterTracy");
|
||||
BOOST_CHECK_MESSAGE(data_out == data_in, "Deserialized AquiferCarterTracy differ");
|
||||
}
|
||||
|
||||
bool init_unit_test_func()
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user