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 | Friends | List of all members
PhQ::TemperatureDifference< NumericType > Class Template Reference

Temperature difference. Not to be confused with temperature; see PhQ::Temperature. For example, a temperature difference of 20 kelvin is very different from a temperature of 20 kelvin. More...

#include "TemperatureDifference.hpp"

Public Member Functions

 TemperatureDifference ()=default
 Default constructor. Constructs a temperature difference with an uninitialized value. More...
 
 TemperatureDifference (const NumericType value, const Unit::TemperatureDifference unit)
 Constructor. Constructs a temperature difference with a given value expressed in a given temperature unit. More...
 
constexpr TemperatureDifference (const ScalarTemperatureGradient< NumericType > &scalar_temperature_gradient, const Length< NumericType > &length)
 Constructor. Constructs a temperature difference from a given scalar temperature gradient and length using the definition of temperature gradient. More...
 
 ~TemperatureDifference () noexcept=default
 Destructor. Destroys this temperature difference. More...
 
constexpr TemperatureDifference (const TemperatureDifference< NumericType > &other)=default
 Copy constructor. Constructs a temperature difference by copying another one. More...
 
template<typename OtherNumericType >
constexpr TemperatureDifference (const TemperatureDifference< OtherNumericType > &other)
 Copy constructor. Constructs a temperature difference by copying another one. More...
 
constexpr TemperatureDifference (TemperatureDifference< NumericType > &&other) noexcept=default
 Move constructor. Constructs a temperature difference by moving another one. More...
 
constexpr TemperatureDifference< NumericType > & operator= (const TemperatureDifference< NumericType > &other)=default
 Copy assignment operator. Assigns this temperature difference by copying another one. More...
 
template<typename OtherNumericType >
constexpr TemperatureDifference< NumericType > & operator= (const TemperatureDifference< OtherNumericType > &other)
 Copy assignment operator. Assigns this temperature difference by copying another one. More...
 
