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

Two-dimensional Euclidean traction vector in the XY plane. Contains two components in Cartesian coordinates: x and y. 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 scalar traction components or for the magnitude of a traction vector, see PhQ::ScalarTraction. More...

#include "PlanarTraction.hpp"

Public Member Functions

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

Private Member Functions

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

Detailed Description

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

Two-dimensional Euclidean traction vector in the XY plane. Contains two components in Cartesian coordinates: x and y. 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 scalar traction components or for the magnitude of a traction vector, see PhQ::ScalarTraction.

Definition at line 53 of file PlanarTraction.hpp.

Constructor & Destructor Documentation

◆ PlanarTraction() [1/11]

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

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

◆ PlanarTraction() [2/11]

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

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

Definition at line 60 of file PlanarTraction.hpp.

◆ PlanarTraction() [3/11]

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

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

Definition at line 65 of file PlanarTraction.hpp.

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

◆ PlanarTraction() [4/11]

template<typename NumericType = double>
constexpr PhQ::PlanarTraction< NumericType >::PlanarTraction ( const ScalarTraction< NumericType > &  scalar_traction,
const PlanarDirection< NumericType > &  planar_direction 
)
inlineconstexpr

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

Definition at line 70 of file PlanarTraction.hpp.

◆ PlanarTraction() [5/11]

template<typename NumericType >
constexpr PhQ::PlanarTraction< NumericType >::PlanarTraction ( const Traction< NumericType > &  traction)
inlineexplicitconstexpr

Constructor. Constructs a planar traction vector from a given traction vector by projecting the traction vector onto the XY plane.

Definition at line 301 of file Traction.hpp.

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

◆ PlanarTraction() [6/11]

template<typename NumericType = double>
constexpr PhQ::PlanarTraction< NumericType >::PlanarTraction ( const PlanarForce< NumericType > &  planar_force,
const Area< NumericType > &  area 
)
inlineconstexpr

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

Definition at line 80 of file PlanarTraction.hpp.

◆ PlanarTraction() [7/11]

template<typename NumericType >
constexpr PhQ::PlanarTraction< NumericType >::PlanarTraction ( const Stress< NumericType > &  stress,
const PlanarDirection< NumericType > &  planar_direction 
)
inlineconstexpr

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

Definition at line 297 of file Stress.hpp.

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

◆ ~PlanarTraction()

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

Destructor. Destroys this planar traction vector.

◆ PlanarTraction() [8/11]

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

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

◆ PlanarTraction() [9/11]

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

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

Definition at line 97 of file PlanarTraction.hpp.

◆ PlanarTraction() [10/11]

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

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

◆ PlanarTraction() [11/11]

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

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

Definition at line 219 of file PlanarTraction.hpp.

Member Function Documentation

◆ Angle()

template<typename NumericType = double>
PhQ::Angle<NumericType> PhQ::PlanarTraction< NumericType >::Angle ( const PlanarTraction< NumericType > &  planar_traction) const
inline

Returns the angle between this planar traction vector and another one.

Definition at line 173 of file PlanarTraction.hpp.

◆ Create() [1/3]

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

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

Definition at line 126 of file PlanarTraction.hpp.

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

◆ Create() [2/3]

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

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

Definition at line 146 of file PlanarTraction.hpp.

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

◆ Create() [3/3]

template<typename NumericType = double>
template<Unit::Pressure Unit>
static constexpr PlanarTraction<NumericType> PhQ::PlanarTraction< NumericType >::Create ( const std::array< NumericType, 2 > &  x_y)
inlinestaticconstexpr

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

Definition at line 136 of file PlanarTraction.hpp.

◆ Dimensions()

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

Physical dimension set of this physical quantity.

Definition at line 50 of file DimensionalPlanarVector.hpp.

◆ JSON() [1/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ JSON() [2/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ Magnitude()

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

Returns the magnitude of this planar traction vector.

Definition at line 163 of file PlanarTraction.hpp.

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

◆ MutableValue()

constexpr PhQ::PlanarVector<double >& PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ operator*() [1/2]

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

Definition at line 192 of file PlanarTraction.hpp.

◆ operator*() [2/2]

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

◆ operator*=()

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

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator/()

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

◆ operator/=()

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

◆ operator=() [1/3]

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

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

◆ operator=() [2/3]

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

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

Definition at line 109 of file PlanarTraction.hpp.

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

◆ operator=() [3/3]

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

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

◆ PlanarDirection()

template<typename NumericType = double>
PhQ::PlanarDirection<NumericType> PhQ::PlanarTraction< NumericType >::PlanarDirection ( ) const
inline

Returns the direction of this planar traction vector.

Definition at line 168 of file PlanarTraction.hpp.

References PhQ::PlanarVector< NumericType >::PlanarDirection(), and PhQ::DimensionalPlanarVector< Unit::Pressure, double >::value.

◆ Print() [1/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ Print() [2/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ SetValue()

constexpr void PhQ::DimensionalPlanarVector< Unit::Pressure , double >::SetValue ( const PhQ::PlanarVector< 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 DimensionalPlanarVector.hpp.

◆ StaticValue()

constexpr PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ Unit()

static constexpr Unit::Pressure PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ Value() [1/2]

constexpr const PhQ::PlanarVector<double >& PhQ::DimensionalPlanarVector< Unit::Pressure , double >::Value ( ) const
inlineconstexprnoexceptinherited

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

Definition at line 61 of file DimensionalPlanarVector.hpp.

◆ Value() [2/2]

PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ x()

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

◆ XML() [1/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ XML() [2/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ y()

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

◆ YAML() [1/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ YAML() [2/2]

std::string PhQ::DimensionalPlanarVector< 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 DimensionalPlanarVector.hpp.

◆ Zero()

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

Statically creates a planar traction vector of zero.

Definition at line 119 of file PlanarTraction.hpp.

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

Member Data Documentation

◆ value

PhQ::PlanarVector<double > PhQ::DimensionalPlanarVector< Unit::Pressure , double >::value
protectedinherited

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

Definition at line 222 of file DimensionalPlanarVector.hpp.


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