Opm::ReservoirCouplingMaster< Scalar > Class Template Reference

#include <ReservoirCouplingMaster.hpp>

Inheritance diagram for Opm::ReservoirCouplingMaster< Scalar >:
Inheritance graph

Public Types

using MessageTag = ReservoirCoupling::MessageTag
 
using Seconds = ReservoirCoupling::Seconds
 
using Potentials = ReservoirCoupling::Potentials< Scalar >
 
using SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar >
 

Public Member Functions

 ReservoirCouplingMaster (const Parallel::Communication &comm, const Schedule &schedule, int argc, char **argv)
 
bool activated ()
 
void addSlaveCommunicator (MPI_Comm comm)
 
void addSlaveName (const std::string &name)
 
void addSlaveActivationDate (double date)
 
void addSlaveStartDate (std::time_t date)
 
void clearDeferredLogger ()
 
double getActivationDate () const
 
int getArgc () const
 
char * getArgv (int index) const
 
char ** getArgv () const
 
const Parallel::CommunicationgetComm () const
 
ReservoirCoupling::LoggergetLogger ()
 
const std::vector< std::string > & getMasterGroupNamesForSlave (std::size_t slave_idx) const
 Get the master group names associated with a slave reservoir by index. More...
 
std::size_t getMasterGroupCanonicalIdx (const std::string &slave_name, const std::string &master_group_name) const
 Get the canonical index of the master group for a given slave name and master group name. The index is used to map slave group data sent from the slaves, like potentials to the corresponding master group. More...
 
std::map< std::string, std::string > & getMasterGroupToSlaveNameMap ()
 
double getSlaveActivationDate (int index) const
 
const double * getSlaveActivationDates () const
 
std::map< std::string, std::vector< std::string > > & getSlaveNameToMasterGroupsMap ()
 
double getSimulationStartDate () const
 
MPI_Comm getSlaveComm (int index) const
 
const PotentialsgetSlaveGroupPotentials (const std::string &master_group_name)
 
const std::string & getSlaveName (int index) const
 
double getSlaveStartDate (int index) const
 
const double * getSlaveStartDates ()
 
void initStartOfReportStep (int report_step_idx)
 
void initTimeStepping ()
 
bool isMasterGroup (const std::string &group_name) const
 
void maybeActivate (int report_step)
 
void maybeReceiveActivationHandshakeFromSlaves (double current_time)
 
double maybeChopSubStep (double suggested_timestep, double current_time) const
 
void maybeSpawnSlaveProcesses (int report_step)
 
std::size_t numSlaveGroups (unsigned int index)
 
std::size_t numSlavesStarted () const
 
void rebuildSlaveIdxToMasterGroupsVector ()
 
void receiveNextReportDateFromSlaves ()
 
void receiveProductionDataFromSlaves ()
 
void receiveInjectionDataFromSlaves ()
 
void resizeNextReportDates (int size)
 
void resizeSlaveActivationDates (int size)
 
void resizeSlaveStartDates (int size)
 
const Schedule & schedule () const
 
void sendNextTimeStepToSlaves (double next_time_step)
 
void setDeferredLogger (DeferredLogger *deferred_logger)
 
void setSlaveActivationDate (int index, double date)
 
void setSlaveNextReportTimeOffset (int index, double offset)
 
void setSlaveStartDate (int index, std::time_t date)
 
bool slaveIsActivated (int index) const
 
void updateMasterGroupNameOrderMap (const std::string &slave_name, const std::map< std::string, std::size_t > &master_group_map)
 

Member Typedef Documentation

◆ MessageTag

template<class Scalar >
using Opm::ReservoirCouplingMaster< Scalar >::MessageTag = ReservoirCoupling::MessageTag

◆ Potentials

template<class Scalar >
using Opm::ReservoirCouplingMaster< Scalar >::Potentials = ReservoirCoupling::Potentials<Scalar>

◆ Seconds

template<class Scalar >
using Opm::ReservoirCouplingMaster< Scalar >::Seconds = ReservoirCoupling::Seconds

