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 Member Functions | Protected Attributes | List of all members
PhQ::DimensionlessDyad< NumericType > Class Template Reference

Abstract base class that represents any dimensionless dyadic tensor physical quantity. Such a physical quantity is composed only of a value where the value is a three-dimensional dyadic tensor. The tensor may be non-symmetric. Such a physical quantity has no unit of measure and no dimension set. More...

#include "DimensionlessDyad.hpp"

Public Member Functions

constexpr const PhQ::Dyad< NumericType > & Value () const noexcept
 Value of this physical quantity. More...
 
constexpr PhQ::Dyad< NumericType > & MutableValue () noexcept
 Returns the value of this physical quantity as a mutable value. More...
 
constexpr void SetValue (const PhQ::Dyad< NumericType > &value) noexcept
 Sets the value of this physical quantity to the given value. More...
 
std::string Print () const
 Prints this physical quantity as a string. More...
 
std::string JSON () const
 Serializes this physical quantity as a JSON message. More...
 
std::string XML () const
 Serializes this physical quantity as an XML message. More...
 
std::string YAML () const
 Serializes this physical quantity as a YAML message. More...
 

Static Public Member Functions

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. More...
 

Protected Member Functions

 DimensionlessDyad ()=default
 Default constructor. Constructs a dimensionless dyadic tensor physical quantity with an uninitialized value. More...
 
constexpr DimensionlessDyad (const NumericType xx, const NumericType xy, const NumericType xz, const NumericType yx, const NumericType yy, const NumericType yz, const NumericType zx, const NumericType zy, const NumericType zz)
 Constructor. Constructs a dimensionless dyadic tensor physical quantity whose value has the given xx, xy, xz, yx, yy, yz, zx, zy, and zz Cartesian components. More...
 
constexpr DimensionlessDyad (const std::array< NumericType, 9 > &xx_xy_xz_yx_yy_yz_zx_zy_zz)
 Constructor. Constructs a dimensionless dyadic tensor physical quantity from a given array representing its value's xx, xy, xz, yx, yy, yz, zx, zy, and zz Cartesian components. More...
 
constexpr DimensionlessDyad (const PhQ::Dyad< NumericType > &value)
 Constructor. Constructs a dimensionless dyadic tensor physical quantity with a given value. More...
 
 ~DimensionlessDyad () noexcept=default
 Destructor. Destroys this dimensionless dyadic tensor physical quantity. More...
 
constexpr DimensionlessDyad (const DimensionlessDyad< NumericType > &other)=default
 Copy constructor. Constructs a dimensionless dyadic tensor physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionlessDyad (const DimensionlessDyad< OtherNumericType > &other)
 Copy constructor. Constructs a dimensionless dyadic tensor physical quantity by copying another one. More...
 
constexpr DimensionlessDyad (DimensionlessDyad< NumericType > &&other) noexcept=default
 Move constructor. Constructs a dimensionless dyadic tensor physical quantity by moving another one. More...
 
constexpr DimensionlessDyad< NumericType > & operator= (const DimensionlessDyad< NumericType > &other)=default
 Copy assignment operator. Assigns this dimensionless dyadic tensor physical quantity by copying another one. More...
 
template<typename OtherNumericType >
constexpr DimensionlessDyad< NumericType > & operator= (const DimensionlessDyad< OtherNumericType > &other)
 Copy assignment operator. Assigns this dimensionless dyadic tensor physical quantity by copying another one. More...
 
