Opm::ReservoirCouplingSlaveReportStep< Scalar > Class Template Reference

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

#include <ReservoirCouplingSlaveReportStep.hpp>

Public Types

using InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget< Scalar >
 
using ProductionGroupTarget = ReservoirCoupling::ProductionGroupTarget< Scalar >
 
using MessageTag = ReservoirCoupling::MessageTag
 
using SlaveGroupProductionData = ReservoirCoupling::SlaveGroupProductionData< Scalar >
 
using SlaveGroupInjectionData = ReservoirCoupling::SlaveGroupInjectionData< Scalar >
 

Public Member Functions

 ReservoirCouplingSlaveReportStep (ReservoirCouplingSlave< Scalar > &slave)
 Construct a report step manager for the slave process. More...
 
const Parallel::Communicationcomm () const
 Get the MPI communicator for intra-slave communication. More...
 
MPI_Comm getSlaveMasterComm () const
 Get the MPI communicator for slave-master communication. More...
 
bool isFirstSubstepOfSyncTimestep () const
 Check if this is the first substep within a "sync" timestep. More...
 
ReservoirCoupling::Loggerlogger () const
 Get the logger for reservoir coupling operations. More...
 
void sendProductionDataToMaster (const std::vector< SlaveGroupProductionData > &production_data) const
 Send production data to the master process. More...
 
void sendInjectionDataToMaster (const std::vector< SlaveGroupInjectionData > &injection_data) const
 Send injection data to the master process. More...
 
void setFirstSubstepOfSyncTimestep (bool value)
 Set whether this is the first substep within a "sync" timestep. More...
 
const std::string & slaveName () const
 Get the name of this slave process. More...
 
std::pair< std::size_t, std::size_t > receiveNumGroupTargetsFromMaster () const
 
void receiveInjectionGroupTargetsFromMaster (std::size_t num_targets) const
 
void receiveProductionGroupTargetsFromMaster (std::size_t num_targets) const
 

Detailed Description

template<class Scalar>
class Opm::ReservoirCouplingSlaveReportStep< Scalar >

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

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

  • Sending production data (rates, potentials) to the master process via MPI
  • Sending injection data (rates) to the master process via MPI
  • Coordinating data exchange between slave and master processes

The class serves as a helper to ReservoirCouplingSlave, separating the report-step-specific communication 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 a reference to the parent ReservoirCouplingSlave object and should only be used within the scope of that object's lifetime
See also
ReservoirCouplingSlave

Member Typedef Documentation

◆ InjectionGroupTarget

template<class Scalar >
using Opm::ReservoirCouplingSlaveReportStep< Scalar >::InjectionGroupTarget = ReservoirCoupling::InjectionGroupTarget<Scalar>

◆ MessageTag

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

◆ ProductionGroupTarget

template<class Scalar >
using Opm::ReservoirCouplingSlaveReportStep< Scalar >::ProductionGroupTarget = ReservoirCoupling::ProductionGroupTarget<Scalar>

◆ SlaveGroupInjectionData

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

◆ SlaveGroupProductionData

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

Constructor & Destructor Documentation

◆ ReservoirCouplingSlaveReportStep()

template<class Scalar >
Opm::ReservoirCouplingSlaveReportStep< Scalar >::ReservoirCouplingSlaveReportStep ( ReservoirCouplingSlave< Scalar > &  slave)

Construct a report step manager for the slave process.

Parameters
slaveReference to the parent ReservoirCouplingSlave object

Member Function Documentation

◆ comm()

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

Get the MPI communicator for intra-slave communication.

Returns
Reference to the parallel communication object

◆ getSlaveMasterComm()

template<class Scalar >
MPI_Comm Opm::ReservoirCouplingSlaveReportStep< Scalar >::getSlaveMasterComm ( ) const
inline

Get the MPI communicator for slave-master communication.

Returns
MPI communicator handle for communication with the master process

◆ isFirstSubstepOfSyncTimestep()

template<class Scalar >
bool Opm::ReservoirCouplingSlaveReportStep< Scalar >::isFirstSubstepOfSyncTimestep ( ) const
inline

Check if this is the first substep within a "sync" timestep.

This flag is used to control reservoir coupling synchronization. Master-slave data exchange should only happen at the start of each "sync" timestep, not on internal substeps or at retries after convergence chops.

Returns
true if this is the first substep of a "sync" timestep, false if not

◆ logger()

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

Get the logger for reservoir coupling operations.

Returns
Reference to the logger object for this coupling session

◆ receiveInjectionGroupTargetsFromMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveInjectionGroupTargetsFromMaster ( std::size_t  num_targets) const

◆ receiveNumGroupTargetsFromMaster()

template<class Scalar >
std::pair< std::size_t, std::size_t > Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveNumGroupTargetsFromMaster ( ) const

◆ receiveProductionGroupTargetsFromMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::receiveProductionGroupTargetsFromMaster ( std::size_t  num_targets) const

◆ sendInjectionDataToMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::sendInjectionDataToMaster ( const std::vector< SlaveGroupInjectionData > &  injection_data) const

Send injection data to the master process.

This method sends injection rates and related data for all slave groups to the master process via MPI communication. The data is used by the master for group control calculations and coordination.

Parameters
injection_dataVector of injection data for each slave group
Note
This is a blocking operation that waits for the master to receive the data
Must be called before the master attempts to receive injection data

◆ sendProductionDataToMaster()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::sendProductionDataToMaster ( const std::vector< SlaveGroupProductionData > &  production_data) const

Send production data to the master process.

This method sends production rates, potentials, and related data for all slave groups to the master process via MPI communication. The data is used by the master for group control calculations and coordination.

Parameters
production_dataVector of production data for each slave group
Note
This is a blocking operation that waits for the master to receive the data
Must be called before the master attempts to receive production data

◆ setFirstSubstepOfSyncTimestep()

template<class Scalar >
void Opm::ReservoirCouplingSlaveReportStep< Scalar >::setFirstSubstepOfSyncTimestep ( bool  value)
inline

Set whether this is the first substep within a "sync" timestep.

Parameters
valuetrue at start of sync timestep, false after first runSubStep_() call

◆ slaveName()

template<class Scalar >
const std::string & Opm::ReservoirCouplingSlaveReportStep< Scalar >::slaveName ( ) const
inline

Get the name of this slave process.

Returns
Reference to the name string for this slave

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