Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | List of all members
PhQ::TotalPressure< NumericType > Class Template Reference

Total pressure, which is the sum of static pressure and dynamic pressure; see PhQ::StaticPressure and PhQ::DynamicPressure. For total kinematic pressure, see PhQ::TotalKinematicPressure. More...

#include "TotalPressure.hpp"

Public Member Functions

 TotalPressure ()=default
 Default constructor. Constructs a total pressure with an uninitialized value. More...
 
 TotalPressure (const NumericType value, const Unit::Pressure unit)
 Constructor. Constructs a total pressure with a given value expressed in a given pressure unit. More...
 
constexpr TotalPressure (const StaticPressure< NumericType > &static_pressure, const DynamicPressure< NumericType > &dynamic_pressure)
 Constructor. Constructs a total pressure from a given static pressure and dynamic pressure using the definition of total pressure. More...
 
constexpr TotalPressure (const MassDensity< NumericType > &mass_density, const TotalKinematicPressure< NumericType > &total_kinematic_pressure)
 Constructor. Constructs a total pressure from a given mass density and total kinematic pressure using the definition of total kinematic pressure. More...
 
 ~TotalPressure () noexcept=default
 Destructor. Destroys this total pressure. More...
 
constexpr TotalPressure (const TotalPressure< NumericType > &other)=default
 Copy constructor. Constructs a total pressure by copying another one. More...
 
template<typename OtherNumericType >
constexpr TotalPressure (const TotalPressure< OtherNumericType > &other)
 Copy constructor. Constructs a total pressure by copying another one. More...
 
constexpr TotalPressure (TotalPressure< NumericType > &&other) noexcept=default
 Move constructor. Constructs a total pressure by moving another one. More...
 
constexpr TotalPressure< NumericType > & operator= (const TotalPressure< NumericType > &other)=default
 Copy assignment operator. Assigns this total pressure by copying another one. More...
 
template<typename OtherNumericType >
constexpr TotalPressure< NumericType > & operator= (const TotalPressure< OtherNumericType > &other)
 Copy assignment operator. Assigns this total pressure by copying another one. More...
 
constexpr TotalPressure< NumericType > & operator= (TotalPressure< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this total pressure by moving another one. More...
 
constexpr TotalPressure< NumericType > operator+ (const TotalPressure< NumericType > &total_pressure) const
 
constexpr TotalPressure< NumericType > operator- (const TotalPressure< NumericType > &total_pressure) const
 
constexpr DynamicPressure< NumericType > operator- (const StaticPressure< NumericType > &static_pressure) const
 
constexpr StaticPressure< NumericType > operator- (const DynamicPressure< NumericType > &dynamic_pressure) const
 
constexpr TotalPressure< NumericType > operator* (const NumericType number) const
 
constexpr TotalPressure< NumericType > operator/ (const NumericType number) const
 
constexpr NumericType operator/ (const TotalPressure< NumericType > &total_pressure) const noexcept
 
constexpr TotalKinematicPressure< NumericType > operator/ (const MassDensity< NumericType > &mass_density) const
 
constexpr void operator+= (const TotalPressure< NumericType > &total_pressure) noexcept
 
constexpr void operator-= (const TotalPressure< NumericType > &total_pressure) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr double Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
double Value (const Unit::Pressure unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr double StaticValue () const
 Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time. More...
 
constexpr double & MutableValue () noexcept
 Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value. More...
 
constexpr void SetValue (const double value) noexcept
 Sets the value of this physical quantity expressed in its standard unit of measure to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string Print (const Unit::Pressure unit) const
 Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string JSON (const Unit::Pressure unit) const
 Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string XML (const Unit::Pressure unit) const
 Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure. More...
 
std::string YAML (const Unit::Pressure unit) const
 Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure. More...
 

Static Public Member Functions

static constexpr TotalPressure< NumericType > Zero ()
 Statically creates a total pressure of zero. More...
 
template<Unit::Pressure Unit>
static constexpr TotalPressure< NumericType > Create (const NumericType value)
 Statically creates a total pressure with a given value expressed in a given pressure unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::Pressure Unit ()
 Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure. More...
 

Protected Attributes

double value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr TotalPressure (const NumericType value)
 Constructor. Constructs a total pressure with a given value expressed in the standard pressure unit. More...
 

Detailed Description

template<typename NumericType = double>
class PhQ::TotalPressure< NumericType >

Total pressure, which is the sum of static pressure and dynamic pressure; see PhQ::StaticPressure and PhQ::DynamicPressure. For total kinematic pressure, see PhQ::TotalKinematicPressure.

Definition at line 48 of file TotalPressure.hpp.

Constructor & Destructor Documentation

◆ TotalPressure() [1/8]

template<typename NumericType = double>
PhQ::TotalPressure< NumericType >::TotalPressure ( )
default

Default constructor. Constructs a total pressure with an uninitialized value.

◆ TotalPressure() [2/8]

template<typename NumericType = double>
PhQ::TotalPressure< NumericType >::TotalPressure ( const NumericType  value,
const Unit::Pressure  unit 
)
inline

Constructor. Constructs a total pressure with a given value expressed in a given pressure unit.

Definition at line 55 of file TotalPressure.hpp.

◆ TotalPressure() [3/8]

template<typename NumericType = double>
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( const StaticPressure< NumericType > &  static_pressure,
const DynamicPressure< NumericType > &  dynamic_pressure 
)
inlineconstexpr

Constructor. Constructs a total pressure from a given static pressure and dynamic pressure using the definition of total pressure.

Definition at line 60 of file TotalPressure.hpp.

◆ TotalPressure() [4/8]

template<typename NumericType >
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( const MassDensity< NumericType > &  mass_density,
const TotalKinematicPressure< NumericType > &  total_kinematic_pressure 
)
inlineconstexpr

Constructor. Constructs a total pressure from a given mass density and total kinematic pressure using the definition of total kinematic pressure.

Definition at line 220 of file TotalKinematicPressure.hpp.

◆ ~TotalPressure()

template<typename NumericType = double>
PhQ::TotalPressure< NumericType >::~TotalPressure ( )
defaultnoexcept

Destructor. Destroys this total pressure.

◆ TotalPressure() [5/8]

template<typename NumericType = double>
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( const TotalPressure< NumericType > &  other)
constexprdefault

Copy constructor. Constructs a total pressure by copying another one.

◆ TotalPressure() [6/8]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( const TotalPressure< OtherNumericType > &  other)
inlineexplicitconstexpr

Copy constructor. Constructs a total pressure by copying another one.

Definition at line 77 of file TotalPressure.hpp.

◆ TotalPressure() [7/8]

template<typename NumericType = double>
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( TotalPressure< NumericType > &&  other)
constexprdefaultnoexcept

Move constructor. Constructs a total pressure by moving another one.

◆ TotalPressure() [8/8]

template<typename NumericType = double>
constexpr PhQ::TotalPressure< NumericType >::TotalPressure ( const NumericType  value)
inlineexplicitconstexprprivate

Constructor. Constructs a total pressure with a given value expressed in the standard pressure unit.

Definition at line 165 of file TotalPressure.hpp.

Member Function Documentation

◆ Create()

template<typename NumericType = double>
template<Unit::Pressure Unit>
static constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::Create ( const NumericType  value)
inlinestaticconstexpr

Statically creates a total pressure with a given value expressed in a given pressure unit.

Definition at line 106 of file TotalPressure.hpp.

References PhQ::DimensionalScalar< Unit::Pressure, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::Pressure , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 54 of file DimensionalScalar.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::JSON ( ) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 107 of file DimensionalScalar.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::JSON ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as a JSON message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 117 of file DimensionalScalar.hpp.

◆ MutableValue()

constexpr double & PhQ::DimensionalScalar< Unit::Pressure , double >::MutableValue ( )
inlineconstexprnoexceptinherited

Returns the value of this physical quantity expressed in its standard unit of measure as a mutable value.

Definition at line 83 of file DimensionalScalar.hpp.

◆ operator*()

template<typename NumericType = double>
constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::operator* ( const NumericType  number) const
inlineconstexpr

◆ operator*=()

template<typename NumericType = double>
constexpr void PhQ::TotalPressure< NumericType >::operator*= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator+()

template<typename NumericType = double>
constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::operator+ ( const TotalPressure< NumericType > &  total_pressure) const
inlineconstexpr

◆ operator+=()

template<typename NumericType = double>
constexpr void PhQ::TotalPressure< NumericType >::operator+= ( const TotalPressure< NumericType > &  total_pressure)
inlineconstexprnoexcept

◆ operator-() [1/3]

template<typename NumericType = double>
constexpr StaticPressure<NumericType> PhQ::TotalPressure< NumericType >::operator- ( const DynamicPressure< NumericType > &  dynamic_pressure) const
inlineconstexpr

Definition at line 126 of file TotalPressure.hpp.

◆ operator-() [2/3]

template<typename NumericType = double>
constexpr DynamicPressure<NumericType> PhQ::TotalPressure< NumericType >::operator- ( const StaticPressure< NumericType > &  static_pressure) const
inlineconstexpr

Definition at line 121 of file TotalPressure.hpp.

◆ operator-() [3/3]

template<typename NumericType = double>
constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::operator- ( const TotalPressure< NumericType > &  total_pressure) const
inlineconstexpr

◆ operator-=()

template<typename NumericType = double>
constexpr void PhQ::TotalPressure< NumericType >::operator-= ( const TotalPressure< NumericType > &  total_pressure)
inlineconstexprnoexcept

◆ operator/() [1/3]

template<typename NumericType >
constexpr TotalKinematicPressure< NumericType > PhQ::TotalPressure< NumericType >::operator/ ( const MassDensity< NumericType > &  mass_density) const
inlineconstexpr

Definition at line 254 of file TotalKinematicPressure.hpp.

◆ operator/() [2/3]

template<typename NumericType = double>
constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::operator/ ( const NumericType  number) const
inlineconstexpr

◆ operator/() [3/3]

template<typename NumericType = double>
constexpr NumericType PhQ::TotalPressure< NumericType >::operator/ ( const TotalPressure< NumericType > &  total_pressure) const
inlineconstexprnoexcept

◆ operator/=()

template<typename NumericType = double>
constexpr void PhQ::TotalPressure< NumericType >::operator/= ( const NumericType  number)
inlineconstexprnoexcept

◆ operator=() [1/3]

template<typename NumericType = double>
constexpr TotalPressure<NumericType>& PhQ::TotalPressure< NumericType >::operator= ( const TotalPressure< NumericType > &  other)
constexprdefault

Copy assignment operator. Assigns this total pressure by copying another one.

◆ operator=() [2/3]

template<typename NumericType = double>
template<typename OtherNumericType >
constexpr TotalPressure<NumericType>& PhQ::TotalPressure< NumericType >::operator= ( const TotalPressure< OtherNumericType > &  other)
inlineconstexpr

Copy assignment operator. Assigns this total pressure by copying another one.

Definition at line 89 of file TotalPressure.hpp.

References PhQ::DimensionalScalar< UnitType, NumericType >::Value(), and PhQ::DimensionalScalar< Unit::Pressure, double >::value.

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr TotalPressure<NumericType>& PhQ::TotalPressure< NumericType >::operator= ( TotalPressure< NumericType > &&  other)
constexprdefaultnoexcept

Move assignment operator. Assigns this total pressure by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::Print ( ) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 95 of file DimensionalScalar.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::Print ( const UnitType  unit) const
inlineinherited

Prints this physical quantity as a string. This physical quantity's value is expressed in the given unit of measure.

Definition at line 101 of file DimensionalScalar.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalScalar< Unit::Pressure , double >::SetValue ( const NumericType  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity expressed in its standard unit of measure to the given value.

Definition at line 89 of file DimensionalScalar.hpp.

◆ StaticValue()

constexpr double PhQ::DimensionalScalar< Unit::Pressure , double >::StaticValue ( ) const
inlineconstexprinherited

Value of this physical quantity expressed in a given unit of measure. This method can be evaluated statically at compile-time.

Definition at line 77 of file DimensionalScalar.hpp.

◆ Unit()

static constexpr Unit::Pressure PhQ::DimensionalScalar< Unit::Pressure , double >::Unit ( )
inlinestaticconstexprinherited

Standard unit of measure for this physical quantity. This physical quantity's value is stored internally in this unit of measure.

Definition at line 60 of file DimensionalScalar.hpp.

◆ Value() [1/2]

constexpr double PhQ::DimensionalScalar< Unit::Pressure , double >::Value ( ) const
inlineconstexprnoexceptinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 65 of file DimensionalScalar.hpp.

◆ Value() [2/2]

double PhQ::DimensionalScalar< Unit::Pressure , double >::Value ( const UnitType  unit) const
inlineinherited

Value of this physical quantity expressed in a given unit of measure.

Definition at line 70 of file DimensionalScalar.hpp.

◆ XML() [1/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::XML ( ) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 127 of file DimensionalScalar.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::XML ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as an XML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 137 of file DimensionalScalar.hpp.

◆ YAML() [1/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::YAML ( ) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in its standard unit of measure.

Definition at line 147 of file DimensionalScalar.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalScalar< Unit::Pressure , double >::YAML ( const UnitType  unit) const
inlineinherited

Serializes this physical quantity as a YAML message. This physical quantity's value is expressed in the given unit of measure.

Definition at line 157 of file DimensionalScalar.hpp.

◆ Zero()

template<typename NumericType = double>
static constexpr TotalPressure<NumericType> PhQ::TotalPressure< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a total pressure of zero.

Definition at line 99 of file TotalPressure.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::Pressure , double >::value
protectedinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 221 of file DimensionalScalar.hpp.


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