Opm::ECLUnits::Convert::Pressure Class Reference

#include <ECLPropertyUnitConversion.hpp>

Inheritance diagram for Opm::ECLUnits::Convert::Pressure:
Inheritance graph

Public Member Functions

void appliedTo (std::vector< double > &press) const override
 
PhysicalQuantityfrom (const UnitSystem &usys)
 
PhysicalQuantityto (const UnitSystem &usys)
 

Protected Member Functions

const UnitSystemfrom () const
 
const UnitSystemto () const
 

Detailed Description

Facility for converting pressure values between user-selected units of measure.

Member Function Documentation

◆ appliedTo()

void Opm::ECLUnits::Convert::Pressure::appliedTo ( std::vector< double > &  press) const
overridevirtual

Convert a sequence of pressure values from its input unit of measure to its output unit of measure.

Will throw an exception of type

std::invalid_argument

unless both of the input and output unit system conventions have been previously specified.

Example: Convert LGR-1's oil pressure values on restart step 123 from serialised format on disk (unified restart) to internal units of measure (SI).

const auto rstrt = ECLRestartData{ "Case.UNRST" };
const auto native = serialisedUnitConventions(rstrt);
const auto si = internalUnitConvention();
rstrt.selectReportStep(123);
auto press = rstrt.keywordData<double>("PRESSURE", "LGR-1");
Convert::Pressure().from(*native).to(*si).appliedTo(press);
Definition: ECLResultData.hpp:57
std::unique_ptr< const UnitSystem > serialisedUnitConventions(const ECLRestartData &rstrt)
@ Pressure
Definition: eclipse/VectorItems/aquifer.hpp:62
Parameters
[in,out]pressOn input, a sequence of pressure values assumed to be defined in the input unit specified through
from(usys)
const UnitSystem * from() const
. On output, the same seqeuence of pressure values converted to the output unit of measure specified through
to(usys)
.

Implements Opm::ECLUnits::Convert::PhysicalQuantity.

◆ from() [1/2]

const UnitSystem * Opm::ECLUnits::Convert::PhysicalQuantity::from ( ) const
protectedinherited

Retrieve input unit system.

Exists for the benefit of derived classes.

Returns
Input unit system. Null if not specified by caller.

◆ from() [2/2]

PhysicalQuantity & Opm::ECLUnits::Convert::PhysicalQuantity::from ( const UnitSystem usys)
inherited

Specify collection of units of measure of the inputs.

Parameters
[in]usysCollection of units of measure of inputs.
Returns
*this
.

◆ to() [1/2]

const UnitSystem * Opm::ECLUnits::Convert::PhysicalQuantity::to ( ) const
protectedinherited

Retrieve output unit system.

Exists for the benefit of derived classes.

Returns
Output unit system. Null if not specified by caller.

◆ to() [2/2]

PhysicalQuantity & Opm::ECLUnits::Convert::PhysicalQuantity::to ( const UnitSystem usys)
inherited

Specify collection of units of measure of the output.

Parameters
[in]usysCollection of units of measure of outputs.
Returns
*this
.

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