20#ifndef OPM_RESERVOIR_COUPLING_HPP
21#define OPM_RESERVOIR_COUPLING_HPP
22#include <opm/simulators/utils/DeferredLogger.hpp>
24#include <dune/common/parallel/mpitraits.hh>
33namespace ReservoirCoupling {
38 void clearDeferredLogger() { deferred_logger_ =
nullptr; }
39 bool haveDeferredLogger()
const {
return deferred_logger_ !=
nullptr; }
40 void info(
const std::string &msg)
const;
41 void setDeferredLogger(
DeferredLogger *deferred_logger) { deferred_logger_ = deferred_logger; }
47enum class MessageTag :
int {
52 SlaveSimulationStartDate,
54 SlaveActivationHandshake,
55 SlaveProcessTermination,
64 enum class Phase : std::size_t { Oil = 0, Gas, Water, Count };
66 std::array<double, static_cast<std::size_t>(Phase::Count)> rate{};
68 [[nodiscard]]
double& operator[](Phase p)
noexcept {
return rate[
static_cast<std::size_t
>(p)]; }
69 [[nodiscard]]
double operator[](Phase p)
const noexcept {
return rate[
static_cast<std::size_t
>(p)]; }
74void custom_error_handler_(MPI_Comm* comm,
int* err,
const std::string &msg);
75void setErrhandler(MPI_Comm comm,
bool is_master);
76std::pair<std::vector<char>, std::size_t> serializeStrings(
const std::vector<std::string>& data);
97 static constexpr double abstol = 1e-15;
Definition DeferredLogger.hpp:57
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
Definition ReservoirCoupling.hpp:63
Utility class for comparing double values representing epoch dates or elapsed time.
Definition ReservoirCoupling.hpp:95
static bool compare_eq(double a, double b)
Determines if two double values are equal within a specified tolerance.
Definition ReservoirCoupling.cpp:114
static bool compare_gt(double a, double b)
Determines if a is greater than b within the specified tolerance.
Definition ReservoirCoupling.cpp:135
static bool compare_lt_or_eq(double a, double b)
Determines if a is less than or equal to b within the specified tolerance.
Definition ReservoirCoupling.cpp:141
static constexpr double reltol
Relative tolerance used for comparisons.
Definition ReservoirCoupling.hpp:100
static bool compare_gt_or_eq(double a, double b)
Determines if a is greater than b within the specified tolerance.
Definition ReservoirCoupling.cpp:120
static bool compare_lt(double a, double b)
Determines if a is less than b within the specified tolerance.
Definition ReservoirCoupling.cpp:129
static constexpr double abstol
Absolute tolerance used for comparisons.
Definition ReservoirCoupling.hpp:97