20#ifndef OPM_RESERVOIR_COUPLING_TIME_STEPPER_HPP
21#define OPM_RESERVOIR_COUPLING_TIME_STEPPER_HPP
23#include <opm/simulators/flow/rescoup/ReservoirCoupling.hpp>
24#include <opm/input/eclipse/Schedule/Schedule.hpp>
25#include <opm/simulators/utils/ParallelCommunication.hpp>
26#include <opm/common/OpmLog/OpmLog.hpp>
56template <
class Scalar>
59 using MessageTag = ReservoirCoupling::MessageTag;
71 const Parallel::Communication &
comm()
const {
return this->master_.getComm(); }
76 MPI_Comm
getSlaveComm(
int index)
const {
return this->master_.getSlaveComm(index); }
80 std::size_t
numSlaves()
const {
return this->master_.numSlavesStarted(); }
98 double maybeChopSubStep(
double suggested_timestep_original,
double elapsed_time)
const;
116 const Schedule&
schedule()
const {
return this->master_.schedule(); }
126 const std::string &
slaveName(
int index)
const {
return this->master_.getSlaveName(index); }
131 double slaveStartDate(
int index)
const {
return this->master_.getSlaveStartDate(index); }
153 this->slave_next_report_time_offsets_[index] = offset;
161 std::vector<double> slave_next_report_time_offsets_;
165 std::map<std::string, std::vector<Potentials>> slave_group_potentials_;
Definition ReservoirCouplingMaster.hpp:38
MPI_Comm getSlaveComm(int index) const
Get the MPI communicator for a specific slave process.
Definition ReservoirCouplingTimeStepper.hpp:76
const std::string & slaveName(int index) const
Get the name of a specific slave process.
Definition ReservoirCouplingTimeStepper.hpp:126
void sendNextTimeStepToSlaves(double timestep)
Send the next time step size to all active slave processes.
Definition ReservoirCouplingTimeStepper.cpp:146
std::size_t numSlaves() const
Get the total number of active slave processes.
Definition ReservoirCouplingTimeStepper.hpp:80
void resizeNextReportDates(int size)
Resize the internal storage for slave next report times.
Definition ReservoirCouplingTimeStepper.hpp:112
const Parallel::Communication & comm() const
Get the MPI communicator for master-to-master communication.
Definition ReservoirCouplingTimeStepper.hpp:71
double slaveStartDate(int index) const
Get the simulation start date for a specific slave.
Definition ReservoirCouplingTimeStepper.hpp:131
ReservoirCoupling::Logger & logger() const
Get the logger for reservoir coupling operations.
Definition ReservoirCouplingTimeStepper.hpp:84
double slaveActivationDate(int index) const
Get the activation date for a specific slave.
Definition ReservoirCouplingTimeStepper.hpp:136
void setSlaveNextReportTimeOffset(int index, double offset)
Set the next report time offset for a specific slave.
Definition ReservoirCouplingTimeStepper.hpp:152
bool slaveIsActivated(int index) const
Check if a specific slave process has been activated.
Definition ReservoirCouplingTimeStepper.hpp:121
ReservoirCouplingTimeStepper(ReservoirCouplingMaster< Scalar > &master)
Construct a time stepper for coordinating master-slave time stepping.
Definition ReservoirCouplingTimeStepper.cpp:41
void receiveNextReportDateFromSlaves()
Receive next report dates from all active slave processes.
Definition ReservoirCouplingTimeStepper.cpp:105
const Schedule & schedule() const
Get the simulation schedule.
Definition ReservoirCouplingTimeStepper.hpp:116
double maybeChopSubStep(double suggested_timestep_original, double elapsed_time) const
Potentially adjust time step to align with slave report boundaries.
Definition ReservoirCouplingTimeStepper.cpp:56
Definition ReservoirCoupling.hpp:42
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:45
Definition ReservoirCoupling.hpp:187
Utility class for comparing double values representing epoch dates or elapsed time.
Definition ReservoirCoupling.hpp:305