> ## Documentation Index
> Fetch the complete documentation index at: https://developer.synopsys.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ansys::dpf::Unit Class Reference

`#include <dpf_api.h>`

## Public Member Functions

| Type | Name |
| - | - |
| | [Unit](#aa05714fa7ba83322ad7c7e44a7d4da8f) (std::string const \&symbol) |
| | [Unit](#af2bd161c5fa67f3f9bf58b9441692753) ([Homogeneity](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Homogeneity.md) const &[homogeneity](#a2ca6139006413a975a4995505ab826fc), [UnitSystem](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1UnitSystem.md) const \&unit\_system) |
|  bool | **operator==** ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const \&unit) const |
| double | [conversionFactorTo](#a8ca3445a56c372fd3734b5a7d00537f1) ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const \&rhs) const |
| double | [shiftTo](#a93b566af024726b9b9e2c0687976b10a) ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const \&rhs) const |
| bool | [isHomogeneousTo](#af4a5b081eaec3c708f1488f6191b397e) ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const &) const |
| [ansys::dpf::Homogeneity](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Homogeneity.md) const & | [homogeneity](#a2ca6139006413a975a4995505ab826fc) () const |
| std::string const & | [toString](#aed255d78340372d1dd05461d8bc29d38) () const |
| const char \* | [c\_str](#af130c0a87a7006258b3fb1e8b83d785b) () const |
| [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) | [multiplyWith](#ae55af41a7a8ed1d0a41a5468b74e7d34) ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const \&rhs) const |
| [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) | [divideBy](#af8033c3d0b41a3ea626221e21a7efce7) ([Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) const \&rhs) const |
| [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) | [invert](#adfd11657f700e8a4061d56aba08198ba) () const |
| [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) | [pow](#a9fe7810a66d3e479ad4dccff226933d8) (double power) const |

## Detailed Description

Definition of a unit.

**Examples**

[AveragingTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/AveragingTest_8cpp-example.md), [CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/CompleteRST_8cpp-example.md), [DataApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/DataApis_8cpp-example.md), [DataExport.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/DataExport_8cpp-example.md), and [ResultTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ResultTest_8cpp-example.md).

## Constructor & Destructor Documentation

### Unit() \[1/2]

```cpp theme={null}
ansys::dpf::Unit::Unit(std::string const & symbol)
```

`explicit`

Create a [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) with given name.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | symbol | Symbol name of unit. |

### Unit() \[2/2]

```cpp theme={null}
ansys::dpf::Unit::Unit(
    Homogeneity const & homogeneity,
    UnitSystem const & unit_system
)
```

`explicit`

Create a [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) with a given homogeneity from given unit\_system.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | homogeneity | Measurement quantity. |
| \[in] | unit\_system | [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) system from which to create unit. |

## Member Function Documentation

### c\_str()

```cpp theme={null}
const char * ansys::dpf::Unit::c_str() const
```

**Returns**

Symbol name.

### conversionFactorTo()

```cpp theme={null}
double ansys::dpf::Unit::conversionFactorTo(Unit const & rhs) const
```

**Returns**

Multiplication factor required to convert to new unit system.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | rhs | [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) system to which to convert. |

### divideBy()

```cpp theme={null}
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()

```cpp theme={null}
ansys::dpf::Homogeneity const & ansys::dpf::Unit::homogeneity() const
```

**Returns**

Measurement quantity.

**Examples**

[CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/CompleteRST_8cpp-example.md), and [ResultTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ResultTest_8cpp-example.md).

### invert()

```cpp theme={null}
Unit ansys::dpf::Unit::invert() const
```

**Returns**

new the inverse unit to this one.

Works only for in process API.

### isHomogeneousTo()

```cpp theme={null}
bool ansys::dpf::Unit::isHomogeneousTo(Unit const &) const
```

**Returns**

Indication of same measurement quantities.

### multiplyWith()

```cpp theme={null}
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()

```cpp theme={null}
Unit ansys::dpf::Unit::pow(double power) const
```

**Returns**

the powed unit.

Works only for in process API.

### shiftTo()

```cpp theme={null}
double ansys::dpf::Unit::shiftTo(Unit const & rhs) const
```

**Returns**

Additive factor required to convert to new unit system.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | rhs | [Unit](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Unit.md) system to which to convert. |

### toString()

```cpp theme={null}
std::string const & ansys::dpf::Unit::toString() const
```

**Returns**

Symbol name.

**Examples**

[CompleteRST.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/CompleteRST_8cpp-example.md).
