add mpi serialization of PvtxTable

This commit is contained in:
Arne Morten Kvarving
2019-12-02 14:49:40 +01:00
parent 6ca259c890
commit d4df817b50
3 changed files with 131 additions and 3 deletions

View File

@@ -37,6 +37,8 @@
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
#include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/ColumnSchema.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/Rock2dTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/Rock2dtrTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp>
@@ -168,9 +170,6 @@ Opm::FoamData getFoamData()
return Opm::FoamData(1.0, 2.0, 3.0, true, 4.0);
}
#endif
Opm::TimeMap getTimeMap()
{
return Opm::TimeMap({123},
@@ -178,6 +177,32 @@ Opm::TimeMap getTimeMap()
{{2, Opm::TimeStampUTC(456)}});
}
Opm::PvtgTable getPvtgTable()
{
return Opm::PvtgTable(Opm::ColumnSchema("test1", Opm::Table::INCREASING,
Opm::Table::DEFAULT_LINEAR),
getTableColumn(),
getTableSchema(),
getTableSchema(),
{getSimpleTable()},
getSimpleTable());
}
Opm::PvtoTable getPvtoTable()
{
return Opm::PvtoTable(Opm::ColumnSchema("test1", Opm::Table::INCREASING,
Opm::Table::DEFAULT_LINEAR),
getTableColumn(),
getTableSchema(),
getTableSchema(),
{getSimpleTable()},
getSimpleTable());
}
#endif
}
@@ -656,6 +681,28 @@ BOOST_AUTO_TEST_CASE(Runspec)
}
BOOST_AUTO_TEST_CASE(PvtgTable)
{
#if HAVE_MPI
Opm::PvtgTable val1 = getPvtgTable();
auto val2 = PackUnpack(val1);
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
BOOST_CHECK(val1 == std::get<0>(val2));
#endif
}
BOOST_AUTO_TEST_CASE(PvtoTable)
{
#if HAVE_MPI
Opm::PvtoTable val1 = getPvtoTable();
auto val2 = PackUnpack(val1);
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
BOOST_CHECK(val1 == std::get<0>(val2));
#endif
}
bool init_unit_test_func()
{
return true;