Chase Group/Node Summary API Update

This is in preparation of adding support for outputting the network
node pressure quantity, GPR, to the summary file.  In particular,
'GroupValues' is renamed to 'GroupAndNetworkValues' and has new
individual datamembers for the former group-level data and the new
node-level data.

Update BlackoilWellModel::groupData() and CollectToIORank
accordingly and bring the parallel restart facility in line with the
new layout.
This commit is contained in:
Bård Skaflestad
2020-09-20 22:16:07 +02:00
parent 6a592a8c55
commit fde3c476c3
9 changed files with 121 additions and 85 deletions

View File

@@ -207,6 +207,7 @@ std::size_t packSize(const std::array<T,N>& data, Dune::MPIHelper::MPICommunicat
HANDLE_AS_POD(data::Connection)
HANDLE_AS_POD(data::CurrentControl)
HANDLE_AS_POD(data::GroupConstraints)
HANDLE_AS_POD(data::NodeData)
HANDLE_AS_POD(data::Rates)
HANDLE_AS_POD(data::Segment)
@@ -260,11 +261,10 @@ std::size_t packSize(const data::Solution& data, Dune::MPIHelper::MPICommunicato
return packSize(static_cast<const std::map< std::string, data::CellData>&>(data), comm);
}
std::size_t packSize(const data::GroupValues& data, Dune::MPIHelper::MPICommunicator comm)
std::size_t packSize(const data::GroupAndNetworkValues& data, Dune::MPIHelper::MPICommunicator comm)
{
// Needs explicit conversion to a supported base type holding the data
// to prevent throwing.
return packSize(static_cast<const std::map<std::string, data::GroupData>&>(data), comm);
return packSize(data.groupData, comm)
+ packSize(data.nodeData, comm);
}
std::size_t packSize(const data::WellRates& data, Dune::MPIHelper::MPICommunicator comm)
@@ -278,7 +278,7 @@ std::size_t packSize(const RestartValue& data, Dune::MPIHelper::MPICommunicator
{
return packSize(data.solution, comm)
+ packSize(data.wells, comm)
+ packSize(data.groups, comm)
+ packSize(data.grp_nwrk, comm)
+ packSize(data.extra, comm);
}
@@ -552,13 +552,11 @@ void pack(const data::WellRates& data, std::vector<char>& buffer, int& position,
buffer, position, comm);
}
void pack(const data::GroupValues& data, std::vector<char>& buffer, int& position,
void pack(const data::GroupAndNetworkValues& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
// Needs explicit conversion to a supported base type holding the data
// to prevent throwing.
pack(static_cast<const std::map< std::string, data::GroupData>&>(data),
buffer, position, comm);
pack(data.groupData, buffer, position, comm);
pack(data.nodeData, buffer, position, comm);
}
void pack(const RestartValue& data, std::vector<char>& buffer, int& position,
@@ -566,7 +564,7 @@ void pack(const RestartValue& data, std::vector<char>& buffer, int& position,
{
pack(data.solution, buffer, position, comm);
pack(data.wells, buffer, position, comm);
pack(data.groups, buffer, position, comm);
pack(data.grp_nwrk, buffer, position, comm);
pack(data.extra, buffer, position, comm);
}
@@ -858,13 +856,11 @@ void unpack(data::WellRates& data, std::vector<char>& buffer, int& position,
buffer, position, comm);
}
void unpack(data::GroupValues& data, std::vector<char>& buffer, int& position,
void unpack(data::GroupAndNetworkValues& data, std::vector<char>& buffer, int& position,
Dune::MPIHelper::MPICommunicator comm)
{
// Needs explicit conversion to a supported base type holding the data
// to prevent throwing.
unpack(static_cast<std::map< std::string, data::GroupData>&>(data),
buffer, position, comm);
unpack(data.groupData, buffer, position, comm);
unpack(data.nodeData, buffer, position, comm);
}
void unpack(RestartValue& data, std::vector<char>& buffer, int& position,
@@ -872,7 +868,7 @@ void unpack(RestartValue& data, std::vector<char>& buffer, int& position,
{
unpack(data.solution, buffer, position, comm);
unpack(data.wells, buffer, position, comm);
unpack(data.groups, buffer, position, comm);
unpack(data.grp_nwrk, buffer, position, comm);
unpack(data.extra, buffer, position, comm);
}
@@ -951,8 +947,8 @@ RestartValue loadParallelRestart(const EclipseIO* eclIO, Action::State& actionSt
#if HAVE_MPI
data::Solution sol;
data::Wells wells;
data::GroupValues groups;
RestartValue restartValues(sol, wells, groups);
data::GroupAndNetworkValues grp_nwrk;
RestartValue restartValues(sol, wells, grp_nwrk);
if (eclIO)
{

View File

@@ -310,7 +310,8 @@ ADD_PACK_PROTOTYPES(data::GuideRateValue)
ADD_PACK_PROTOTYPES(data::GroupConstraints)
ADD_PACK_PROTOTYPES(data::GroupGuideRates)
ADD_PACK_PROTOTYPES(data::GroupData)
ADD_PACK_PROTOTYPES(data::GroupValues)
ADD_PACK_PROTOTYPES(data::NodeData)
ADD_PACK_PROTOTYPES(data::GroupAndNetworkValues)
ADD_PACK_PROTOTYPES(data::Well)
ADD_PACK_PROTOTYPES(data::WellRates)
ADD_PACK_PROTOTYPES(RestartKey)

View File

@@ -18,6 +18,9 @@
*/
#include <config.h>
#include <opm/simulators/utils/ParallelSerialization.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>