Physical Quantities  v1.0.0
C++ library of physical quantities, physical models, and units of measure for scientific computing. https://github.com/acodcha/phq
Namespaces | Functions | Variables
Unit.hpp File Reference
#include <functional>
#include <type_traits>
#include <vector>
#include "Dimensions.hpp"
#include "Dyad.hpp"
#include "PlanarVector.hpp"
#include "SymmetricDyad.hpp"
#include "UnitSystem.hpp"
#include "Vector.hpp"

Go to the source code of this file.

Namespaces

 PhQ
 Namespace that encompasses all of the Physical Quantities library's content.
 
 PhQ::Unit
 Namespace that contains units of measure.
 

Functions

template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (NumericType &value, const Unit original_unit, const Unit new_unit)
 Converts a value expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , std::size_t Size, typename NumericType >
void PhQ::ConvertInPlace (std::array< NumericType, Size > &values, const Unit original_unit, const Unit new_unit)
 Converts an array of values expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (std::vector< NumericType > &values, const Unit original_unit, const Unit new_unit)
 Converts a vector of values expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (PlanarVector< NumericType > &planar_vector, const Unit original_unit, const Unit new_unit)
 Converts a two-dimensional Euclidean planar vector in the XY plane expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (Vector< NumericType > &vector, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean vector expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (SymmetricDyad< NumericType > &symmetric_dyad, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean symmetric dyadic tensor expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
void PhQ::ConvertInPlace (Dyad< NumericType > &dyad, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean dyadic tensor expressed in a given unit of measure to a new unit of measure. The conversion is performed in-place. More...
 
template<typename Unit , typename NumericType >
NumericType PhQ::Convert (const NumericType value, const Unit original_unit, const Unit new_unit)
 Converts a value expressed in a given unit of measure to a new unit of measure. Returns the converted value. The original value remains unchanged. More...
 
template<typename Unit , std::size_t Size, typename NumericType >
std::array< NumericType, Size > PhQ::Convert (const std::array< NumericType, Size > &values, const Unit original_unit, const Unit new_unit)
 Converts an array of values expressed in a given unit of measure to a new unit of measure. Returns the converted values. The original values remain unchanged. More...
 
template<typename Unit , typename NumericType >
std::vector< NumericType > PhQ::Convert (const std::vector< NumericType > &values, const Unit original_unit, const Unit new_unit)
 Converts a vector of values expressed in a given unit of measure to a new unit of measure. Returns the converted values. The original values remain unchanged. More...
 
template<typename Unit , typename NumericType >
PlanarVector< NumericType > PhQ::Convert (const PlanarVector< NumericType > &planar_vector, const Unit original_unit, const Unit new_unit)
 Converts a two-dimensional Euclidean planar vector in the XY plane expressed in a given unit of measure to a new unit of measure. Returns the converted vector. The original vector remains unchanged. More...
 
template<typename Unit , typename NumericType >
Vector< NumericType > PhQ::Convert (const Vector< NumericType > &vector, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean vector expressed in a given unit of measure to a new unit of measure. Returns the converted vector. The original vector remains unchanged. More...
 
template<typename Unit , typename NumericType >
SymmetricDyad< NumericType > PhQ::Convert (const SymmetricDyad< NumericType > &symmetric_dyad, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean symmetric dyadic tensor expressed in a given unit of measure to a new unit of measure. Returns the converted tensor. The original tensor remains unchanged. More...
 
template<typename Unit , typename NumericType >
Dyad< NumericType > PhQ::Convert (const Dyad< NumericType > &dyad, const Unit original_unit, const Unit new_unit)
 Converts a three-dimensional Euclidean dyadic tensor expressed in a given unit of measure to a new unit of measure. Returns the converted tensor. The original tensor remains unchanged. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, typename NumericType >
constexpr NumericType PhQ::ConvertStatically (const NumericType value)
 Converts a value expressed in a given unit of measure to a new unit of measure. Returns the converted value. The original value remains unchanged. This function can be evaluated at compile time. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, std::size_t Size, typename NumericType >
constexpr std::array< NumericType, Size > PhQ::ConvertStatically (const std::array< NumericType, Size > &values)
 Converts an array of values expressed in a given unit of measure to a new unit of measure. Returns the converted values. The original values remain unchanged. This function can be evaluated at compile time. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, typename NumericType >
constexpr PlanarVector< NumericType > PhQ::ConvertStatically (const PlanarVector< NumericType > &planar_vector)
 Converts a two-dimensional Euclidean planar vector in the XY plane expressed in a given unit of measure to a new unit of measure. Returns the converted vector. The original vector remains unchanged. This function can be evaluated at compile time. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, typename NumericType >
constexpr Vector< NumericType > PhQ::ConvertStatically (const Vector< NumericType > &vector)
 Converts a three-dimensional Euclidean vector expressed in a given unit of measure to a new unit of measure. Returns the converted vector. The original vector remains unchanged. This function can be evaluated at compile time. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, typename NumericType >
constexpr SymmetricDyad< NumericType > PhQ::ConvertStatically (const SymmetricDyad< NumericType > &symmetric_dyad)
 Converts a three-dimensional Euclidean symmetric dyadic tensor expressed in a given unit of measure to a new unit of measure. Returns the converted tensor. The original tensor remains unchanged. This function can be evaluated at compile time. More...
 
template<typename Unit , Unit OriginalUnit, Unit NewUnit, typename NumericType >
constexpr Dyad< NumericType > PhQ::ConvertStatically (const Dyad< NumericType > &dyad)
 Converts a three-dimensional Euclidean dyadic tensor expressed in a given unit of measure to a new unit of measure. Returns the converted tensor. The original tensor remains unchanged. This function can be evaluated at compile time. More...
 

Variables

template<typename Unit >
constexpr Dimensions PhQ::RelatedDimensions
 Physical dimension set of a given type of unit of measure. Units of measure are organized into types that share the same physical dimension set. More...