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

Surface area or cross-sectional area. Can also represent a scalar component of a vector area or the magnitude of a vector area. Any closed surface has a vector area: it is the surface integral of its surface normal direction. A vector area is an oriented area; it is the three-dimensional Euclidean vector representation of an area; see PhQ::VectorArea. More...

#include "Area.hpp"

Public Member Functions

 Area ()=default
 Default constructor. Constructs an area with an uninitialized value. More...
 
 Area (const NumericType value, const Unit::Area unit)
 Constructor. Constructs an area with a given value expressed in a given area unit. More...
 
constexpr Area (const Length< NumericType > &length1, const Length< NumericType > &length2)
 Constructor. Constructs an area from two given lengths. More...
 
constexpr Area (const Volume< NumericType > &volume, const Length< NumericType > &length)
 Constructor. Constructs an area from a given volume and length. More...
 
constexpr Area (const ScalarForce< NumericType > &scalar_force, const ScalarTraction< NumericType > &scalar_traction)
 Constructor. Constructs an area from a given scalar force magnitude and scalar traction magnitude using the definition of traction. More...
 
constexpr Area (const ScalarForce< NumericType > &scalar_force, const StaticPressure< NumericType > &static_pressure)
 Constructor. Constructs an area from a given scalar force magnitude and static pressure using the definition of pressure. More...
 
 ~Area () noexcept=default
 Destructor. Destroys this area. More...
 
constexpr Area (const Area< NumericType > &other)=default
 Copy constructor. Constructs an area by copying another one. More...
 
template<typename OtherNumericType >
constexpr Area (const Area< OtherNumericType > &other)
 Copy constructor. Constructs an area by copying another one. More...
 
constexpr Area (Area< NumericType > &&other) noexcept=default
 Move constructor. Constructs an area by moving another one. More...
 
constexpr Area< NumericType > & operator= (const Area< NumericType > &other)=default
 Copy assignment operator. Assigns this area by copying another one. More...
 
template<typename OtherNumericType >
constexpr Area< NumericType > & operator= (const Area< OtherNumericType > &other)
 Copy assignment operator. Assigns this area by copying another one. More...
 
constexpr Area< NumericType > & operator= (Area< NumericType > &&other) noexcept=default
 Move assignment operator. Assigns this area by moving another one. More...
 
constexpr Area< NumericType > operator+ (const Area< NumericType > &area) const
 
constexpr Area< NumericType > operator- (const Area< NumericType > &area) const
 
constexpr Area< NumericType > operator* (const NumericType number) const
 
constexpr Volume< NumericType > operator* (const Length< NumericType > &length) const
 
constexpr ScalarForce< NumericType > operator* (const ScalarTraction< NumericType > &scalar_traction) const
 
constexpr ScalarForce< NumericType > operator* (const StaticPressure< NumericType > &static_pressure) const
 
constexpr VectorArea< NumericType > operator* (const Direction< NumericType > &direction) const
 
constexpr Area< NumericType > operator/ (const NumericType number) const
 
constexpr Length< NumericType > operator/ (const Length< NumericType > &length) const
 
constexpr NumericType operator/ (const Area< NumericType > &area) const noexcept
 
constexpr void operator+= (const Area< NumericType > &area) noexcept
 
constexpr void operator-= (const Area< NumericType > &area) 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::Area 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::Area 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::Area 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::Area 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::Area 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 Area< NumericType > Zero ()
 Statically creates an area of zero. More...
 
template<Unit::Area Unit>
static constexpr Area< NumericType > Create (const NumericType value)
 Statically creates an area with a given value expressed in a given area unit. More...
 
static constexpr const PhQ::DimensionsDimensions ()
 Physical dimension set of this physical quantity. More...
 
static constexpr Unit::Area 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 Area (const NumericType value)
 Constructor. Constructs an area with a given value expressed in the standard area unit. More...
 

Friends

template<typename OtherArea >
class VectorArea
 

Detailed Description

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

Surface area or cross-sectional area. Can also represent a scalar component of a vector area or the magnitude of a vector area. Any closed surface has a vector area: it is the surface integral of its surface normal direction. A vector area is an oriented area; it is the three-dimensional Euclidean vector representation of an area; see PhQ::VectorArea.