◆ SlaveGroupProductionData

template<class Scalar >
using Opm::ReservoirCouplingMaster< Scalar >::SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData<Scalar>

Constructor & Destructor Documentation

◆ ReservoirCouplingMaster()

template<class Scalar >
Opm::ReservoirCouplingMaster< Scalar >::ReservoirCouplingMaster ( const Parallel::Communication comm,
const Schedule &  schedule,
int  argc,
char **  argv 
)

Member Function Documentation

◆ activated()

template<class Scalar >
bool Opm::ReservoirCouplingMaster< Scalar >::activated ( )
inline

◆ addSlaveActivationDate()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::addSlaveActivationDate ( double  date)
inline

◆ addSlaveCommunicator()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::addSlaveCommunicator ( MPI_Comm  comm)
inline

◆ addSlaveName()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::addSlaveName ( const std::string &  name)
inline

◆ addSlaveStartDate()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::addSlaveStartDate ( std::time_t  date)
inline

◆ clearDeferredLogger()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::clearDeferredLogger ( )
inline

◆ getActivationDate()

template<class Scalar >
double Opm::ReservoirCouplingMaster< Scalar >::getActivationDate ( ) const
inline

◆ getArgc()

template<class Scalar >
int Opm::ReservoirCouplingMaster< Scalar >::getArgc ( ) const
inline

◆ getArgv() [1/2]

template<class Scalar >
char ** Opm::ReservoirCouplingMaster< Scalar >::getArgv ( ) const
inline

◆ getArgv() [2/2]

template<class Scalar >
char * Opm::ReservoirCouplingMaster< Scalar >::getArgv ( int  index) const
inline

◆ getComm()

template<class Scalar >
const Parallel::Communication & Opm::ReservoirCouplingMaster< Scalar >::getComm ( ) const
inline

◆ getLogger()

template<class Scalar >
ReservoirCoupling::Logger & Opm::ReservoirCouplingMaster< Scalar >::getLogger ( )
inline

◆ getMasterGroupCanonicalIdx()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMaster< Scalar >::getMasterGroupCanonicalIdx ( const std::string &  slave_name,
const std::string &  master_group_name 
) const

Get the canonical index of the master group for a given slave name and master group name. The index is used to map slave group data sent from the slaves, like potentials to the corresponding master group.

Parameters
slave_nameThe name of the slave reservoir.
master_group_nameThe name of the master group.
Returns
The canonical index of the master group for the given slave name and master group name.

◆ getMasterGroupNamesForSlave()

template<class Scalar >
const std::vector< std::string > & Opm::ReservoirCouplingMaster< Scalar >::getMasterGroupNamesForSlave ( std::size_t  slave_idx) const

Get the master group names associated with a slave reservoir by index.

This method retrieves the list of master group names that are associated with a specific slave reservoir identified by its index.

Parameters
slave_idxThe zero-based index of the slave reservoir (must be < numSlaves())
Returns
A const reference to a vector of master group names for the specified slave
Exceptions
std::runtime_errorif slave_idx is out of bounds
Note
Performance: This method uses O(1) direct vector access when possible, falling back to O(log n) map lookup for error handling.
See also
RescoupTargetCalculator::calculateAndSendTargets() for primary usage context

◆ getMasterGroupToSlaveNameMap()

template<class Scalar >
std::map< std::string, std::string > & Opm::ReservoirCouplingMaster< Scalar >::getMasterGroupToSlaveNameMap ( )
inline

◆ getSimulationStartDate()

template<class Scalar >
double Opm::ReservoirCouplingMaster< Scalar >::getSimulationStartDate ( ) const
inline

◆ getSlaveActivationDate()

template<class Scalar >
double Opm::ReservoirCouplingMaster< Scalar >::getSlaveActivationDate ( int  index) const
inline

◆ getSlaveActivationDates()

template<class Scalar >
const double * Opm::ReservoirCouplingMaster< Scalar >::getSlaveActivationDates ( ) const
inline