constexpr TemperatureDifference< NumericType > & operator= (TemperatureDifference< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this temperature difference by moving another one. More...
 
constexpr Temperature< NumericType > operator+ (const Temperature< NumericType > &temperature) const
 
constexpr TemperatureDifference< NumericType > operator+ (const TemperatureDifference< NumericType > &temperature_difference) const
 
constexpr Temperature< NumericType > operator- (const Temperature< NumericType > &temperature) const
 
constexpr TemperatureDifference< NumericType > operator- (const TemperatureDifference< NumericType > &temperature_difference) const
 
constexpr TemperatureDifference< NumericType > operator* (const NumericType number) const
 
constexpr ScalarStrain< NumericType > operator* (const LinearThermalExpansionCoefficient< NumericType > &linear_thermal_expansion_coefficient) const
 
constexpr Strain< NumericType > operator* (const VolumetricThermalExpansionCoefficient< NumericType > &volumetric_thermal_expansion_coefficient) const
 
constexpr TemperatureDifference< NumericType > operator/ (const NumericType number) const
 
constexpr ScalarTemperatureGradient< NumericType > operator/ (const Length< NumericType > &length) const
 
constexpr NumericType operator/ (const TemperatureDifference< NumericType > &temperature_difference) const noexcept
 
constexpr void operator+= (const TemperatureDifference< NumericType > &temperature_difference) noexcept
 
constexpr void operator-= (const TemperatureDifference< NumericType > &temperature_difference) 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::TemperatureDifference 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::TemperatureDifference 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::TemperatureDifference 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::TemperatureDifference 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::TemperatureDifference 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 TemperatureDifference< NumericType > Zero ()
 Statically creates a temperature difference of absolute zero. More...
 
template<Unit::TemperatureDifference Unit>
static constexpr TemperatureDifference< NumericType > Create (const NumericType value)
 Statically creates a temperature difference with a given value expressed in a given temperature unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::TemperatureDifference 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 TemperatureDifference (const NumericType value)
 Constructor. Constructs a temperature difference with a given value expressed in the standard temperature difference unit. More...
 

Friends

template<typename OtherNumericType >
class Temperature
 Temperature units. Not to be confused with temperature difference units. For example, a temperature of 20 °C corresponds to a temperature of 68 °F, whereas a temperature difference of +20 °C corresponds to a temperature difference of +36 °F. More...
 

Detailed Description

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

Temperature difference. Not to be confused with temperature; see PhQ::Temperature. For example, a temperature difference of 20 kelvin is very different from a temperature of 20 kelvin.

Definition at line 69 of file TemperatureDifference.hpp.

Constructor & Destructor Documentation

◆ TemperatureDifference() [1/7]

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

Default constructor. Constructs a temperature difference with an uninitialized value.

◆ TemperatureDifference() [2/7]

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

Constructor. Constructs a temperature difference with a given value expressed in a given temperature unit.

Definition at line 76 of file TemperatureDifference.hpp.

◆ TemperatureDifference() [3/7]

template<typename NumericType = double>
constexpr PhQ::TemperatureDifference< NumericType >::TemperatureDifference ( const ScalarTemperatureGradient< NumericType > &  scalar_temperature_gradient,
const Length< NumericType > &  length 
)
constexpr

Constructor. Constructs a temperature difference from a given scalar temperature gradient and length using the definition of temperature gradient.

◆ ~TemperatureDifference()

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

Destructor. Destroys this temperature difference.

◆ TemperatureDifference() [4/7]

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

Copy constructor. Constructs a temperature difference by copying another one.

◆ TemperatureDifference() [5/7]

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

Copy constructor. Constructs a temperature difference by copying another one.

Definition at line 93 of file TemperatureDifference.hpp.

◆ TemperatureDifference() [6/7]

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

Move constructor. Constructs a temperature difference by moving another one.

◆ TemperatureDifference() [7/7]

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

Constructor. Constructs a temperature difference with a given value expressed in the standard temperature difference unit.

Definition at line 188 of file TemperatureDifference.hpp.

Member Function Documentation

◆ Create()

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

Statically creates a temperature difference with a given value expressed in a given temperature unit.

Definition at line 123 of file TemperatureDifference.hpp.

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

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::TemperatureDifference , 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::TemperatureDifference , 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::TemperatureDifference , double >::JSON ( const Unit::TemperatureDifference  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::TemperatureDifference , 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 ScalarStrain<NumericType> PhQ::TemperatureDifference< NumericType >::operator* ( const LinearThermalExpansionCoefficient< NumericType > &  linear_thermal_expansion_coefficient) const
constexpr

◆ operator*() [2/3]

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

◆ operator*() [3/3]

template<typename NumericType = double>
constexpr Strain<NumericType> PhQ::TemperatureDifference< NumericType >::operator* ( const VolumetricThermalExpansionCoefficient< NumericType > &  volumetric_thermal_expansion_coefficient) const
constexpr

◆ operator*=()

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

◆ operator+() [1/2]

template<typename NumericType = double>
constexpr Temperature<NumericType> PhQ::TemperatureDifference< NumericType >::operator+ ( const Temperature< NumericType > &  temperature) const
constexpr

◆ operator+() [2/2]

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

◆ operator+=()

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

◆ operator-() [1/2]

template<typename NumericType = double>
constexpr Temperature<NumericType> PhQ::TemperatureDifference< NumericType >::operator- ( const Temperature< NumericType > &  temperature) const
constexpr

◆ operator-() [2/2]

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

◆ operator-=()

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

◆ operator/() [1/3]

template<typename NumericType = double>
constexpr ScalarTemperatureGradient<NumericType> PhQ::TemperatureDifference< NumericType >::operator/ ( const Length< NumericType > &  length) const
constexpr

◆ operator/() [2/3]

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

◆ operator/() [3/3]

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this temperature difference by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this temperature difference by copying another one.

Definition at line 105 of file TemperatureDifference.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this temperature difference by moving another one.

◆ Print() [1/2]

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

Statically creates a temperature difference of absolute zero.

Definition at line 116 of file TemperatureDifference.hpp.

Friends And Related Function Documentation

◆ Temperature

template<typename NumericType = double>
template<typename OtherNumericType >
friend class Temperature
friend

Temperature units. Not to be confused with temperature difference units. For example, a temperature of 20 °C corresponds to a temperature of 68 °F, whereas a temperature difference of +20 °C corresponds to a temperature difference of +36 °F.

Definition at line 192 of file TemperatureDifference.hpp.

Member Data Documentation

◆ value

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