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

Scalar traction component or magnitude of a traction vector. Traction is similar to pressure; however, traction can act in any direction, whereas pressure always acts compressively perpendicular to a surface. For a three-dimensional Euclidean traction vector, see PhQ::Traction. For a two-dimensional Euclidean traction vector in the XY plane, see PhQ::PlanarTraction. More...

#include "ScalarTraction.hpp"

Public Member Functions

 ScalarTraction ()=default
 Default constructor. Constructs a scalar traction with an uninitialized value. More...
 
 ScalarTraction (const NumericType value, const Unit::Pressure unit)
 Constructor. Constructs a scalar traction with a given value expressed in a given pressure unit. More...
 
constexpr ScalarTraction (const ScalarForce< NumericType > &scalar_force, const Area< NumericType > &area)
 Constructor. Constructs a scalar traction from a given scalar force magnitude and area using the definition of traction. More...
 
 ~ScalarTraction () noexcept=default
 Destructor. Destroys this scalar traction. More...
 
constexpr ScalarTraction (const ScalarTraction< NumericType > &other)=default
 Copy constructor. Constructs a scalar traction by copying another one. More...
 
template<typename OtherNumericType >
constexpr ScalarTraction (const ScalarTraction< OtherNumericType > &other)
 Copy constructor. Constructs a scalar traction by copying another one. More...
 
constexpr ScalarTraction (ScalarTraction< NumericType > &&other) noexcept=default
 Move constructor. Constructs a scalar traction by moving another one. More...
 
constexpr ScalarTraction< NumericType > & operator= (const ScalarTraction< NumericType > &other)=default
 Copy assignment operator. Assigns this scalar traction by copying another one. More...
 
template<typename OtherNumericType >
constexpr ScalarTraction< NumericType > & operator= (const ScalarTraction< OtherNumericType > &other)
 Copy assignment operator. Assigns this scalar traction by copying another one. More...
 
constexpr ScalarTraction< NumericType > & operator= (ScalarTraction< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this scalar traction by moving another one. More...
 
constexpr ScalarTraction< NumericType > operator+ (const ScalarTraction< NumericType > &other) const
 
constexpr ScalarTraction< NumericType > operator- (const ScalarTraction< NumericType > &other) const
 
constexpr ScalarTraction< NumericType > operator* (const NumericType number) const
 
constexpr ScalarForce< NumericType > operator* (const Area< NumericType > &area) const
 
constexpr PlanarTraction< NumericType > operator* (const PlanarDirection< NumericType > &planar_direction) const
 
constexpr Traction< NumericType > operator* (const Direction< NumericType > &direction) const
 
constexpr ScalarTraction< NumericType > operator/ (const NumericType number) const
 
constexpr NumericType operator/ (const ScalarTraction< NumericType > &other) const noexcept
 
constexpr void operator+= (const ScalarTraction< NumericType > &other) noexcept
 
constexpr void operator-= (const ScalarTraction< NumericType > &other) 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 ScalarTraction< NumericType > Zero ()
 Statically creates a scalar traction of zero. More...
 
template<Unit::Pressure Unit>
static constexpr ScalarTraction< NumericType > Create (const NumericType value)
 Statically creates a scalar traction 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 ScalarTraction (const NumericType value)
 Constructor. Constructs a scalar traction with a given value expressed in the standard pressure unit. More...
 

Friends

template<typename OtherNumericType >
class PlanarTraction
 
template<typename OtherNumericType >
class Traction
 

Detailed Description

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

Scalar traction component or magnitude of a traction vector. Traction is similar to pressure; however, traction can act in any direction, whereas pressure always acts compressively perpendicular to a surface. For a three-dimensional Euclidean traction vector, see PhQ::Traction. For a two-dimensional Euclidean traction vector in the XY plane, see PhQ::PlanarTraction.

Definition at line 61 of file ScalarTraction.hpp.

Constructor & Destructor Documentation

◆ ScalarTraction() [1/7]

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

Default constructor. Constructs a scalar traction with an uninitialized value.

◆ ScalarTraction() [2/7]

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

Constructor. Constructs a scalar traction with a given value expressed in a given pressure unit.

Definition at line 68 of file ScalarTraction.hpp.

◆ ScalarTraction() [3/7]

template<typename NumericType = double>
constexpr PhQ::ScalarTraction< NumericType >::ScalarTraction ( const ScalarForce< NumericType > &  scalar_force,
const Area< NumericType > &  area 
)
inlineconstexpr

Constructor. Constructs a scalar traction from a given scalar force magnitude and area using the definition of traction.

Definition at line 73 of file ScalarTraction.hpp.

◆ ~ScalarTraction()

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

Destructor. Destroys this scalar traction.

◆ ScalarTraction() [4/7]

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

Copy constructor. Constructs a scalar traction by copying another one.

◆ ScalarTraction() [5/7]

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

Copy constructor. Constructs a scalar traction by copying another one.

Definition at line 85 of file ScalarTraction.hpp.

◆ ScalarTraction() [6/7]

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

Move constructor. Constructs a scalar traction by moving another one.

◆ ScalarTraction() [7/7]

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

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

Definition at line 167 of file ScalarTraction.hpp.

Member Function Documentation

◆ Create()

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

Statically creates a scalar traction with a given value expressed in a given pressure unit.

Definition at line 114 of file ScalarTraction.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 Unit::Pressure  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*() [1/4]

template<typename NumericType = double>
constexpr ScalarForce<NumericType> PhQ::ScalarTraction< NumericType >::operator* ( const Area< NumericType > &  area) const
inlineconstexpr

Definition at line 131 of file ScalarTraction.hpp.

◆ operator*() [2/4]

template<typename NumericType >
constexpr Traction< NumericType > PhQ::ScalarTraction< NumericType >::operator* ( const Direction< NumericType > &  direction) const
inlineconstexpr

Definition at line 289 of file Traction.hpp.

◆ operator*() [3/4]

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

◆ operator*() [4/4]

template<typename NumericType >
constexpr PlanarTraction< NumericType > PhQ::ScalarTraction< NumericType >::operator* ( const PlanarDirection< NumericType > &  planar_direction) const
inlineconstexpr

Definition at line 294 of file PlanarTraction.hpp.

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/() [1/2]

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

◆ operator/() [2/2]

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

◆ operator/=()

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

◆ operator=() [1/3]

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

Copy assignment operator. Assigns this scalar traction by copying another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this scalar traction by copying another one.

Definition at line 97 of file ScalarTraction.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this scalar traction 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 Unit::Pressure  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 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::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 Unit::Pressure  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 Unit::Pressure  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 Unit::Pressure  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 ScalarTraction<NumericType> PhQ::ScalarTraction< NumericType >::Zero ( )
inlinestaticconstexpr

Statically creates a scalar traction of zero.

Definition at line 107 of file ScalarTraction.hpp.

Friends And Related Function Documentation

◆ PlanarTraction

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

Definition at line 171 of file ScalarTraction.hpp.

◆ Traction

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

Definition at line 174 of file ScalarTraction.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: