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

Mach number of a fluid flow. Measures the local compressibility of a fluid flow. Represents the ratio of a fluid's local speed to its local speed of sound. See also PhQ::Speed and PhQ::SoundSpeed. More...

#include "MachNumber.hpp"

Public Member Functions

 MachNumber ()=default
 Default constructor. Constructs a Mach number with an uninitialized value.
 
constexpr MachNumber (const NumericType value)
 Constructor. Constructs a Mach number with a given value.
 
constexpr MachNumber (const Speed< NumericType > &speed, const SoundSpeed< NumericType > &sound_speed)
 Constructor. Constructs a Mach number from a given speed and sound speed using the definition of the Mach number.
 
 ~MachNumber () noexcept=default
 Destructor. Destroys this Mach number.
 
constexpr MachNumber (const MachNumber< NumericType > &other)=default
 Copy constructor. Constructs a Mach number by copying another one.
 
template<typename OtherNumericType >
constexpr MachNumber (const MachNumber< OtherNumericType > &other)
 Copy constructor. Constructs a Mach number by copying another one.
 
constexpr MachNumber (MachNumber< NumericType > &&other) noexcept=default
 Move constructor. Constructs a Mach number by moving another one.
 
constexpr MachNumber< NumericType > & operator= (const MachNumber< NumericType > &other)=default
 Copy assignment operator. Assigns this Mach number by copying another one.
 
template<typename OtherNumericType >
constexpr MachNumber< NumericType > & operator= (const MachNumber< OtherNumericType > &other)
 Copy assignment operator. Assigns this Mach number by copying another one.
 