Definition at line 71 of file Area.hpp.

Constructor & Destructor Documentation

◆ Area() [1/10]

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

Default constructor. Constructs an area with an uninitialized value.

◆ Area() [2/10]

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

Constructor. Constructs an area with a given value expressed in a given area unit.

Definition at line 77 of file Area.hpp.

◆ Area() [3/10]

template<typename NumericType = double>
constexpr PhQ::Area< NumericType >::Area ( const Length< NumericType > &  length1,
const Length< NumericType > &  length2 
)
inlineconstexpr

Constructor. Constructs an area from two given lengths.

Definition at line 81 of file Area.hpp.

◆ Area() [4/10]

template<typename NumericType = double>
constexpr PhQ::Area< NumericType >::Area ( const Volume< NumericType > &  volume,
const Length< NumericType > &  length 
)
constexpr

Constructor. Constructs an area from a given volume and length.

◆ Area() [5/10]

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

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

◆ Area() [6/10]

template<typename NumericType = double>
constexpr PhQ::Area< NumericType >::Area ( const ScalarForce< NumericType > &  scalar_force,
const StaticPressure< NumericType > &  static_pressure 
)
constexpr

Constructor. Constructs an area from a given scalar force magnitude and static pressure using the definition of pressure.

◆ ~Area()

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

Destructor. Destroys this area.

◆ Area() [7/10]

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

Copy constructor. Constructs an area by copying another one.

◆ Area() [8/10]

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

Copy constructor. Constructs an area by copying another one.

Definition at line 105 of file Area.hpp.

◆ Area() [9/10]

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

Move constructor. Constructs an area by moving another one.

◆ Area() [10/10]

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

Constructor. Constructs an area with a given value expressed in the standard area unit.

Definition at line 187 of file Area.hpp.

Member Function Documentation

◆ Create()

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

Statically creates an area with a given value expressed in a given area unit.

Definition at line 131 of file Area.hpp.

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

◆ Dimensions()

static constexpr const PhQ::Dimensions& PhQ::DimensionalScalar< Unit::Area , 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::Area , 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::Area , double >::JSON ( const Unit::Area  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::Area , 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/5]

template<typename NumericType = double>
constexpr VectorArea<NumericType> PhQ::Area< NumericType >::operator* ( const Direction< NumericType > &  direction) const
constexpr

◆ operator*() [2/5]

template<typename NumericType = double>
constexpr Volume<NumericType> PhQ::Area< NumericType >::operator* ( const Length< NumericType > &  length) const
constexpr

◆ operator*() [3/5]

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

Definition at line 143 of file Area.hpp.

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

◆ operator*() [4/5]

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

◆ operator*() [5/5]

template<typename NumericType = double>
constexpr ScalarForce<NumericType> PhQ::Area< NumericType >::operator* ( const StaticPressure< NumericType > &  static_pressure) const
constexpr

◆ operator*=()

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

Definition at line 177 of file Area.hpp.

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

◆ operator+()

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

◆ operator+=()

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

Definition at line 169 of file Area.hpp.

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

◆ operator-()

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

◆ operator-=()

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

Definition at line 173 of file Area.hpp.

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

◆ operator/() [1/3]

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

Definition at line 165 of file Area.hpp.

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

◆ operator/() [2/3]

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

Definition at line 161 of file Area.hpp.

◆ operator/() [3/3]

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

Definition at line 157 of file Area.hpp.

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

◆ operator/=()

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

Definition at line 181 of file Area.hpp.

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

◆ operator=() [1/3]

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

Move assignment operator. Assigns this area by moving another one.

◆ operator=() [2/3]

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

Copy assignment operator. Assigns this area by copying another one.

◆ operator=() [3/3]

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

Copy assignment operator. Assigns this area by copying another one.

Definition at line 116 of file Area.hpp.

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

◆ Print() [1/2]

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

Statically creates an area of zero.

Definition at line 125 of file Area.hpp.

Friends And Related Function Documentation

◆ VectorArea

template<typename NumericType = double>
template<typename OtherArea >
friend class VectorArea
friend

Definition at line 191 of file Area.hpp.

Member Data Documentation

◆ value

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