Skip to main content

DPF C++ Client Library 2025 R2

ansys::dpf::Unit Class Reference

Last update: 16.07.2025

#include <dpf_api.h>

Public Member Functions

 Unit (std::string const &symbol)
 
 Unit (Homogeneity const &homogeneity, UnitSystem const &unit_system)
 
 Unit (Homogeneity const &homogeneity, std::string const &symbol)
 
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
 
Unit multiplyWith (Unit const &rhs) const
 
Unit divideBy (Unit const &rhs) const
 
Unit invert () const
 
Unit pow (double power) const
 

Detailed Description

Constructor & Destructor Documentation

◆ Unit() [1/3]

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

Create a Unit with given name.

Parameters
[in]symbolSymbol name of unit.

◆ Unit() [2/3]

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.

◆ Unit() [3/3]

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

Create a Unit with a given homogeneity and a given symbol.

Parameters
[in]homogeneityMeasurement quantity.
[in]symbolSymbol name of 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.

◆ divideBy()

Unit ansys::dpf::Unit::divideBy ( Unit const &  rhs) const
Returns
new unit that is the division of this unit by another one.

Works only for in process API.

◆ homogeneity()

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

◆ invert()

Unit ansys::dpf::Unit::invert ( ) const
Returns
new the inverse unit to this one.

Works only for in process API.

◆ isHomogeneousTo()

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

◆ multiplyWith()

Unit ansys::dpf::Unit::multiplyWith ( Unit const &  rhs) const
Returns
new unit that is the product of this unit and another one.

Works only for in process API.

◆ pow()

Unit ansys::dpf::Unit::pow ( double  power) const
Returns
the powed unit.

Works only for in process API.

◆ 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.

Connect with Ansys