constexpr MachNumber< NumericType > & operator= (MachNumber< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this Mach number by moving another one.
 
constexpr MachNumber< NumericType > operator+ (const MachNumber< NumericType > &mach_number) const
 
constexpr MachNumber< NumericType > operator- (const MachNumber< NumericType > &mach_number) const
 
constexpr MachNumber< NumericType > operator* (const NumericType number) const
 
constexpr Speed< NumericType > operator* (const SoundSpeed< NumericType > &sound_speed) const
 
constexpr MachNumber< NumericType > operator/ (const NumericType number) const
 
constexpr NumericType operator/ (const MachNumber< NumericType > &mach_number) const noexcept
 
constexpr void operator+= (const MachNumber< NumericType > &mach_number) noexcept
 
constexpr void operator-= (const MachNumber< NumericType > &mach_number) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr NumericType Value () const noexcept
 Value of this physical quantity.
 
constexpr NumericType & MutableValue () noexcept
 Returns the value of this physical quantity as a mutable value.
 
constexpr void SetValue (const NumericType value) noexcept
 Sets the value of this physical quantity to the given value.
 
std::string Print () const
 Prints this physical quantity as a string.
 
std::string JSON () const
 Serializes this physical quantity as a JSON message.
 
std::string XML () const
 Serializes this physical quantity as an XML message.
 
std::string YAML () const
 Serializes this physical quantity as a YAML message.
 

Static Public Member Functions

static constexpr MachNumber< NumericType > Zero ()
 Statically creates a Mach number of zero.
 
static constexpr PhQ::Dimensions Dimensions ()
 Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set.
 

Protected Attributes

NumericType value
 Value of this physical quantity.
 

Detailed Description

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

Mach number of a fluid flow. Measures the local compressibility of a fluid flow. Represents the ratio of a fluid's local speed to its local speed of sound. See also PhQ::Speed and PhQ::SoundSpeed.

Definition at line 42 of file MachNumber.hpp.

Constructor & Destructor Documentation

◆ MachNumber() [1/6]

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

Default constructor. Constructs a Mach number with an uninitialized value.

◆ MachNumber() [2/6]

template<typename NumericType = double>
constexpr PhQ::MachNumber< NumericType >::MachNumber ( const NumericType  value)
inlineexplicitconstexpr

Constructor. Constructs a Mach number with a given value.

Definition at line 48 of file MachNumber.hpp.

◆ MachNumber() [3/6]

template<typename NumericType = double>
constexpr PhQ::MachNumber< NumericType >::MachNumber ( const Speed< NumericType > &  speed,
const SoundSpeed< NumericType > &  sound_speed 
)
inlineconstexpr

Constructor. Constructs a Mach number from a given speed and sound speed using the definition of the Mach number.

Definition at line 53 of file MachNumber.hpp.

◆ ~MachNumber()

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

Destructor. Destroys this Mach number.

◆ MachNumber() [4/6]

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

Copy constructor. Constructs a Mach number by copying another one.

◆ MachNumber() [5/6]

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

Copy constructor. Constructs a Mach number by copying another one.

Definition at line 64 of file MachNumber.hpp.

◆ MachNumber() [6/6]

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

Move constructor. Constructs a Mach number by moving another one.

Member Function Documentation

◆ Dimensions()

template<typename NumericType = double>
static constexpr PhQ::Dimensions PhQ::DimensionlessScalar< NumericType >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity. Since this physical quantity is dimensionless, its physical dimension set is simply the null set.

Definition at line 55 of file DimensionlessScalar.hpp.

References PhQ::Dimensionless.

◆ JSON()

template<typename NumericType = double>
std::string PhQ::DimensionlessScalar< NumericType >::JSON ( ) const
inlineinherited

Serializes this physical quantity as a JSON message.

Definition at line 80 of file DimensionlessScalar.hpp.

References PhQ::Print(), and PhQ::DimensionlessScalar< NumericType >::value.

◆ MutableValue()

template<typename NumericType = double>
constexpr NumericType & PhQ::DimensionlessScalar< NumericType >::MutableValue ( )
inlineconstexprnoexceptinherited

Returns the value of this physical quantity as a mutable value.

Definition at line 65 of file DimensionlessScalar.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator*() [1/2]

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

Definition at line 96 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator*() [2/2]

template<typename NumericType = double>
constexpr Speed< NumericType > PhQ::MachNumber< NumericType >::operator* ( const SoundSpeed< NumericType > &  sound_speed) const
inlineconstexpr

Definition at line 100 of file MachNumber.hpp.

◆ operator*=()

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

Definition at line 120 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator+()

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

Definition at line 88 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator+=()

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

Definition at line 112 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator-()

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

Definition at line 92 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator-=()

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

Definition at line 116 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator/() [1/2]

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

Definition at line 108 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator/() [2/2]

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

Definition at line 104 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator/=()

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

Definition at line 124 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this Mach number by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this Mach number by copying another one.

Definition at line 75 of file MachNumber.hpp.

References PhQ::DimensionlessScalar< NumericType >::Value(), and PhQ::DimensionlessScalar< NumericType >::value.

◆ operator=() [3/3]

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

Move assignment operator. Assigns this Mach number by moving another one.

◆ Print()

template<typename NumericType = double>
std::string PhQ::DimensionlessScalar< NumericType >::Print ( ) const
inlineinherited

◆ SetValue()

template<typename NumericType = double>
constexpr void PhQ::DimensionlessScalar< NumericType >::SetValue ( const NumericType  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity to the given value.

Definition at line 70 of file DimensionlessScalar.hpp.

References PhQ::DimensionlessScalar< NumericType >::value.

◆ Value()

template<typename NumericType = double>
constexpr NumericType PhQ::DimensionlessScalar< NumericType >::Value ( ) const
inlineconstexprnoexceptinherited

◆ XML()

template<typename NumericType = double>
std::string PhQ::DimensionlessScalar< NumericType >::XML ( ) const
inlineinherited

Serializes this physical quantity as an XML message.

Definition at line 85 of file DimensionlessScalar.hpp.

References PhQ::Print(), and PhQ::DimensionlessScalar< NumericType >::value.

◆ YAML()

template<typename NumericType = double>
std::string PhQ::DimensionlessScalar< NumericType >::YAML ( ) const
inlineinherited

Serializes this physical quantity as a YAML message.

Definition at line 90 of file DimensionlessScalar.hpp.

References PhQ::Print(), and PhQ::DimensionlessScalar< NumericType >::value.

◆ Zero()

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

Statically creates a Mach number of zero.

Definition at line 84 of file MachNumber.hpp.

Member Data Documentation

◆ value

template<typename NumericType = double>
NumericType PhQ::DimensionlessScalar< NumericType >::value
protectedinherited

Value of this physical quantity.

Definition at line 143 of file DimensionlessScalar.hpp.

Referenced by PhQ::DimensionlessScalar< NumericType >::JSON(), PhQ::DimensionlessScalar< NumericType >::MutableValue(), PhQ::HeatCapacityRatio< NumericType >::operator*(), PhQ::MachNumber< NumericType >::operator*(), PhQ::PoissonRatio< NumericType >::operator*(), PhQ::PrandtlNumber< NumericType >::operator*(), PhQ::ReynoldsNumber< NumericType >::operator*(), PhQ::ScalarDisplacementGradient< NumericType >::operator*(), PhQ::ScalarStrain< NumericType >::operator*(), PhQ::HeatCapacityRatio< NumericType >::operator*=(), PhQ::MachNumber< NumericType >::operator*=(), PhQ::PoissonRatio< NumericType >::operator*=(), PhQ::PrandtlNumber< NumericType >::operator*=(), PhQ::ReynoldsNumber< NumericType >::operator*=(), PhQ::ScalarDisplacementGradient< NumericType >::operator*=(), PhQ::ScalarStrain< NumericType >::operator*=(), PhQ::HeatCapacityRatio< NumericType >::operator+(), PhQ::MachNumber< NumericType >::operator+(), PhQ::PoissonRatio< NumericType >::operator+(), PhQ::PrandtlNumber< NumericType >::operator+(), PhQ::ReynoldsNumber< NumericType >::operator+(), PhQ::ScalarDisplacementGradient< NumericType >::operator+(), PhQ::ScalarStrain< NumericType >::operator+(), PhQ::HeatCapacityRatio< NumericType >::operator+=(), PhQ::MachNumber< NumericType >::operator+=(), PhQ::PoissonRatio< NumericType >::operator+=(), PhQ::PrandtlNumber< NumericType >::operator+=(), PhQ::ReynoldsNumber< NumericType >::operator+=(), PhQ::ScalarDisplacementGradient< NumericType >::operator+=(), PhQ::ScalarStrain< NumericType >::operator+=(), PhQ::HeatCapacityRatio< NumericType >::operator-(), PhQ::MachNumber< NumericType >::operator-(), PhQ::PoissonRatio< NumericType >::operator-(), PhQ::PrandtlNumber< NumericType >::operator-(), PhQ::ReynoldsNumber< NumericType >::operator-(), PhQ::ScalarDisplacementGradient< NumericType >::operator-(), PhQ::ScalarStrain< NumericType >::operator-(), PhQ::HeatCapacityRatio< NumericType >::operator-=(), PhQ::MachNumber< NumericType >::operator-=(), PhQ::PoissonRatio< NumericType >::operator-=(), PhQ::PrandtlNumber< NumericType >::operator-=(), PhQ::ReynoldsNumber< NumericType >::operator-=(), PhQ::ScalarDisplacementGradient< NumericType >::operator-=(), PhQ::ScalarStrain< NumericType >::operator-=(), PhQ::HeatCapacityRatio< NumericType >::operator/(), PhQ::MachNumber< NumericType >::operator/(), PhQ::HeatCapacityRatio< NumericType >::operator/(), PhQ::MachNumber< NumericType >::operator/(), PhQ::PoissonRatio< NumericType >::operator/(), PhQ::PrandtlNumber< NumericType >::operator/(), PhQ::ReynoldsNumber< NumericType >::operator/(), PhQ::ScalarDisplacementGradient< NumericType >::operator/(), PhQ::ScalarStrain< NumericType >::operator/(), PhQ::PoissonRatio< NumericType >::operator/(), PhQ::PrandtlNumber< NumericType >::operator/(), PhQ::ReynoldsNumber< NumericType >::operator/(), PhQ::ScalarDisplacementGradient< NumericType >::operator/(), PhQ::ScalarStrain< NumericType >::operator/(), PhQ::HeatCapacityRatio< NumericType >::operator/=(), PhQ::MachNumber< NumericType >::operator/=(), PhQ::PoissonRatio< NumericType >::operator/=(), PhQ::PrandtlNumber< NumericType >::operator/=(), PhQ::ReynoldsNumber< NumericType >::operator/=(), PhQ::ScalarDisplacementGradient< NumericType >::operator/=(), PhQ::ScalarStrain< NumericType >::operator/=(), PhQ::DimensionlessScalar< NumericType >::operator=(), PhQ::HeatCapacityRatio< NumericType >::operator=(), PhQ::MachNumber< NumericType >::operator=(), PhQ::PoissonRatio< NumericType >::operator=(), PhQ::PrandtlNumber< NumericType >::operator=(), PhQ::ReynoldsNumber< NumericType >::operator=(), PhQ::ScalarDisplacementGradient< NumericType >::operator=(), PhQ::ScalarStrain< NumericType >::operator=(), PhQ::DimensionlessScalar< NumericType >::Print(), PhQ::DimensionlessScalar< NumericType >::SetValue(), PhQ::DimensionlessScalar< NumericType >::Value(), PhQ::DimensionlessScalar< NumericType >::XML(), and PhQ::DimensionlessScalar< NumericType >::YAML().


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