Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::Unit Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Public Member Functions

 Unit (std::string const &symbol)
 
 Unit (Homogeneity const &homogeneity, UnitSystem const &unit_system)
 
bool operator== (Unit const &unit) const
 
double conversionFactorTo (Unit const &rhs) const
 
double shiftTo (Unit const &rhs) const
 
bool isHomogeneousTo (Unit const &) const
 
ansys::dpf::Homogeneity const & homogeneity () const
 
std::string const & toString () const
 
const char * c_str () const
 

Detailed Description

Definition of a unit.

Examples
CompleteRST.cpp, DataApis.cpp, DataExport.cpp, and ResultTest.cpp.

Constructor & Destructor Documentation

◆ Unit() [1/2]

ansys::dpf::Unit::Unit ( std::string const &  symbol)
explicit

Create a Unit with given name.

Parameters
[in]symbolSymbol name of unit.

◆ Unit() [2/2]

ansys::dpf::Unit::Unit ( Homogeneity const &  homogeneity,
UnitSystem const &  unit_system 
)
explicit

Create a Unit with a given homogeneity from given unit_system.

Parameters
[in]homogeneityMeasurement quantity.
[in]unit_systemUnit system from which to create unit.

Member Function Documentation

◆ c_str()

const char * ansys::dpf::Unit::c_str ( ) const
Returns
Symbol name.

◆ conversionFactorTo()

double ansys::dpf::Unit::conversionFactorTo ( Unit const &  rhs) const
Returns
Multiplication factor required to convert to new unit system.
Parameters
[in]rhsUnit system to which to convert.

◆ homogeneity()

ansys::dpf::Homogeneity const & ansys::dpf::Unit::homogeneity ( ) const
Returns
Measurement quantity.
Examples
CompleteRST.cpp, and ResultTest.cpp.

◆ isHomogeneousTo()

bool ansys::dpf::Unit::isHomogeneousTo ( Unit const &  ) const
Returns
Indication of same measurement quantities.

◆ shiftTo()

double ansys::dpf::Unit::shiftTo ( Unit const &  rhs) const
Returns
Additive factor required to convert to new unit system.
Parameters
[in]rhsUnit system to which to convert.

◆ toString()

std::string const & ansys::dpf::Unit::toString ( ) const
Returns
Symbol name.
Examples
CompleteRST.cpp.