|
opm-simulators
|
Manages time stepping coordination between master and slave processes. More...
#include <ReservoirCouplingTimeStepper.hpp>
Public Types | |
| using | MessageTag = ReservoirCoupling::MessageTag |
| using | Potentials = ReservoirCoupling::Potentials<Scalar> |
| using | Seconds = ReservoirCoupling::Seconds |
Public Member Functions | |
| ReservoirCouplingTimeStepper (ReservoirCouplingMaster< Scalar > &master) | |
| Construct a time stepper for coordinating master-slave time stepping. | |
| const Parallel::Communication & | comm () const |
| Get the MPI communicator for master-to-master communication. | |
| MPI_Comm | getSlaveComm (int index) const |
| Get the MPI communicator for a specific slave process. | |
| std::size_t | numSlaves () const |
| Get the total number of active slave processes. | |
| ReservoirCoupling::Logger & | logger () const |
| Get the logger for reservoir coupling operations. | |
| double | maybeChopSubStep (double suggested_timestep_original, double elapsed_time) const |
| Potentially adjust time step to align with slave report boundaries. | |
| void | receiveNextReportDateFromSlaves () |
| Receive next report dates from all active slave processes. | |
| void | resizeNextReportDates (int size) |
| Resize the internal storage for slave next report times. | |
| const Schedule & | schedule () const |
| Get the simulation schedule. | |
| bool | slaveIsActivated (int index) const |
| Check if a specific slave process has been activated. | |
| const std::string & | slaveName (int index) const |
| Get the name of a specific slave process. | |
| double | slaveStartDate (int index) const |
| Get the simulation start date for a specific slave. | |
| double | slaveActivationDate (int index) const |
| Get the activation date for a specific slave. | |
| void | sendNextTimeStepToSlaves (double timestep) |
| Send the next time step size to all active slave processes. | |
| void | setSlaveNextReportTimeOffset (int index, double offset) |
| Set the next report time offset for a specific slave. | |
Manages time stepping coordination between master and slave processes.
This class handles the synchronization of time steps and report dates between the master and slave processes in reservoir coupling simulations. It is responsible for:
The class ensures that the master and all slaves advance through simulation time in a coordinated manner, respecting individual slave report schedules while maintaining overall simulation consistency.
| Scalar | Floating-point type for time and rate values (typically double or float) |
| Opm::ReservoirCouplingTimeStepper< Scalar >::ReservoirCouplingTimeStepper | ( | ReservoirCouplingMaster< Scalar > & | master | ) |
Construct a time stepper for coordinating master-slave time stepping.
| master | Reference to the parent ReservoirCouplingMaster object |
|
inline |
Get the MPI communicator for master-to-master communication.
|
inline |
Get the MPI communicator for a specific slave process.
| index | Index of the slave process |
|
inline |
Get the logger for reservoir coupling operations.
| double Opm::ReservoirCouplingTimeStepper< Scalar >::maybeChopSubStep | ( | double | suggested_timestep_original, |
| double | elapsed_time ) const |
Potentially adjust time step to align with slave report boundaries.
This method checks if the suggested time step would cause the master simulation to advance past any slave's next report time. If so, it "chops" the time step to ensure the master stops at the slave's report boundary, allowing for proper synchronization between master and slave processes.
| suggested_timestep_original | The original suggested time step size (in seconds) |
| elapsed_time | Elapsed time from the beginning of the simulation (in seconds) |
|
inline |
Get the total number of active slave processes.
| void Opm::ReservoirCouplingTimeStepper< Scalar >::receiveNextReportDateFromSlaves | ( | ) |
Receive next report dates from all active slave processes.
This method receives the next report time from each slave process via MPI communication. The times are stored as offsets from the simulation start time and used to coordinate time stepping between master and slaves.
|
inline |
Resize the internal storage for slave next report times.
| size | Number of slave processes to allocate storage for |
|
inline |
Get the simulation schedule.
| void Opm::ReservoirCouplingTimeStepper< Scalar >::sendNextTimeStepToSlaves | ( | double | timestep | ) |
Send the next time step size to all active slave processes.
This method broadcasts the time step size that slaves should use for their next simulation step via MPI communication. This ensures all processes advance through simulation time in a coordinated manner.
| timestep | Time step size to send to slaves (in seconds) |
|
inline |
Set the next report time offset for a specific slave.
| index | Index of the slave process |
| offset | Time offset from simulation start to the slave's next report time (in seconds) |
|
inline |
Get the activation date for a specific slave.
| index | Index of the slave process |
|
inline |
Check if a specific slave process has been activated.
| index | Index of the slave process |
|
inline |
Get the name of a specific slave process.
| index | Index of the slave process |
|
inline |
Get the simulation start date for a specific slave.
| index | Index of the slave process |