◆ getSlaveComm()

template<class Scalar >
MPI_Comm Opm::ReservoirCouplingMaster< Scalar >::getSlaveComm ( int  index) const
inline

◆ getSlaveGroupPotentials()

template<class Scalar >
const Potentials & Opm::ReservoirCouplingMaster< Scalar >::getSlaveGroupPotentials ( const std::string &  master_group_name)

◆ getSlaveName()

template<class Scalar >
const std::string & Opm::ReservoirCouplingMaster< Scalar >::getSlaveName ( int  index) const
inline

◆ getSlaveNameToMasterGroupsMap()

template<class Scalar >
std::map< std::string, std::vector< std::string > > & Opm::ReservoirCouplingMaster< Scalar >::getSlaveNameToMasterGroupsMap ( )
inline

◆ getSlaveStartDate()

template<class Scalar >
double Opm::ReservoirCouplingMaster< Scalar >::getSlaveStartDate ( int  index) const
inline

◆ getSlaveStartDates()

template<class Scalar >
const double * Opm::ReservoirCouplingMaster< Scalar >::getSlaveStartDates ( )
inline

◆ initStartOfReportStep()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::initStartOfReportStep ( int  report_step_idx)

◆ initTimeStepping()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::initTimeStepping ( )

◆ isMasterGroup()

template<class Scalar >
bool Opm::ReservoirCouplingMaster< Scalar >::isMasterGroup ( const std::string &  group_name) const

◆ maybeActivate()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::maybeActivate ( int  report_step)

◆ maybeChopSubStep()

template<class Scalar >
double Opm::ReservoirCouplingMaster< Scalar >::maybeChopSubStep ( double  suggested_timestep,
double  current_time 
) const

◆ maybeReceiveActivationHandshakeFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::maybeReceiveActivationHandshakeFromSlaves ( double  current_time)

◆ maybeSpawnSlaveProcesses()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::maybeSpawnSlaveProcesses ( int  report_step)

◆ numSlaveGroups()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMaster< Scalar >::numSlaveGroups ( unsigned int  index)

◆ numSlavesStarted()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMaster< Scalar >::numSlavesStarted ( ) const

◆ rebuildSlaveIdxToMasterGroupsVector()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::rebuildSlaveIdxToMasterGroupsVector ( )

◆ receiveInjectionDataFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::receiveInjectionDataFromSlaves ( )

◆ receiveNextReportDateFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::receiveNextReportDateFromSlaves ( )

◆ receiveProductionDataFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::receiveProductionDataFromSlaves ( )

◆ resizeNextReportDates()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::resizeNextReportDates ( int  size)

◆ resizeSlaveActivationDates()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::resizeSlaveActivationDates ( int  size)
inline

◆ resizeSlaveStartDates()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::resizeSlaveStartDates ( int  size)
inline

◆ schedule()

template<class Scalar >
const Schedule & Opm::ReservoirCouplingMaster< Scalar >::schedule ( ) const
inline

◆ sendNextTimeStepToSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::sendNextTimeStepToSlaves ( double  next_time_step)
inline

◆ setDeferredLogger()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::setDeferredLogger ( DeferredLogger deferred_logger)
inline

◆ setSlaveActivationDate()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::setSlaveActivationDate ( int  index,
double  date 
)
inline

◆ setSlaveNextReportTimeOffset()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::setSlaveNextReportTimeOffset ( int  index,
double  offset 
)

◆ setSlaveStartDate()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::setSlaveStartDate ( int  index,
std::time_t  date 
)
inline

◆ slaveIsActivated()

template<class Scalar >
bool Opm::ReservoirCouplingMaster< Scalar >::slaveIsActivated ( int  index) const
inline

◆ updateMasterGroupNameOrderMap()

template<class Scalar >
void Opm::ReservoirCouplingMaster< Scalar >::updateMasterGroupNameOrderMap ( const std::string &  slave_name,
const std::map< std::string, std::size_t > &  master_group_map 
)

The documentation for this class was generated from the following file: