    

 ## On this page

  

 

 # Class ansys::dpf::LabelSpace

 Last update: 25.03.2026 

<a id="classansys-dpf-labelspace"></a>

![](https://img.shields.io/badge/language-C%2B%2B-blue "C++")![](https://img.shields.io/badge/-public-brightgreen "public")

Defines an indexation for fields container.

**Inherits from**:

- [ansys::dpf::DpfTypes](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes)

## Members

- [add](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ad9ba9b56c0035b68197893571372def3)
- [addAnyDomain](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a784c57a7b13941ec85ddc44414002c2b)
- [addAnyTime](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ab29ab2f6ac32715fbc5f8de6ea8016c8)
- [at](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a587c2abcb548947202249204e854e51f)
- [callAPI](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
- [deep\_copy](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1acddfde124cc45b380f14613aaed79767)
- [describe](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9977945710983bc03d2940fa007847b2)
- [empty](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a39cd546c42518e2332be8f287db95459)
- [emptyLabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a50fe673ff484fd698d174a07ba8f74c4)
- [erase](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a987bf530c14c050fe9fe10eacaf886f3)
- [getClient](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
- [has](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a89cdb7a54e3ba4150072bd5d8ded7b32)
- [hasBeenMovedLocally](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a1a5634202c15404b6b24e8f50e51cb66)
- [hasInternalObject](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ae198f89868d85c7db6dc1a934a1d3c15)
- [isOnCommonAPI](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9f9789ff61cc9d400a2a344830706b73)
- [isSameObject](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aa64d5f8fcd7d85ad6ebf708494dbefd7)
- [labelsName](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a5b6f5d2ede089e6518180f143b147124)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a2bcceca3a65f476108ffa868bd360900)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a13b9bdced162f48db88fce361a9e6207)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1aaf340020154b829721665edaf63782b0)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ae24da9b938cc72d3323793a566a469e7)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ab0df700b408197ea42d97e452dbd0337)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ab21565a3cb171e2c29b6d61bc28b193a)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a287d7e799f4f2ae23bd3de0028d51272)
- [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a1e95d64b1f8eac710a4c4799cf6f9db6)
- [mergeWith](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a02a19ef066b7070148398a794cce2f62)
- [operator=](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ad1c50243ae1d2959743bb13f98142dc6)
- [operator=](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1afdbf29825617b3b0b2cbd8da929d32ef)
- [set](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a01720b6c41dd542be5a53727356b6aa9)
- [setComplex](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a9a42fd2a57d80e6b82758e4db435d26e)
- [setDomain](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1aa47e223975ee54006ebb05fb071877a5)
- [setTime](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1ad5660f1a3869849ab28ff29b822d5ea8)
- [size](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a2bee3fab11075359f8b29fea2757ae5f)
- [~DpfTypes](classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)
- [~LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace-1a28e7686db350df335e5195818f8fbcaa)

## Friends

## Public functions

<a id="classansys-dpf-labelspace-1a2bcceca3a65f476108ffa868bd360900"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace()

```

**Return type**:

<a id="classansys-dpf-labelspace-1a13b9bdced162f48db88fce361a9e6207"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(Client const *const client)

```

Create a new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) for a given client.

**Parameters**:

- [Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client**: \[in\] [Client](classansys-dpf-client.md#classansys-dpf-client) instance designating the IP, port and protocol to use.

**Return type**:

<a id="classansys-dpf-labelspace-1aaf340020154b829721665edaf63782b0"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(std::map< Label, dp_int > const &rhs, Client const *const client)

```

Consturct new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) from labels and values.

**Parameters**:

- std::map&lt; [Label](structansys-dpf-label.md#structansys-dpf-label), [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp; **rhs**: \[in\] labels and values with which to construct space.
- [Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client**: \[in\] [Client](classansys-dpf-client.md#classansys-dpf-client) instance designating the IP, port and protocol to use.

**Return type**:

<a id="classansys-dpf-labelspace-1ae24da9b938cc72d3323793a566a469e7"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(std::initializer_list< std::pair< const Label, int > > init, Client const *const client)

```

Construct new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) from pairs of labels and values.

**Parameters**:

- std::initializer\_list&lt; std::pair&lt; const [Label](structansys-dpf-label.md#structansys-dpf-label), int &gt; &gt; **init**: \[in\] List of label/value pairs.
- [Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client**: \[in\] [Client](classansys-dpf-client.md#classansys-dpf-client) instance designating the IP, port and protocol to use.

**Return type**:

<a id="classansys-dpf-labelspace-1ab0df700b408197ea42d97e452dbd0337"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(std::map< Label, dp_int > const &rhs)

```

Consturct new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) from labels and values.

**Parameters**:

- std::map&lt; [Label](structansys-dpf-label.md#structansys-dpf-label), [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) &gt; const &amp; **rhs**: \[in\] labels and values with which to construct space.

**Return type**:

<a id="classansys-dpf-labelspace-1ab21565a3cb171e2c29b6d61bc28b193a"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(std::initializer_list< std::pair< const Label, int > > init)

```

Construct new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) from pairs of labels and values.

**Parameters**:

- std::initializer\_list&lt; std::pair&lt; const [Label](structansys-dpf-label.md#structansys-dpf-label), int &gt; &gt; **init**: \[in\] List of label/value pairs.

**Return type**:

<a id="classansys-dpf-labelspace-1a28e7686db350df335e5195818f8fbcaa"></a>

### Function ~LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
virtual ansys::dpf::LabelSpace::~LabelSpace()

```

**Return type**:

<a id="classansys-dpf-labelspace-1a287d7e799f4f2ae23bd3de0028d51272"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(LabelSpace const &)

```

**Parameters**:

- LabelSpace const &amp;

**Return type**:

<a id="classansys-dpf-labelspace-1a1e95d64b1f8eac710a4c4799cf6f9db6"></a>

### Function LabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
ansys::dpf::LabelSpace::LabelSpace(LabelSpace &&) noexcept

```

**Parameters**:

- LabelSpace &amp;&amp;

**Return type**:

<a id="classansys-dpf-labelspace-1ad1c50243ae1d2959743bb13f98142dc6"></a>

### Function operator=

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::operator=(LabelSpace const &)

```

**Parameters**:

- LabelSpace const &amp;

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1afdbf29825617b3b0b2cbd8da929d32ef"></a>

### Function operator=

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::operator=(LabelSpace &&) noexcept

```

**Parameters**:

- LabelSpace &amp;&amp;

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1ad9ba9b56c0035b68197893571372def3"></a>

### Function add

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
void ansys::dpf::LabelSpace::add(Label const &label, dp_int value)

```

Add a label with value. If label already exists, nothing happens.

**Parameters**:

- [Label](structansys-dpf-label.md#structansys-dpf-label) const &amp; **label**: \[in\] [Label](structansys-dpf-label.md#structansys-dpf-label) to add to [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace).
- [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **value**: \[in\] Value of label.

**Return type**: void

<a id="classansys-dpf-labelspace-1a01720b6c41dd542be5a53727356b6aa9"></a>

### Function set

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
void ansys::dpf::LabelSpace::set(Label const &label, dp_int value)

```

Set an already existing label to value. If label does not exist it is added.

**Parameters**:

- [Label](structansys-dpf-label.md#structansys-dpf-label) const &amp; **label**: \[in\] [Label](structansys-dpf-label.md#structansys-dpf-label) whose value to set.
- [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **value**: \[in\] New value of label.

**Return type**: void

<a id="classansys-dpf-labelspace-1a987bf530c14c050fe9fe10eacaf886f3"></a>

### Function erase

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
void ansys::dpf::LabelSpace::erase(Label const &label)

```

Removes label from space.

**Parameters**:

- [Label](structansys-dpf-label.md#structansys-dpf-label) const &amp; **label**: \[in\] [Label](structansys-dpf-label.md#structansys-dpf-label) to remove.

**Return type**: void

<a id="classansys-dpf-labelspace-1a2bee3fab11075359f8b29fea2757ae5f"></a>

### Function size

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
dp_int ansys::dpf::LabelSpace::size() const

```

**Returns**:

Number of labels in space.

**Return type**: [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

<a id="classansys-dpf-labelspace-1a89cdb7a54e3ba4150072bd5d8ded7b32"></a>

### Function has

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
bool ansys::dpf::LabelSpace::has(Label const &label) const

```

**Returns**:

Indication that label exists within space.

**Parameters**:

- [Label](structansys-dpf-label.md#structansys-dpf-label) const &amp; **label**: \[in\] [Label](structansys-dpf-label.md#structansys-dpf-label) of which to check existence.

**Return type**: bool

<a id="classansys-dpf-labelspace-1a587c2abcb548947202249204e854e51f"></a>

### Function at

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
dp_int ansys::dpf::LabelSpace::at(Label const &label) const

```

**Returns**:

Value of label within space.

**Parameters**:

- [Label](structansys-dpf-label.md#structansys-dpf-label) const &amp; **label**: \[in\] [Label](structansys-dpf-label.md#structansys-dpf-label) of which to get value.

**Return type**: [dp\_int](namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

<a id="classansys-dpf-labelspace-1a5b6f5d2ede089e6518180f143b147124"></a>

### Function labelsName

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
std::string ansys::dpf::LabelSpace::labelsName(dp_index index) const

```

**Returns**:

name of label at given index.

**Parameters**:

- [dp\_index](namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **index**: \[in\] Index of the wanted label.

**Return type**: std::string

<a id="classansys-dpf-labelspace-1ad5660f1a3869849ab28ff29b822d5ea8"></a>

### Function setTime

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::setTime(dp_index i)

```

Set time label to value. **Returns**:

Reference to labelspace.

**See also**: [labels](structansys-dpf-labels.md#structansys-dpf-labels)

**Parameters**:

- [dp\_index](namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **i**: \[in\] New value for time label.

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1aa47e223975ee54006ebb05fb071877a5"></a>

### Function setDomain

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::setDomain(dp_index i)

```

Set domain label to value **Returns**:

Reference to labelspace.

**See also**: [labels](structansys-dpf-labels.md#structansys-dpf-labels)

**Parameters**:

- [dp\_index](namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **i**: \[in\] New value for domain label.

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1a9a42fd2a57d80e6b82758e4db435d26e"></a>

### Function setComplex

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::setComplex(dp_index i)

```

Set complex label to value. **Returns**:

Reference to labelspace.

**See also**: [labels](structansys-dpf-labels.md#structansys-dpf-labels)

**Parameters**:

- [dp\_index](namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **i**: \[in\] New value for complex label.

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1ab29ab2f6ac32715fbc5f8de6ea8016c8"></a>

### Function addAnyTime

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::addAnyTime()

```

Set time label to -1. **Returns**:

Reference to labelspace.

**See also**: [labels](structansys-dpf-labels.md#structansys-dpf-labels)

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1a784c57a7b13941ec85ddc44414002c2b"></a>

### Function addAnyDomain

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
LabelSpace & ansys::dpf::LabelSpace::addAnyDomain()

```

Set domain label to -1. **Returns**:

Reference to labelspace.

**See also**: [labels](structansys-dpf-labels.md#structansys-dpf-labels)

**Return type**: LabelSpace &amp;

<a id="classansys-dpf-labelspace-1acddfde124cc45b380f14613aaed79767"></a>

### Function deep\_copy

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-const-lightblue "const")

```cpp
LabelSpace ansys::dpf::LabelSpace::deep_copy(ansys::dpf::Client const *const client=nullptr) const

```

Create a new [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) on a server by copying all the data of this [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace).

**Parameters**:

- [ansys::dpf::Client](classansys-dpf-client.md#classansys-dpf-client) const \*const **client** = nullptr : \[in\] [Client](classansys-dpf-client.md#classansys-dpf-client) instance designating the IP, port and protocol to use.

**Return type**: LabelSpace

<a id="classansys-dpf-labelspace-1a02a19ef066b7070148398a794cce2f62"></a>

### Function mergeWith

![](https://img.shields.io/badge/-public-brightgreen "public")

```cpp
void ansys::dpf::LabelSpace::mergeWith(ansys::dpf::LabelSpace const other)

```

Inserts all labels and ids of other in this.

**Parameters**:

- [ansys::dpf::LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace) const **other**

**Return type**: void

## Public static functions

<a id="classansys-dpf-labelspace-1a50fe673ff484fd698d174a07ba8f74c4"></a>

### Function emptyLabelSpace

![](https://img.shields.io/badge/-public-brightgreen "public")![](https://img.shields.io/badge/-static-lightgrey "static")

```cpp
static LabelSpace ansys::dpf::LabelSpace::emptyLabelSpace()

```

Create an empty [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace)**Returns**:

Empty [LabelSpace](classansys-dpf-labelspace.md#classansys-dpf-labelspace)

**Return type**: LabelSpace