constexpr DimensionlessDyad< NumericType > & operator= (DimensionlessDyad< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this dimensionless dyadic tensor physical quantity by moving another one. More...
 

Protected Attributes

PhQ::Dyad< NumericType > value
 Value of this physical quantity. More...
 

Detailed Description

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

Abstract base class that represents any dimensionless dyadic tensor physical quantity. Such a physical quantity is composed only of a value where the value is a three-dimensional dyadic tensor. The tensor may be non-symmetric. Such a physical quantity has no unit of measure and no dimension set.

Template Parameters
NumericTypeFloating-point numeric type: float, double, or long double. Defaults to double if unspecified.

Definition at line 48 of file DimensionlessDyad.hpp.

Constructor & Destructor Documentation

◆ DimensionlessDyad() [1/7]

template<typename NumericType = double>
PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( )
protecteddefault

Default constructor. Constructs a dimensionless dyadic tensor physical quantity with an uninitialized value.

◆ DimensionlessDyad() [2/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( const NumericType  xx,
const NumericType  xy,
const NumericType  xz,
const NumericType  yx,
const NumericType  yy,
const NumericType  yz,
const NumericType  zx,
const NumericType  zy,
const NumericType  zz 
)
inlineconstexprprotected

Constructor. Constructs a dimensionless dyadic tensor physical quantity whose value has the given xx, xy, xz, yx, yy, yz, zx, zy, and zz Cartesian components.

Definition at line 102 of file DimensionlessDyad.hpp.

◆ DimensionlessDyad() [3/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( const std::array< NumericType, 9 > &  xx_xy_xz_yx_yy_yz_zx_zy_zz)
inlineexplicitconstexprprotected

Constructor. Constructs a dimensionless dyadic tensor physical quantity from a given array representing its value's xx, xy, xz, yx, yy, yz, zx, zy, and zz Cartesian components.

Definition at line 109 of file DimensionlessDyad.hpp.

◆ DimensionlessDyad() [4/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( const PhQ::Dyad< NumericType > &  value)
inlineexplicitconstexprprotected

Constructor. Constructs a dimensionless dyadic tensor physical quantity with a given value.

Definition at line 114 of file DimensionlessDyad.hpp.

◆ ~DimensionlessDyad()

template<typename NumericType = double>
PhQ::DimensionlessDyad< NumericType >::~DimensionlessDyad ( )
protecteddefaultnoexcept

Destructor. Destroys this dimensionless dyadic tensor physical quantity.

◆ DimensionlessDyad() [5/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( const DimensionlessDyad< NumericType > &  other)
constexprprotecteddefault

Copy constructor. Constructs a dimensionless dyadic tensor physical quantity by copying another one.

◆ DimensionlessDyad() [6/7]

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

Copy constructor. Constructs a dimensionless dyadic tensor physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 128 of file DimensionlessDyad.hpp.

◆ DimensionlessDyad() [7/7]

template<typename NumericType = double>
constexpr PhQ::DimensionlessDyad< NumericType >::DimensionlessDyad ( DimensionlessDyad< NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move constructor. Constructs a dimensionless dyadic tensor physical quantity by moving another one.

Member Function Documentation

◆ Dimensions()

template<typename NumericType = double>
static constexpr PhQ::Dimensions PhQ::DimensionlessDyad< NumericType >::Dimensions ( )
inlinestaticconstexpr

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 56 of file DimensionlessDyad.hpp.

References PhQ::Dimensionless.

◆ JSON()

template<typename NumericType = double>
std::string PhQ::DimensionlessDyad< NumericType >::JSON ( ) const
inline

Serializes this physical quantity as a JSON message.

Definition at line 81 of file DimensionlessDyad.hpp.

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

◆ MutableValue()

template<typename NumericType = double>
constexpr PhQ::Dyad<NumericType>& PhQ::DimensionlessDyad< NumericType >::MutableValue ( )
inlineconstexprnoexcept

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

Definition at line 66 of file DimensionlessDyad.hpp.

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this dimensionless dyadic tensor physical quantity by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this dimensionless dyadic tensor physical quantity by copying another one.

Template Parameters
OtherNumericTypeFloating-point numeric type of the other physical quantity. Deduced automatically.

Definition at line 145 of file DimensionlessDyad.hpp.

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

◆ operator=() [3/3]

template<typename NumericType = double>
constexpr DimensionlessDyad<NumericType>& PhQ::DimensionlessDyad< NumericType >::operator= ( DimensionlessDyad< NumericType > &&  other)
constexprprotecteddefaultnoexcept

Move assignment operator. Assigns this dimensionless dyadic tensor physical quantity by moving another one.

◆ Print()

template<typename NumericType = double>
std::string PhQ::DimensionlessDyad< NumericType >::Print ( ) const
inline

Prints this physical quantity as a string.

Definition at line 76 of file DimensionlessDyad.hpp.

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

Referenced by PhQ::operator<<().

◆ SetValue()

template<typename NumericType = double>
constexpr void PhQ::DimensionlessDyad< NumericType >::SetValue ( const PhQ::Dyad< NumericType > &  value)
inlineconstexprnoexcept

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

Definition at line 71 of file DimensionlessDyad.hpp.

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

◆ Value()

template<typename NumericType = double>
constexpr const PhQ::Dyad<NumericType>& PhQ::DimensionlessDyad< NumericType >::Value ( ) const
inlineconstexprnoexcept

◆ XML()

template<typename NumericType = double>
std::string PhQ::DimensionlessDyad< NumericType >::XML ( ) const
inline

Serializes this physical quantity as an XML message.

Definition at line 86 of file DimensionlessDyad.hpp.

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

◆ YAML()

template<typename NumericType = double>
std::string PhQ::DimensionlessDyad< NumericType >::YAML ( ) const
inline

Serializes this physical quantity as a YAML message.

Definition at line 91 of file DimensionlessDyad.hpp.

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

Member Data Documentation

◆ value

template<typename NumericType = double>
PhQ::Dyad<NumericType> PhQ::DimensionlessDyad< NumericType >::value
protected

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