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::VolumeRate< NumericType > Class Template Reference

Volume rate. Can represent a time rate of change of a volume or a volume flow rate. See also PhQ::Volume, PhQ::Time, and PhQ::Frequency. More...

#include "VolumeRate.hpp"

Public Member Functions

 VolumeRate ()=default
 Default constructor. Constructs a volume rate with an uninitialized value. More...
 
 VolumeRate (const NumericType value, const Unit::VolumeRate unit)
 Constructor. Constructs a volume rate with a given value expressed in a given volume rate unit. More...
 
constexpr VolumeRate (const Volume< NumericType > &volume, const Time< NumericType > &time)
 Constructor. Constructs a volume rate from a given volume and time using the definition of volume rate. More...
 
constexpr VolumeRate (const Volume< NumericType > &volume, const Frequency< NumericType > &frequency)
 Constructor. Constructs a volume rate from a given volume and frequency using the definition of volume rate. More...
 
constexpr VolumeRate (const MassRate< NumericType > &mass_rate, const MassDensity< NumericType > &mass_density)
 Constructor. Constructs a volume rate from a given mass rate and mass density using the definition of mass density. More...
 
 ~VolumeRate () noexcept=default
 Destructor. Destroys this volume rate. More...
 
constexpr VolumeRate (const VolumeRate< NumericType > &other)=default
 Copy constructor. Constructs a volume rate by copying another one. More...
 
template<typename OtherNumericType >
constexpr VolumeRate (const VolumeRate< OtherNumericType > &other)
 Copy constructor. Constructs a volume rate by copying another one. More...
 
constexpr VolumeRate (VolumeRate< NumericType > &&other) noexcept=default
 Move constructor. Constructs a volume rate by moving another one. More...
 
constexpr VolumeRate< NumericType > & operator= (const VolumeRate< NumericType > &other)=default
 Copy assignment operator. Assigns this volume rate by copying another one. More...
 
template<typename OtherNumericType >
constexpr VolumeRate< NumericType > & operator= (const VolumeRate< OtherNumericType > &other)
 Copy assignment operator. Assigns this volume rate by copying another one. More...
 
