mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add mpi serialization for WList
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp>
|
||||
@@ -1263,6 +1264,12 @@ std::size_t packSize(const Group& data,
|
||||
packSize(data.productionProperties(), comm);
|
||||
}
|
||||
|
||||
std::size_t packSize(const WList& data,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
return packSize(data.wellList(), comm);
|
||||
}
|
||||
|
||||
////// pack routines
|
||||
|
||||
template<class T>
|
||||
@@ -2542,6 +2549,13 @@ void pack(const Group& data,
|
||||
pack(data.productionProperties(), buffer, position, comm);
|
||||
}
|
||||
|
||||
void pack(const WList& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
pack(data.wellList(), buffer, position, comm);
|
||||
}
|
||||
|
||||
/// unpack routines
|
||||
|
||||
template<class T>
|
||||
@@ -4348,6 +4362,15 @@ void unpack(Group& data,
|
||||
injection, production);
|
||||
}
|
||||
|
||||
void unpack(WList& data,
|
||||
std::vector<char>& buffer, int& position,
|
||||
Dune::MPIHelper::MPICommunicator comm)
|
||||
{
|
||||
WList::storage ddata;
|
||||
unpack(ddata, buffer, position, comm);
|
||||
data = WList(ddata);
|
||||
}
|
||||
|
||||
#define INSTANTIATE_PACK_VECTOR(T) \
|
||||
template std::size_t packSize(const std::vector<T>& data, \
|
||||
Dune::MPIHelper::MPICommunicator comm); \
|
||||
|
||||
@@ -129,6 +129,7 @@ class WellPolymerProperties;
|
||||
class WellSegmentDims;
|
||||
class WellSegments;
|
||||
class WellTracerProperties;
|
||||
class WList;
|
||||
|
||||
namespace Mpi
|
||||
{
|
||||
@@ -648,6 +649,7 @@ ADD_PACK_PROTOTYPES(WellSegments)
|
||||
ADD_PACK_PROTOTYPES(WellTestConfig)
|
||||
ADD_PACK_PROTOTYPES(WellTestConfig::WTESTWell)
|
||||
ADD_PACK_PROTOTYPES(WellTracerProperties)
|
||||
ADD_PACK_PROTOTYPES(WList)
|
||||
|
||||
} // end namespace Mpi
|
||||
RestartValue loadParallelRestart(const EclipseIO* eclIO, SummaryState& summaryState,
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Aqudims.hpp>
|
||||
@@ -1638,6 +1639,17 @@ BOOST_AUTO_TEST_CASE(Group)
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WList)
|
||||
{
|
||||
#ifdef HAVE_MPI
|
||||
Opm::WList val1({"test1", "test2", "test3"});
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user