Opm::ReservoirCouplingMasterReportStep< Scalar > Class Template Reference

Manages master-side reservoir coupling operations for a single report step. More...

#include <ReservoirCouplingMasterReportStep.hpp>

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

Public Types

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

Public Member Functions

 ReservoirCouplingMasterReportStep (ReservoirCouplingMaster< Scalar > &master)
 Construct a report step manager for the master process. More...
 
const Parallel::Communicationcomm () const
 Get the MPI communicator for master-slave communication. More...
 
const std::vector< std::string > & getMasterGroupNamesForSlave (std::size_t slave_idx) const
 Get the names of master groups associated with a specific slave. More...
 
const std::map< std::string, std::string > & getMasterGroupToSlaveNameMap () const
 Get the mapping from master group names to slave names. More...
 
std::size_t getMasterGroupCanonicalIdx (const std::string &slave_name, const std::string &master_group_name) const
 Get the canonical index for a master group. More...
 
MPI_Comm getSlaveComm (int index) const
 Get the MPI communicator for a specific slave process. More...
 
const PotentialsgetSlaveGroupPotentials (const std::string &master_group_name) const
 Get the production potentials for a slave group. More...
 
void maybeReceiveGroupInfoFromSlaves ()
 Receive group information from slaves if needed. More...
 
std::size_t numSlaveGroups (unsigned int index) const
 Get the number of slave groups for a specific slave process. More...
 
std::size_t numSlaves () const
 Get the total number of active slave processes. More...
 
ReservoirCoupling::Loggerlogger () const
 Get the logger for reservoir coupling operations. More...
 
void receiveInjectionDataFromSlaves ()
 Receive injection data from all active slave processes. More...
 
void receiveProductionDataFromSlaves ()
 Receive production data from all active slave processes. More...
 
const Schedule & schedule () const
 Get the simulation schedule. More...
 
void sendGroupInfoToSlaves (int report_step_idx)
 Send group control information to all slaves for a specific report step. More...
 
void setReportStepIdx (int report_step_idx)
 Set the current report step index. More...
 
bool slaveIsActivated (int index) const
 Check if a specific slave process has been activated. More...
 
const std::string & slaveName (int index) const
 Get the name of a specific slave process. More...
 

Detailed Description

template<class Scalar>
class Opm::ReservoirCouplingMasterReportStep< Scalar >

Manages master-side reservoir coupling operations for a single report step.

This class encapsulates the master process's communication and coordination with slave processes during a single report step in reservoir coupling simulations. It handles:

  • Receiving production and injection data from slave processes via MPI
  • Sending group control information and constraints to slaves
  • Managing slave group potentials and production/injection data
  • Coordinating the exchange of information between master and slave groups

The class serves as a helper to ReservoirCouplingMaster, separating the report-step-specific logic from the overall coupling lifecycle management. This separation improves code organization and makes the coupling logic easier to understand and maintain.

Template Parameters
ScalarFloating-point type for rate and potential values (typically double or float)
Note
This class holds references to the parent ReservoirCouplingMaster object and should only be used within the scope of that object's lifetime
See also
ReservoirCouplingMaster

Member Typedef Documentation

◆ MessageTag

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

◆ Potentials

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

◆ SlaveGroupInjectionData

template<class Scalar >
using Opm::ReservoirCouplingMasterReportStep< Scalar >::SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData<Scalar>

◆ SlaveGroupProductionData

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

Constructor & Destructor Documentation

◆ ReservoirCouplingMasterReportStep()

template<class Scalar >
Opm::ReservoirCouplingMasterReportStep< Scalar >::ReservoirCouplingMasterReportStep ( ReservoirCouplingMaster< Scalar > &  master)

Construct a report step manager for the master process.

Parameters
masterReference to the parent ReservoirCouplingMaster object

Member Function Documentation

◆ comm()

template<class Scalar >
const Parallel::Communication & Opm::ReservoirCouplingMasterReportStep< Scalar >::comm ( ) const
inline

Get the MPI communicator for master-slave communication.

Returns
Reference to the parallel communication object

◆ getMasterGroupCanonicalIdx()

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

Get the canonical index for a master group.

Parameters
slave_nameName of the slave process
master_group_nameName of the master group
Returns
Canonical index for the specified master group in the context of the slave

◆ getMasterGroupNamesForSlave()

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

Get the names of master groups associated with a specific slave.

Parameters
slave_idxIndex of the slave process
Returns
Vector of master group names that this slave is connected to

◆ getMasterGroupToSlaveNameMap()

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

Get the mapping from master group names to slave names.

Returns
Map from master group name to the corresponding slave name

◆ getSlaveComm()

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

Get the MPI communicator for a specific slave process.

Parameters
indexIndex of the slave process
Returns
MPI communicator handle for communication with the specified slave

◆ getSlaveGroupPotentials()

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

Get the production potentials for a slave group.

Parameters
master_group_nameName of the master group
Returns
Reference to the potentials data for the specified group

◆ logger()

template<class Scalar >
ReservoirCoupling::Logger & Opm::ReservoirCouplingMasterReportStep< Scalar >::logger ( ) const
inline

Get the logger for reservoir coupling operations.

Returns
Reference to the logger object for this coupling session

◆ maybeReceiveGroupInfoFromSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::maybeReceiveGroupInfoFromSlaves ( )

Receive group information from slaves if needed.

This method conditionally receives group information from slave processes. The reception is triggered based on simulation state and timing requirements.

◆ numSlaveGroups()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMasterReportStep< Scalar >::numSlaveGroups ( unsigned int  index) const
inline

Get the number of slave groups for a specific slave process.

Parameters
indexIndex of the slave process
Returns
Number of groups managed by the specified slave

◆ numSlaves()

template<class Scalar >
std::size_t Opm::ReservoirCouplingMasterReportStep< Scalar >::numSlaves ( ) const
inline

Get the total number of active slave processes.

Returns
Number of slaves that have been started

◆ receiveInjectionDataFromSlaves()

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

Receive injection data from all active slave processes.

This method receives injection rates and related data from each slave process via MPI communication. The data is organized by slave groups and stored in slave_group_injection_data_ for use in group control calculations.

Note
This is a blocking operation that waits for all slaves to send data
Must be called after slaves have computed and sent their injection data

◆ receiveProductionDataFromSlaves()

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

Receive production data from all active slave processes.

This method receives production rates, potentials, and related data from each slave process via MPI communication. The data is organized by slave groups and stored in slave_group_production_data_ for use in group control calculations.

Note
This is a blocking operation that waits for all slaves to send data
Must be called after slaves have computed and sent their production data

◆ schedule()

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

Get the simulation schedule.

Returns
Reference to the Schedule object containing well and group definitions

◆ sendGroupInfoToSlaves()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::sendGroupInfoToSlaves ( int  report_step_idx)

Send group control information to all slaves for a specific report step.

Parameters
report_step_idxIndex of the report step for which to send group info

This method sends group control information (targets, constraints, well controls) from the master to each slave process. Each slave receives the information relevant to the groups it manages.

◆ setReportStepIdx()

template<class Scalar >
void Opm::ReservoirCouplingMasterReportStep< Scalar >::setReportStepIdx ( int  report_step_idx)

Set the current report step index.

Parameters
report_step_idxThe report step index to set

This updates the internal state to track which report step is currently being processed.

◆ slaveIsActivated()

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

Check if a specific slave process has been activated.

Parameters
indexIndex of the slave process
Returns
true if the slave is activated, false otherwise

◆ slaveName()

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

Get the name of a specific slave process.

Parameters
indexIndex of the slave process
Returns
Reference to the name string for the specified slave

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