20 #ifndef OPM_RESCOUP_PROXY_HPP 21 #define OPM_RESCOUP_PROXY_HPP 23 #include <opm/simulators/flow/rescoup/ReservoirCouplingEnabled.hpp> 24 #ifdef RESERVOIR_COUPLING_ENABLED 25 #include <opm/simulators/flow/rescoup/ReservoirCoupling.hpp> 26 #include <opm/simulators/flow/rescoup/ReservoirCouplingMaster.hpp> 27 #include <opm/simulators/flow/rescoup/ReservoirCouplingSlave.hpp> 35 #ifndef RESERVOIR_COUPLING_ENABLED 37 template <
class Scalar>
class ReservoirCouplingMaster;
38 template <
class Scalar>
class ReservoirCouplingSlave;
41 namespace ReservoirCoupling {
53 template <
class Scalar>
64 #ifdef RESERVOIR_COUPLING_ENABLED 68 bool isEnabled()
const noexcept {
return master_ || slave_; }
71 bool isMaster()
const noexcept {
return master_ !=
nullptr; }
74 bool isSlave()
const noexcept {
return slave_ !=
nullptr; }
115 bool isMasterGroup(
const std::string& group_name)
const {
116 return master_ && master_->isMasterGroup(group_name);
122 bool isSlaveGroup(
const std::string& group_name)
const {
123 return slave_ && slave_->isSlaveGroup(group_name);
130 #else // !RESERVOIR_COUPLING_ENABLED 134 bool isEnabled()
const noexcept {
return false; }
135 bool isMaster()
const noexcept {
return false; }
136 bool isSlave()
const noexcept {
return false; }
142 throw std::logic_error(
"ReservoirCoupling::Proxy::setMaster() called in non-MPI build");
146 throw std::logic_error(
"ReservoirCoupling::Proxy::setSlave() called in non-MPI build");
156 throw std::logic_error(
"ReservoirCoupling::Proxy::master() called in non-MPI build");
159 throw std::logic_error(
"ReservoirCoupling::Proxy::master() called in non-MPI build");
163 throw std::logic_error(
"ReservoirCoupling::Proxy::slave() called in non-MPI build");
166 throw std::logic_error(
"ReservoirCoupling::Proxy::slave() called in non-MPI build");
171 bool isMasterGroup(
const std::string& )
const noexcept {
175 bool isSlaveGroup(
const std::string& )
const noexcept {
178 #endif // !RESERVOIR_COUPLING_ENABLED 184 #endif // OPM_RESCOUP_PROXY_HPP This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
Definition: ReservoirCouplingMaster.hpp:38
Definition: ReservoirCouplingSlave.hpp:40
Thin proxy for reservoir coupling master/slave pointers.
Definition: RescoupProxy.hpp:54