28 #ifndef OPM_FLUID_STATE_PRESSURE_MODULES_HPP 29 #define OPM_FLUID_STATE_PRESSURE_MODULES_HPP 32 #include <opm/common/Valgrind.hpp> 33 #include <opm/common/Exceptions.hpp> 34 #include <opm/common/ErrorMacros.hpp> 44 template <
class Scalar,
51 { Valgrind::SetUndefined(pressure_); }
56 const Scalar&
pressure(
unsigned phaseIdx)
const 57 {
return pressure_[phaseIdx]; }
64 { pressure_[phaseIdx] = value; }
70 template <
class Flu
idState>
73 for (
unsigned phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx) {
74 pressure_[phaseIdx] = Opm::decay<Scalar>(fs.pressure(phaseIdx));
88 Valgrind::CheckDefined(pressure_);
92 Scalar pressure_[numPhases];
99 template <
class Scalar>
110 { OPM_THROW(std::logic_error,
"Pressure is not provided by this fluid state"); }
117 template <
class Flu
idState>
const Scalar & pressure(unsigned phaseIdx) const
The pressure of a fluid phase [Pa].
Definition: FluidStatePressureModules.hpp:56
Module for the modular fluid state which stores the pressures explicitly.
Definition: FluidStatePressureModules.hpp:47
void setPressure(unsigned phaseIdx, const Scalar &value)
Set the pressure of a phase [Pa].
Definition: FluidStatePressureModules.hpp:63
Definition: Air_Mesitylene.hpp:33
void checkDefined() const
Make sure that all attributes are defined.
Definition: FluidStatePressureModules.hpp:86
Module for the modular fluid state which does not the pressures but throws std::logic_error instead...
Definition: FluidStatePressureModules.hpp:100
void assign(const FluidState &fs)
Retrieve all parameters from an arbitrary fluid state.
Definition: FluidStatePressureModules.hpp:71
void assign(const FluidState &)
Retrieve all parameters from an arbitrary fluid state.
Definition: FluidStatePressureModules.hpp:118
const Scalar & pressure(unsigned) const
The pressure of a fluid phase [Pa].
Definition: FluidStatePressureModules.hpp:109
void checkDefined() const
Make sure that all attributes are defined.
Definition: FluidStatePressureModules.hpp:129