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

Three-dimensional Euclidean traction vector. Contains three components in Cartesian coordinates: x, y, and z. Traction is similar to pressure; however, traction can act in any direction, whereas pressure always acts compressively perpendicular to a surface. For a two-dimensional Euclidean traction vector in the XY plane, see PhQ::PlanarTraction. For scalar traction components or for the magnitude of a traction vector, see PhQ::ScalarTraction. More...

#include "Traction.hpp"

Public Member Functions

 Traction ()=default
 Default constructor. Constructs a traction vector with an uninitialized value. More...
 
 Traction (const Vector< NumericType > &value, const Unit::Pressure unit)
 Constructor. Constructs a traction vector with a given value expressed in a given pressure unit. More...
 
 Traction (const ScalarTraction< NumericType > &x, const ScalarTraction< NumericType > &y, const ScalarTraction< NumericType > &z)
 Constructor. Constructs a traction vector from a given set of scalar traction components. More...
 
constexpr Traction (const ScalarTraction< NumericType > &scalar_traction, const Direction< NumericType > &direction)
 Constructor. Constructs a traction vector from a given scalar traction and direction. More...
 
constexpr Traction (const PlanarTraction< NumericType > &planar_traction)
 Constructor. Constructs a traction vector from a given planar traction vector in the XY plane. This traction vector's z-component is initialized to zero. More...
 
constexpr Traction (const Force< NumericType > &force, const Area< NumericType > &area)
 Constructor. Constructs a traction vector from a given force and area using the definition of traction. More...
 
constexpr Traction (const Stress< NumericType > &stress, const Direction< NumericType > &direction)
 Constructor. Constructs a traction vector from a given stress and direction using the definition of traction. More...
 
 ~Traction () noexcept=default
 Destructor. Destroys this traction vector. More...
 
constexpr Traction (const Traction< NumericType > &other)=default
 Copy constructor. Constructs a traction vector by copying another one. More...
 
template<typename OtherNumericType >
constexpr Traction (const Traction< OtherNumericType > &other)
 Copy constructor. Constructs a traction vector by copying another one. More...
 
constexpr Traction (Traction< NumericType > &&other) noexcept=default
 Move constructor. Constructs a traction vector by moving another one. More...
 
constexpr Traction< NumericType > & operator= (const Traction< NumericType > &other)=default
 Copy assignment operator. Assigns this traction vector by copying another one. More...
 
template<typename OtherNumericType >
constexpr Traction< NumericType > & operator= (const Traction< OtherNumericType > &other)
 Copy assignment operator. Assigns this traction vector by copying another one. More...
 
