mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Collect WellTestState on IORank
This commit is contained in:
@@ -576,6 +576,41 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class PackUnPackWellTestState : public P2PCommunicatorType::DataHandleInterface
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
PackUnPackWellTestState(const WellTestState& localWTestState,
|
||||||
|
WellTestState& globalWTestState,
|
||||||
|
bool isIORank)
|
||||||
|
: local_(localWTestState)
|
||||||
|
, global_(globalWTestState)
|
||||||
|
{
|
||||||
|
if (isIORank) {
|
||||||
|
MessageBufferType buffer;
|
||||||
|
pack(0, buffer);
|
||||||
|
|
||||||
|
// pass a dummyLink to satisfy virtual class
|
||||||
|
int dummyLink = -1;
|
||||||
|
unpack(dummyLink, buffer);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pack(int link, MessageBufferType& buffer) {
|
||||||
|
if (link != 0)
|
||||||
|
throw std::logic_error("link in method pack is not 0 as expected");
|
||||||
|
this->local_.pack(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
void unpack(int, MessageBufferType& buffer) {
|
||||||
|
this->global_.unpack(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const WellTestState& local_;
|
||||||
|
WellTestState& global_;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
class PackUnPackAquiferData : public P2PCommunicatorType::DataHandleInterface
|
class PackUnPackAquiferData : public P2PCommunicatorType::DataHandleInterface
|
||||||
{
|
{
|
||||||
const data::Aquifers& localAquiferData_;
|
const data::Aquifers& localAquiferData_;
|
||||||
@@ -842,7 +877,8 @@ collect(const data::Solution& localCellData,
|
|||||||
const std::map<std::size_t, double>& localWBPData,
|
const std::map<std::size_t, double>& localWBPData,
|
||||||
const data::Wells& localWellData,
|
const data::Wells& localWellData,
|
||||||
const data::GroupAndNetworkValues& localGroupAndNetworkData,
|
const data::GroupAndNetworkValues& localGroupAndNetworkData,
|
||||||
const data::Aquifers& localAquiferData)
|
const data::Aquifers& localAquiferData,
|
||||||
|
const WellTestState& localWellTestState)
|
||||||
{
|
{
|
||||||
globalCellData_ = {};
|
globalCellData_ = {};
|
||||||
globalBlockData_.clear();
|
globalBlockData_.clear();
|
||||||
@@ -850,6 +886,7 @@ collect(const data::Solution& localCellData,
|
|||||||
globalWellData_.clear();
|
globalWellData_.clear();
|
||||||
globalGroupAndNetworkData_.clear();
|
globalGroupAndNetworkData_.clear();
|
||||||
globalAquiferData_.clear();
|
globalAquiferData_.clear();
|
||||||
|
globalWellTestState_.clear();
|
||||||
|
|
||||||
// index maps only have to be build when reordering is needed
|
// index maps only have to be build when reordering is needed
|
||||||
if(!needsReordering && !isParallel())
|
if(!needsReordering && !isParallel())
|
||||||
@@ -900,12 +937,19 @@ collect(const data::Solution& localCellData,
|
|||||||
this->isIORank()
|
this->isIORank()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
PackUnPackWellTestState packUnpackWellTestState {
|
||||||
|
localWellTestState,
|
||||||
|
this->globalWellTestState_,
|
||||||
|
this->isIORank()
|
||||||
|
};
|
||||||
|
|
||||||
toIORankComm_.exchange(packUnpackCellData);
|
toIORankComm_.exchange(packUnpackCellData);
|
||||||
toIORankComm_.exchange(packUnpackWellData);
|
toIORankComm_.exchange(packUnpackWellData);
|
||||||
toIORankComm_.exchange(packUnpackGroupAndNetworkData);
|
toIORankComm_.exchange(packUnpackGroupAndNetworkData);
|
||||||
toIORankComm_.exchange(packUnpackBlockData);
|
toIORankComm_.exchange(packUnpackBlockData);
|
||||||
toIORankComm_.exchange(packUnpackWBPData);
|
toIORankComm_.exchange(packUnpackWBPData);
|
||||||
toIORankComm_.exchange(packUnpackAquiferData);
|
toIORankComm_.exchange(packUnpackAquiferData);
|
||||||
|
toIORankComm_.exchange(packUnpackWellTestState);
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
// make sure every process is on the same page
|
// make sure every process is on the same page
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <opm/output/data/Solution.hpp>
|
#include <opm/output/data/Solution.hpp>
|
||||||
#include <opm/output/data/Wells.hpp>
|
#include <opm/output/data/Wells.hpp>
|
||||||
#include <opm/output/data/Groups.hpp>
|
#include <opm/output/data/Groups.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp>
|
||||||
|
|
||||||
#include <opm/grid/common/p2pcommunicator.hh>
|
#include <opm/grid/common/p2pcommunicator.hh>
|
||||||
|
|
||||||
@@ -69,7 +70,8 @@ public:
|
|||||||
const std::map<std::size_t, double>& localWBPData,
|
const std::map<std::size_t, double>& localWBPData,
|
||||||
const data::Wells& localWellData,
|
const data::Wells& localWellData,
|
||||||
const data::GroupAndNetworkValues& localGroupAndNetworkData,
|
const data::GroupAndNetworkValues& localGroupAndNetworkData,
|
||||||
const data::Aquifers& localAquiferData);
|
const data::Aquifers& localAquiferData,
|
||||||
|
const WellTestState& localWellTestState);
|
||||||
|
|
||||||
const std::map<std::size_t, double>& globalWBPData() const
|
const std::map<std::size_t, double>& globalWBPData() const
|
||||||
{ return this->globalWBPData_; }
|
{ return this->globalWBPData_; }
|
||||||
@@ -83,6 +85,9 @@ public:
|
|||||||
const data::Wells& globalWellData() const
|
const data::Wells& globalWellData() const
|
||||||
{ return globalWellData_; }
|
{ return globalWellData_; }
|
||||||
|
|
||||||
|
const WellTestState& globalWellTestState() const
|
||||||
|
{ return this->globalWellTestState_; }
|
||||||
|
|
||||||
const data::GroupAndNetworkValues& globalGroupAndNetworkData() const
|
const data::GroupAndNetworkValues& globalGroupAndNetworkData() const
|
||||||
{ return globalGroupAndNetworkData_; }
|
{ return globalGroupAndNetworkData_; }
|
||||||
|
|
||||||
@@ -117,6 +122,7 @@ protected:
|
|||||||
data::Wells globalWellData_;
|
data::Wells globalWellData_;
|
||||||
data::GroupAndNetworkValues globalGroupAndNetworkData_;
|
data::GroupAndNetworkValues globalGroupAndNetworkData_;
|
||||||
data::Aquifers globalAquiferData_;
|
data::Aquifers globalAquiferData_;
|
||||||
|
WellTestState globalWellTestState_;
|
||||||
std::vector<int> localIdxToGlobalIdx_;
|
std::vector<int> localIdxToGlobalIdx_;
|
||||||
/// \brief sorted list of cartesian indices present-
|
/// \brief sorted list of cartesian indices present-
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -646,6 +646,12 @@ public:
|
|||||||
throw std::logic_error("commitWGState() method not implemented for class eclwellmanager");
|
throw std::logic_error("commitWGState() method not implemented for class eclwellmanager");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WellTestState& wellTestState() {
|
||||||
|
throw std::logic_error("wellTestState() method not implemented for class eclwellmanager");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void resetWGState()
|
void resetWGState()
|
||||||
{
|
{
|
||||||
throw std::logic_error("resetWGState() method not implemented for class eclwellmanager");
|
throw std::logic_error("resetWGState() method not implemented for class eclwellmanager");
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
const auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
|
const auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
|
||||||
|
const auto localWellTestState = simulator_.problem().wellModel().wellTestState();
|
||||||
this->prepareLocalCellData(isSubStep, reportStepNum);
|
this->prepareLocalCellData(isSubStep, reportStepNum);
|
||||||
|
|
||||||
if (this->collectToIORank_.isParallel())
|
if (this->collectToIORank_.isParallel())
|
||||||
@@ -191,7 +191,8 @@ public:
|
|||||||
eclOutputModule_->getWBPData(),
|
eclOutputModule_->getWBPData(),
|
||||||
localWellData,
|
localWellData,
|
||||||
localGroupAndNetworkData,
|
localGroupAndNetworkData,
|
||||||
localAquiferData);
|
localAquiferData,
|
||||||
|
localWellTestState);
|
||||||
|
|
||||||
|
|
||||||
std::map<std::string, double> miscSummaryData;
|
std::map<std::string, double> miscSummaryData;
|
||||||
@@ -240,6 +241,7 @@ public:
|
|||||||
.groupAndNetworkData(reportStepNum);
|
.groupAndNetworkData(reportStepNum);
|
||||||
|
|
||||||
auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
|
auto localAquiferData = simulator_.problem().aquiferModel().aquiferData();
|
||||||
|
auto localWellTestState = simulator_.problem().wellModel().wellTestState();
|
||||||
|
|
||||||
data::Solution localCellData = {};
|
data::Solution localCellData = {};
|
||||||
if (! isSubStep) {
|
if (! isSubStep) {
|
||||||
@@ -255,7 +257,8 @@ public:
|
|||||||
eclOutputModule_->getWBPData(),
|
eclOutputModule_->getWBPData(),
|
||||||
localWellData,
|
localWellData,
|
||||||
localGroupAndNetworkData,
|
localGroupAndNetworkData,
|
||||||
localAquiferData);
|
localAquiferData,
|
||||||
|
localWellTestState);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->collectToIORank_.isIORank()) {
|
if (this->collectToIORank_.isIORank()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user