mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for EndpointScaling
This commit is contained in:
parent
d255e1cad6
commit
64c7ead11c
@ -392,6 +392,11 @@ std::size_t packSize(const Phases& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
return packSize(data.getBits(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const EndpointScaling& data, Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.getBits(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@ -773,6 +778,12 @@ void pack(const Phases& data, std::vector<char>& buffer, int& position,
|
||||
pack(data.getBits(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const EndpointScaling& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.getBits(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@ -1240,6 +1251,14 @@ void unpack(Phases& data, std::vector<char>& buffer, int& position,
|
||||
data = Phases(std::bitset<NUM_PHASES_IN_ENUM>(bits));
|
||||
}
|
||||
|
||||
void unpack(EndpointScaling& data, std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
unsigned long bits;
|
||||
unpack(bits, buffer, position, comm);
|
||||
data = EndpointScaling(std::bitset<4>(bits));
|
||||
}
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
const std::vector<Opm::RestartKey>& solutionKeys,
|
||||
|
@ -41,6 +41,7 @@ namespace Opm
|
||||
|
||||
class ColumnSchema;
|
||||
class EDITNNC;
|
||||
class EndpointScaling;
|
||||
class Equil;
|
||||
class EquilRecord;
|
||||
class FoamConfig;
|
||||
@ -245,6 +246,7 @@ ADD_PACK_PROTOTYPES(data::Solution)
|
||||
ADD_PACK_PROTOTYPES(data::Well)
|
||||
ADD_PACK_PROTOTYPES(data::WellRates)
|
||||
ADD_PACK_PROTOTYPES(EDITNNC)
|
||||
ADD_PACK_PROTOTYPES(EndpointScaling)
|
||||
ADD_PACK_PROTOTYPES(Equil)
|
||||
ADD_PACK_PROTOTYPES(EquilRecord)
|
||||
ADD_PACK_PROTOTYPES(FoamConfig)
|
||||
|
@ -571,6 +571,17 @@ BOOST_AUTO_TEST_CASE(Tabdims)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(EndpointScaling)
|
||||
{
|
||||
#if HAVE_MPI
|
||||
Opm::EndpointScaling val1(std::bitset<4>(13));
|
||||
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