constexpr Traction< NumericType > & operator= (Traction< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this traction vector by moving another one. More...
 
constexpr ScalarTraction< NumericType > x () const noexcept
 Returns the x Cartesian component of this traction vector. More...
 
constexpr ScalarTraction< NumericType > y () const noexcept
 Returns the y Cartesian component of this traction vector. More...
 
constexpr ScalarTraction< NumericType > z () const noexcept
 Returns the z Cartesian component of this traction vector. More...
 
ScalarTraction< NumericType > Magnitude () const
 Returns the magnitude of this traction vector. More...
 
PhQ::Direction< NumericType > Direction () const
 Returns the direction of this traction vector. More...
 
PhQ::Angle< NumericType > Angle (const Traction< NumericType > &traction) const
 Returns the angle between this traction vector and another one. More...
 
constexpr Traction< NumericType > operator+ (const Traction< NumericType > &traction) const
 
constexpr Traction< NumericType > operator- (const Traction< NumericType > &traction) const
 
constexpr Traction< NumericType > operator* (const NumericType number) const
 
constexpr Force< NumericType > operator* (const Area< NumericType > &area) const
 
constexpr Traction< NumericType > operator/ (const NumericType number) const
 
constexpr void operator+= (const Traction< NumericType > &traction) noexcept
 
constexpr void operator-= (const Traction< NumericType > &traction) noexcept
 
constexpr void operator*= (const NumericType number) noexcept
 
constexpr void operator/= (const NumericType number) noexcept
 
constexpr const PhQ::Vector< double > & Value () const noexcept
 Value of this physical quantity expressed in its standard unit of measure. More...
 
PhQ::Vector< double > Value (const Unit::Pressure unit) const
 Value of this physical quantity expressed in a given unit of measure. More...
 
constexpr PhQ::Vector< 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 PhQ::Vector< 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 PhQ::Vector< 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 Traction< NumericType > Zero ()
 Statically creates a traction vector of zero. More...
 
template<Unit::Pressure Unit>
static constexpr Traction< NumericType > Create (const NumericType x, const NumericType y, const NumericType z)
 Statically creates a traction vector from the given x, y, and z Cartesian components expressed in a given pressure unit. More...
 
template<Unit::Pressure Unit>
static constexpr Traction< NumericType > Create (const std::array< NumericType, 3 > &x_y_z)
 Statically creates a traction vector from the given x, y, and z Cartesian components expressed in a given pressure unit. More...
 
template<Unit::Pressure Unit>
static constexpr Traction< NumericType > Create (const Vector< NumericType > &value)
 Statically creates a traction vector 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

PhQ::Vector< double > value
 Value of this physical quantity expressed in its standard unit of measure. More...
 

Private Member Functions

constexpr Traction (const Vector< NumericType > &value)
 Constructor. Constructs a traction vector with a given value expressed in the standard pressure unit. More...
 

Detailed Description

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

Three-dimensional Euclidean traction vector. Contains three components in Cartesian coordinates: x, y, and z. Traction is similar to pressure; however, traction can act in any direction, whereas pressure always acts compressively perpendicular to a surface. For a two-dimensional Euclidean traction vector in the XY plane, see PhQ::PlanarTraction. For scalar traction components or for the magnitude of a traction vector, see PhQ::ScalarTraction.

Definition at line 54 of file Traction.hpp.

Constructor & Destructor Documentation

◆ Traction() [1/11]

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

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

◆ Traction() [2/11]

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

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

Definition at line 61 of file Traction.hpp.

◆ Traction() [3/11]

template<typename NumericType = double>
PhQ::Traction< NumericType >::Traction ( const ScalarTraction< NumericType > &  x,
const ScalarTraction< NumericType > &  y,
const ScalarTraction< NumericType > &  z 
)
inline

Constructor. Constructs a traction vector from a given set of scalar traction components.

Definition at line 66 of file Traction.hpp.

References PhQ::Traction< NumericType >::x(), PhQ::Traction< NumericType >::y(), and PhQ::Traction< NumericType >::z().

◆ Traction() [4/11]

template<typename NumericType = double>
constexpr PhQ::Traction< NumericType >::Traction ( const ScalarTraction< NumericType > &  scalar_traction,
const Direction< NumericType > &  direction 
)
inlineconstexpr

Constructor. Constructs a traction vector from a given scalar traction and direction.

Definition at line 71 of file Traction.hpp.

◆ Traction() [5/11]

template<typename NumericType = double>
constexpr PhQ::Traction< NumericType >::Traction ( const PlanarTraction< NumericType > &  planar_traction)
inlineexplicitconstexpr

Constructor. Constructs a traction vector from a given planar traction vector in the XY plane. This traction vector's z-component is initialized to zero.

Definition at line 77 of file Traction.hpp.

References PhQ::DimensionalPlanarVector< UnitType, NumericType >::Value().

◆ Traction() [6/11]

template<typename NumericType = double>
constexpr PhQ::Traction< NumericType >::Traction ( const Force< NumericType > &  force,
const Area< NumericType > &  area 
)
inlineconstexpr

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

Definition at line 82 of file Traction.hpp.

◆ Traction() [7/11]

template<typename NumericType >
constexpr PhQ::Traction< NumericType >::Traction ( const Stress< NumericType > &  stress,
const Direction< NumericType > &  direction 
)
inlineconstexpr

Constructor. Constructs a traction vector from a given stress and direction using the definition of traction.

Definition at line 302 of file Stress.hpp.

References PhQ::DimensionalSymmetricDyad< UnitType, NumericType >::Value().

◆ ~Traction()

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

Destructor. Destroys this traction vector.

◆ Traction() [8/11]

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

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

◆ Traction() [9/11]

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

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

Definition at line 97 of file Traction.hpp.

◆ Traction() [10/11]

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

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

◆ Traction() [11/11]

template<typename NumericType = double>
constexpr PhQ::Traction< NumericType >::Traction ( const Vector< NumericType > &  value)
inlineexplicitconstexprprivate

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

Definition at line 216 of file Traction.hpp.

Member Function Documentation

◆ Angle()

template<typename NumericType = double>
PhQ::Angle<NumericType> PhQ::Traction< NumericType >::Angle ( const Traction< NumericType > &  traction) const
inline

Returns the angle between this traction vector and another one.

Definition at line 173 of file Traction.hpp.

◆ Create() [1/3]

template<typename NumericType = double>
template<Unit::Pressure Unit>
static constexpr Traction<NumericType> PhQ::Traction< NumericType >::Create ( const NumericType  x,
const NumericType  y,
const NumericType  z 
)
inlinestaticconstexpr

Statically creates a traction vector from the given x, y, and z Cartesian components expressed in a given pressure unit.

Definition at line 124 of file Traction.hpp.

References PhQ::Traction< NumericType >::x(), PhQ::Traction< NumericType >::y(), and PhQ::Traction< NumericType >::z().

◆ Create() [2/3]

template<typename NumericType = double>
template<Unit::Pressure Unit>
static constexpr Traction<NumericType> PhQ::Traction< NumericType >::Create ( const std::array< NumericType, 3 > &  x_y_z)
inlinestaticconstexpr

Statically creates a traction vector from the given x, y, and z Cartesian components expressed in a given pressure unit.

Definition at line 133 of file Traction.hpp.

◆ Create() [3/3]

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

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

Definition at line 142 of file Traction.hpp.

References PhQ::DimensionalVector< Unit::Pressure, double >::value.

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalVector< Unit::Pressure , double >::Dimensions ( )
inlinestaticconstexprinherited

Physical dimension set of this physical quantity.

Definition at line 50 of file DimensionalVector.hpp.

◆ Direction()

template<typename NumericType = double>
PhQ::Direction<NumericType> PhQ::Traction< NumericType >::Direction ( ) const
inline

Returns the direction of this traction vector.

Definition at line 168 of file Traction.hpp.

References PhQ::Vector< NumericType >::Direction(), and PhQ::DimensionalVector< Unit::Pressure, double >::value.

◆ JSON() [1/2]

std::string PhQ::DimensionalVector< 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 103 of file DimensionalVector.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalVector< 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 113 of file DimensionalVector.hpp.

◆ Magnitude()

template<typename NumericType = double>
ScalarTraction<NumericType> PhQ::Traction< NumericType >::Magnitude ( ) const
inline

Returns the magnitude of this traction vector.

Definition at line 163 of file Traction.hpp.

References PhQ::Vector< NumericType >::Magnitude(), and PhQ::DimensionalVector< Unit::Pressure, double >::value.

◆ MutableValue()

constexpr PhQ::Vector<double >& PhQ::DimensionalVector< 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 79 of file DimensionalVector.hpp.

◆ operator*() [1/2]

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

Definition at line 189 of file Traction.hpp.

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/()

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

◆ operator/=()

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

◆ operator=() [1/3]

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

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

◆ operator=() [2/3]

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

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

Definition at line 108 of file Traction.hpp.

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

◆ operator=() [3/3]

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

Move assignment operator. Assigns this traction vector by moving another one.

◆ Print() [1/2]

std::string PhQ::DimensionalVector< 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 91 of file DimensionalVector.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalVector< 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 97 of file DimensionalVector.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalVector< Unit::Pressure , double >::SetValue ( const PhQ::Vector< double > &  value)
inlineconstexprnoexceptinherited

Sets the value of this physical quantity expressed in its standard unit of measure to the given value.

Definition at line 85 of file DimensionalVector.hpp.

◆ StaticValue()

constexpr PhQ::Vector<double > PhQ::DimensionalVector< 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 73 of file DimensionalVector.hpp.

◆ Unit()

static constexpr Unit::Pressure PhQ::DimensionalVector< 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 56 of file DimensionalVector.hpp.

◆ Value() [1/2]

constexpr const PhQ::Vector<double >& PhQ::DimensionalVector< Unit::Pressure , double >::Value ( ) const
inlineconstexprnoexceptinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 61 of file DimensionalVector.hpp.

◆ Value() [2/2]

PhQ::Vector<double > PhQ::DimensionalVector< 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 66 of file DimensionalVector.hpp.

◆ x()

template<typename NumericType = double>
constexpr ScalarTraction<NumericType> PhQ::Traction< NumericType >::x ( ) const
inlineconstexprnoexcept

Returns the x Cartesian component of this traction vector.

Definition at line 148 of file Traction.hpp.

References PhQ::DimensionalVector< Unit::Pressure, double >::value, and PhQ::Vector< NumericType >::x().

Referenced by PhQ::Traction< NumericType >::Create(), and PhQ::Traction< NumericType >::Traction().

◆ XML() [1/2]

std::string PhQ::DimensionalVector< 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 123 of file DimensionalVector.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalVector< 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 133 of file DimensionalVector.hpp.

◆ y()

template<typename NumericType = double>
constexpr ScalarTraction<NumericType> PhQ::Traction< NumericType >::y ( ) const
inlineconstexprnoexcept

Returns the y Cartesian component of this traction vector.

Definition at line 153 of file Traction.hpp.

References PhQ::DimensionalVector< Unit::Pressure, double >::value, and PhQ::Vector< NumericType >::y().

Referenced by PhQ::Traction< NumericType >::Create(), and PhQ::Traction< NumericType >::Traction().

◆ YAML() [1/2]

std::string PhQ::DimensionalVector< 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 143 of file DimensionalVector.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalVector< 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 153 of file DimensionalVector.hpp.

◆ z()

template<typename NumericType = double>
constexpr ScalarTraction<NumericType> PhQ::Traction< NumericType >::z ( ) const
inlineconstexprnoexcept

Returns the z Cartesian component of this traction vector.

Definition at line 158 of file Traction.hpp.

References PhQ::DimensionalVector< Unit::Pressure, double >::value, and PhQ::Vector< NumericType >::z().

Referenced by PhQ::Traction< NumericType >::Create(), and PhQ::Traction< NumericType >::Traction().

◆ Zero()

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

Statically creates a traction vector of zero.

Definition at line 117 of file Traction.hpp.

References PhQ::Vector< NumericType >::Zero().

Member Data Documentation

◆ value

PhQ::Vector<double > PhQ::DimensionalVector< Unit::Pressure , double >::value
protectedinherited

Value of this physical quantity expressed in its standard unit of measure.

Definition at line 217 of file DimensionalVector.hpp.


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