constexpr VolumeRate< NumericType > & operator= (VolumeRate< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this volume rate by moving another one. More...
 
constexpr VolumeRate< NumericType > operator+ (const VolumeRate< NumericType > &volume_rate) const
 
constexpr VolumeRate< NumericType > operator- (const VolumeRate< NumericType > &volume_rate) const
 
constexpr VolumeRate< NumericType > operator* (const NumericType number) const
 
constexpr Volume< NumericType > operator* (const Time< NumericType > &time) const
 
constexpr MassRate< NumericType > operator* (const MassDensity< NumericType > &mass_density) const
 
constexpr VolumeRate< NumericType > operator/ (const NumericType number) const
 
constexpr Volume< NumericType > operator/ (const Frequency< NumericType > &frequency) const
 
constexpr Frequency< NumericType > operator/ (const Volume< NumericType > &volume) const
 
constexpr NumericType operator/ (const VolumeRate< NumericType > &volume_rate) const noexcept
 
constexpr void operator+= (const VolumeRate< NumericType > &volume_rate) noexcept
 
constexpr void operator-= (const VolumeRate< NumericType > &volume_rate) 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::VolumeRate 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::VolumeRate 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::VolumeRate 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::VolumeRate 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::VolumeRate 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 VolumeRate< NumericType > Zero ()
 Statically creates a volume rate of zero. More...
 
template<Unit::VolumeRate Unit>
static constexpr VolumeRate< NumericType > Create (const NumericType value)
 Statically creates a volume rate with a given value expressed in a given volume rate unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::VolumeRate 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 VolumeRate (const NumericType value)
 Constructor. Constructs a volume rate with a given value expressed in the standard volume rate unit. More...
 

Detailed Description

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

Volume rate. Can represent a time rate of change of a volume or a volume flow rate. See also PhQ::Volume, PhQ::Time, and PhQ::Frequency.

Definition at line 51 of file VolumeRate.hpp.

Constructor & Destructor Documentation

◆ VolumeRate() [1/9]

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

Default constructor. Constructs a volume rate with an uninitialized value.

◆ VolumeRate() [2/9]

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

Constructor. Constructs a volume rate with a given value expressed in a given volume rate unit.

Definition at line 58 of file VolumeRate.hpp.

◆ VolumeRate() [3/9]

template<typename NumericType = double>
constexpr PhQ::VolumeRate< NumericType >::VolumeRate ( const Volume< NumericType > &  volume,
const Time< NumericType > &  time 
)
inlineconstexpr

Constructor. Constructs a volume rate from a given volume and time using the definition of volume rate.

Definition at line 63 of file VolumeRate.hpp.

◆ VolumeRate() [4/9]

template<typename NumericType = double>
constexpr PhQ::VolumeRate< NumericType >::VolumeRate ( const Volume< NumericType > &  volume,
const Frequency< NumericType > &  frequency 
)
inlineconstexpr

Constructor. Constructs a volume rate from a given volume and frequency using the definition of volume rate.

Definition at line 68 of file VolumeRate.hpp.

◆ VolumeRate() [5/9]

template<typename NumericType = double>
constexpr PhQ::VolumeRate< NumericType >::VolumeRate ( const MassRate< NumericType > &  mass_rate,
const MassDensity< NumericType > &  mass_density 
)
constexpr

Constructor. Constructs a volume rate from a given mass rate and mass density using the definition of mass density.

◆ ~VolumeRate()

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

Destructor. Destroys this volume rate.

◆ VolumeRate() [6/9]

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

Copy constructor. Constructs a volume rate by copying another one.

◆ VolumeRate() [7/9]

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

Copy constructor. Constructs a volume rate by copying another one.

Definition at line 84 of file VolumeRate.hpp.

◆ VolumeRate() [8/9]

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

Move constructor. Constructs a volume rate by moving another one.

◆ VolumeRate() [9/9]

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

Constructor. Constructs a volume rate with a given value expressed in the standard volume rate unit.

Definition at line 169 of file VolumeRate.hpp.

Member Function Documentation

◆ Create()

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

Statically creates a volume rate with a given value expressed in a given volume rate unit.

Definition at line 111 of file VolumeRate.hpp.

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

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::VolumeRate , 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::VolumeRate , 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::VolumeRate , double >::JSON ( const Unit::VolumeRate  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::VolumeRate , 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*() [1/3]

template<typename NumericType = double>
constexpr MassRate<NumericType> PhQ::VolumeRate< NumericType >::operator* ( const MassDensity< NumericType > &  mass_density) const
constexpr

◆ operator*() [2/3]

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

◆ operator*() [3/3]

template<typename NumericType = double>
constexpr Volume<NumericType> PhQ::VolumeRate< NumericType >::operator* ( const Time< NumericType > &  time) const
inlineconstexpr

Definition at line 128 of file VolumeRate.hpp.

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/() [1/4]

template<typename NumericType = double>
constexpr Volume<NumericType> PhQ::VolumeRate< NumericType >::operator/ ( const Frequency< NumericType > &  frequency) const
inlineconstexpr

Definition at line 138 of file VolumeRate.hpp.

◆ operator/() [2/4]

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

◆ operator/() [3/4]

template<typename NumericType = double>
constexpr Frequency<NumericType> PhQ::VolumeRate< NumericType >::operator/ ( const Volume< NumericType > &  volume) const
inlineconstexpr

Definition at line 142 of file VolumeRate.hpp.

◆ operator/() [4/4]

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this volume rate by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this volume rate by copying another one.

Definition at line 95 of file VolumeRate.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this volume rate by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalScalar< Unit::VolumeRate , 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::VolumeRate , double >::Print ( const Unit::VolumeRate  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::VolumeRate , double >::SetValue ( const double  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::VolumeRate , 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::VolumeRate PhQ::DimensionalScalar< Unit::VolumeRate , 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::VolumeRate , 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::VolumeRate , double >::Value ( const Unit::VolumeRate  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::VolumeRate , 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::VolumeRate , double >::XML ( const Unit::VolumeRate  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::VolumeRate , 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::VolumeRate , double >::YAML ( const Unit::VolumeRate  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 VolumeRate<NumericType> PhQ::VolumeRate< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a volume rate of zero.

Definition at line 104 of file VolumeRate.hpp.

Member Data Documentation

◆ value

double PhQ::DimensionalScalar< Unit::VolumeRate , 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: