mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-03 23:50:26 -06:00
add mpi serialization for Equil
This commit is contained in:
parent
21eab1aa6d
commit
f989b004e0
@ -308,6 +308,11 @@ std::size_t packSize(const TableContainer& data, Dune::MPIHelper::MPICommunicato
|
||||
return res;
|
||||
}
|
||||
|
||||
std::size_t packSize(const Equil& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.records(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@ -605,6 +610,12 @@ void pack(const TableContainer& data, std::vector<char>& buffer, int& position,
|
||||
}
|
||||
}
|
||||
|
||||
void pack(const Equil& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.records(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@ -948,6 +959,14 @@ void unpack(TableContainer& data, std::vector<char>& buffer, int& position,
|
||||
}
|
||||
}
|
||||
|
||||
void unpack(Equil& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
std::vector<EquilRecord> records;
|
||||
unpack(records, buffer, position, comm);
|
||||
data = Equil(records);
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
@ -39,6 +39,7 @@ namespace Opm
|
||||
|
||||
class ColumnSchema;
|
||||
class EDITNNC;
|
||||
class Equil;
|
||||
class EquilRecord;
|
||||
class NNC;
|
||||
struct NNCdata;
|
||||
@ -222,6 +223,7 @@ ADD_PACK_PROTOTYPES(data::Solution)
|
||||
ADD_PACK_PROTOTYPES(data::Well)
|
||||
ADD_PACK_PROTOTYPES(data::WellRates)
|
||||
ADD_PACK_PROTOTYPES(EDITNNC)
|
||||
ADD_PACK_PROTOTYPES(Equil)
|
||||
ADD_PACK_PROTOTYPES(EquilRecord)
|
||||
ADD_PACK_PROTOTYPES(NNC)
|
||||
ADD_PACK_PROTOTYPES(NNCdata)
|
||||
|
@ -411,6 +411,17 @@ BOOST_AUTO_TEST_CASE(EquilRecord)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Equil)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
Opm::Equil val1({getEquilRecord(), getEquilRecord()});
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user