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

# Class ansys::dpf::Field

![][C++]
![][public]

Data for an entity.

The field is the main simulation data container. In numerical simulations, results data are defined by values associated to entities (scoping), and these entities are a subset of a model (support). In DPF, field data is always associated to its scoping and support, making the field a self-describing piece of data. A field is also defined by its dimensionnality, unit, location... A field can for example, describe a displacement vector or norm, stresses and strains tensors, stresses and strains equivalent, min max over time of any result... It can be defined on a complete model or just on certain entities of the model thanks to its scoping. The data is stored as a vector of double values and each elementary entity has a number of components (thanks to the dimensionality, a displacement will have 3 components, a symmetrical stress matrix 6...)

**Inherits from**:

* [ansys::dpf::DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md)

## Members

* [addStringProperty](#classansys-dpf-field-1afe00866305c1af63e4a6114aafe0c7ad)
* [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aea34d37e0c080126eff70db34bf46597)
* [cloneToCustomTypeField](#classansys-dpf-field-1a76080a2fc73427169d0cb8f858d585c1)
* [cloneToField](#classansys-dpf-field-1ad7dbbe599698d4f11f40c815399f74e1)
* [cloneToPropertyField](#classansys-dpf-field-1a5770853a69bd98d4c4555338f3ab3f15)
* [createFieldWithTransformation](#classansys-dpf-field-1a6770fd347138639cf36ff4a58d6b527b)
* [data](#classansys-dpf-field-1a0967a8c6cee105a679dd1151a5d41004)
* [data](#classansys-dpf-field-1ad435429e8f1b152c7b4dad665665d9a4)
* [dataPointer](#classansys-dpf-field-1a47656e1ead80a6f2cac7c21266429212)
* [dataSize](#classansys-dpf-field-1a9bb7ac154ee6720cbb98b1c09e056942)
* [deep\_copy](#classansys-dpf-field-1ad91f3c235727ec55359488edd877ba9f)
* [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9977945710983bc03d2940fa007847b2)
* [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a39cd546c42518e2332be8f287db95459)
* [emptyField](#classansys-dpf-field-1a5b60dee96313f0f9791c11e1c7f58d5b)
* [entityData](#classansys-dpf-field-1a1312be4b895a62a391eb66865897d27c)
* [entityData](#classansys-dpf-field-1a025c29d3369376e0b22bcfb098a12776)
* [entityDataById](#classansys-dpf-field-1a50ed01d59770f646c41777d496e0ff9c)
* [entityDataById](#classansys-dpf-field-1a076c79e9088dc22be2e2a5ccb23aa683)
* [entityId](#classansys-dpf-field-1ad183afaa6ffbe34608e271e2c2c05f86)
* [Field](#classansys-dpf-field-1a5b349cc76039499cc2e45a4b59ff391c)
* [Field](#classansys-dpf-field-1a1a7812deadb92b60a8ad382111793e55)
* [Field](#classansys-dpf-field-1a613eb66562508f1a4bf9d60cbda5f51e)
* [Field](#classansys-dpf-field-1abf1d82af297ab49ec938a14f150cc944)
* [Field](#classansys-dpf-field-1a5db1f40d3cdd081054924a3e931130be)
* [fieldDefinition](#classansys-dpf-field-1a860e65caa16f612746ad116429282fd3)
* [fillCursor](#classansys-dpf-field-1a96f5eeb13fb81117d3a096e5da245eab)
* [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a968afd9daa0b0f13b65a2ac61369d73a)
* [getData](#classansys-dpf-field-1a3acedce4650d3f5671aa1dec3bba92ad)
* [getHeaderAsDataTree](#classansys-dpf-field-1a1cc58effe3891d4767c6b92c4b745c65)
* [getStringProperty](#classansys-dpf-field-1ad6b1721493b8ecb05ee4b49729422cb0)
* [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a1a5634202c15404b6b24e8f50e51cb66)
* [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ae198f89868d85c7db6dc1a934a1d3c15)
* [identicalPointers](#classansys-dpf-field-1a89f7fdf190bfa038716dfe935de0600f)
* [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1a9f9789ff61cc9d400a2a344830706b73)
* [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1aa64d5f8fcd7d85ad6ebf708494dbefd7)
* [name](#classansys-dpf-field-1a64744679ebb47624268eb77552dac2c1)
* [numberOfComponents](#classansys-dpf-field-1a70f7cda2d633297489b91de6761fd625)
* [numberOfElementaryData](#classansys-dpf-field-1aad232d58b75a9171de077b48865ef317)
* [numberOfElementaryDataByEntityId](#classansys-dpf-field-1aacac972372720f98b3ae69c296e80c5c)
* [numberOfElementaryDataByEntityIndex](#classansys-dpf-field-1ae1f8f67e890a35211cbc6b260598731c)
* [numberOfEntities](#classansys-dpf-field-1aad1f933384be1117a1338c0563cdefc0)
* [operator=](#classansys-dpf-field-1a3cedbbb5ad9cf1e8ee8a99ddb537c5c1)
* [operator=](#classansys-dpf-field-1a19e14878bec337b8a2ae8b5dcfc6b108)
* [push\_back](#classansys-dpf-field-1a5b717ed309ddf287134905f71ada833b)
* [push\_back](#classansys-dpf-field-1aae349d3de14b42f8b238f194db139fbc)
* [push\_back](#classansys-dpf-field-1ab387a8da1a2dc0ea0f94ba7c9cc4419f)
* [reserve](#classansys-dpf-field-1a3ac63a716581db77e88fa898befb1139)
* [resize](#classansys-dpf-field-1a83962ecd81cbcbf54fde2d101ec01106)
* [resizeDataPointer](#classansys-dpf-field-1a0f6abc999f38f54dfeaa144e996d3830)
* [scoping](#classansys-dpf-field-1aa16920741c1432c16e46ec6da26b3f04)
* [setData](#classansys-dpf-field-1a9f7828d92496843cc5f15ee9e32f6c4a)
* [setData](#classansys-dpf-field-1ab53cf7a45c6c86b630674a1ee8935612)
* [setDataPointer](#classansys-dpf-field-1ae41503c5a4a91ae422b359234fb30363)
* [setDataPointer](#classansys-dpf-field-1a9079f65aeb2e8b685d554f83826d45b8)
* [setFieldDefinition](#classansys-dpf-field-1a471c3f541458acc9c05dfb019a99abb3)
* [setHeaderAsDataTree](#classansys-dpf-field-1a4bb1c90dba9d0d32c370aa9d4b74fe84)
* [setName](#classansys-dpf-field-1a79553d0764c52a5b8162c3ba4e61b97b)
* [setScoping](#classansys-dpf-field-1a5220cacdfcd50fca2d5108734e1432df)
* [setSupport](#classansys-dpf-field-1ab71f825765a7ce1b37373443917ec23e)
* [setSupport](#classansys-dpf-field-1a14d300919db7ae24a917af9e1262cea3)
* [setSupport](#classansys-dpf-field-1ae846597f402a69d4d78d5c8b5e80d219)
* [support](#classansys-dpf-field-1a773481e9f7efb04d74c72be914b317d6)
* [\~DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpftypes.md#classansys-dpf-dpftypes-1ab7c83b6ea160c2b115e056f6c312112f)
* [\~Field](#classansys-dpf-field-1ad4e2524e104248f824921d6755daa36a)

## Friends

## Public functions

### Function Field

![][public]

```cpp theme={null}
ansys::dpf::Field::Field(int reserved_number_of_entity=0, const std::vector< int > &dimensions={ 1 }, const Location &loc=locations::nodal)
```

Create a group of data with given dimensions and locations.

**Parameters**:

* int **reserved\_number\_of\_entity** = 0 : \[in] Number of entities.
* const std::vector\< int > & **dimensions** = \{ 1 } : \[in] Dimension of each entity.
* const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) & **loc** = [locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-locations.md#structansys-dpf-locations-1aa4e1967b0838d8597200c606c8564d29) : \[in] [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) of entities.

**Return type**:

### Function Field

![][public]

```cpp theme={null}
ansys::dpf::Field::Field(Client const *const client, int reserved_number_of_entity=0, const std::vector< int > &dimensions={ 1 }, const Location &loc=locations::nodal)
```

Create a group of data with given dimensions and locations on a server.

**Parameters**:

* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] Remote client.
* int **reserved\_number\_of\_entity** = 0 : \[in] Number of entities.
* const std::vector\< int > & **dimensions** = \{ 1 } : \[in] Dimension of each entity.
* const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) & **loc** = [locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-locations.md#structansys-dpf-locations-1aa4e1967b0838d8597200c606c8564d29) : \[in] [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) of entities.

**Return type**:

### Function Field

![][public]

```cpp theme={null}
ansys::dpf::Field::Field(int id, Client const *const client)
```

Retrieve an existing instance of [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) on a server.

**Parameters**:

* int **id**: \[in] Id of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) object on the server's database.
* [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client**: \[in] [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) instance designating the IP, port and protocol to use.

**Return type**:

### Function \~Field

![][public]

```cpp theme={null}
virtual ansys::dpf::Field::~Field()
```

**Return type**:

### Function Field

![][public]

```cpp theme={null}
ansys::dpf::Field::Field(Field const &)
```

**Parameters**:

* Field const &

**Return type**:

### Function Field

![][public]

```cpp theme={null}
ansys::dpf::Field::Field(Field &&) noexcept
```

**Parameters**:

* Field &&

**Return type**:

### Function operator=

![][public]

```cpp theme={null}
Field & ansys::dpf::Field::operator=(Field const &)
```

**Parameters**:

* Field const &

**Return type**: Field &

### Function operator=

![][public]

```cpp theme={null}
Field & ansys::dpf::Field::operator=(Field &&) noexcept
```

**Parameters**:

* Field &&

**Return type**: Field &

### Function identicalPointers

![][public]
![][const]

```cpp theme={null}
bool ansys::dpf::Field::identicalPointers(Field const &f) const
```

Compare field with input field f.

**Parameters**:

* Field const & **f**: \[in] [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) with which to compare.

**Return type**: bool

### Function numberOfComponents

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::numberOfComponents() const
```

**Returns**:

Number of components in the elementary data.

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function numberOfEntities

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::numberOfEntities() const
```

**Returns**:

Number of entities in the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md). Only implemented for in process udage. For gRPC usage, use [scoping()](#classansys-dpf-field-1aa16920741c1432c16e46ec6da26b3f04).size().

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function numberOfElementaryData

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::numberOfElementaryData() const
```

**Returns**:

Number of elementary data (size = number of components) contained in the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function numberOfElementaryDataByEntityIndex

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::numberOfElementaryDataByEntityIndex(dp_int entityIndex) const
```

**Returns**:

Number of elementary data by entity index.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **entityIndex**

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function numberOfElementaryDataByEntityId

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::numberOfElementaryDataByEntityId(dp_int entityId) const
```

**Returns**:

Number of elementary data by entity id.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **entityId**

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function dataSize

![][public]
![][const]

```cpp theme={null}
dp_int ansys::dpf::Field::dataSize() const
```

**Returns**:

Size of the data container.

**Return type**: [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0)

### Function name

![][public]
![][const]

```cpp theme={null}
std::string ansys::dpf::Field::name() const
```

**Returns**:

Name of [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Return type**: std::string

### Function setName

![][public]

```cpp theme={null}
void ansys::dpf::Field::setName(const std::string &name)
```

Set name of [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* const std::string & **name**: \[in] New name.

**Return type**: void

### Function addStringProperty

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::addStringProperty(const char *key, const char *sProp) const
```

Add property of given key and string value. If key is already set, then value is updated with sProp.

**Parameters**:

* const char \* **key**
* const char \* **sProp**

**Return type**: void

### Function getStringProperty

![][public]
![][const]

```cpp theme={null}
bool ansys::dpf::Field::getStringProperty(const char *key, std::string &sProp) const
```

**Returns**:

True if property of given key is set. Sprop is updated with the property's value.

**Parameters**:

* const char \* **key**
* std::string & **sProp**

**Return type**: bool

### Function data

![][public]
![][const]

```cpp theme={null}
dp_double *const ansys::dpf::Field::data(int &size) const
```

**Returns**:

Pointer to data array.

**Parameters**:

* int & **size**: \[out] Size of returned data array.

**Return type**: [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) \*const

### Function data

![][public]
![][const]

```cpp theme={null}
DpfVector< double > ansys::dpf::Field::data() const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array.

**Return type**: DpfVector\< double >

### Function dataPointer

![][public]
![][const]

```cpp theme={null}
DpfVector< int > ansys::dpf::Field::dataPointer() const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data pointer array.

**Return type**: DpfVector\< int >

### Function getData

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::getData(std::vector< dp_double > &data_to_fill) const
```

Copy the data for all entities in a vector of double.

**Parameters**:

* std::vector\< [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) > & **data\_to\_fill**: \[out] Vector of data for all entities.

**Return type**: void

### Function entityData

![][public]
![][const]

```cpp theme={null}
dp_double *const ansys::dpf::Field::entityData(dp_index entity_index, dp_int &size) const
```

**Returns**:

Pointer to data array of an entity, by index.

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **entity\_index**: \[in] Index of entity for which to get data.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) & **size**: \[out] Size of returned data array.

**Return type**: [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) \*const

### Function entityData

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::entityData(dp_index entity_index, DpfVector< double > &data) const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array of an entity, by index.

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **entity\_index**: \[in] Index of entity for which to get data.
* DpfVector\< double > & **data**: \[out] Pointer to the data.

**Return type**: void

### Function entityDataById

![][public]
![][const]

```cpp theme={null}
dp_double *const ansys::dpf::Field::entityDataById(dp_id entity_id, dp_int &size) const
```

**Returns**:

Pointer to data array of an entity, by id.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Id of entity for which to get data.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) & **size**: \[out] Size of returned data array.

**Return type**: [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) \*const

### Function entityDataById

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::entityDataById(dp_id entity_id, DpfVector< double > &data) const
```

**Returns**:

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-dpfvector.md) of data array of an entity, by id.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Id of entity for which to get data.
* DpfVector\< double > & **data**: \[out] Pointer to the data.

**Return type**: void

### Function entityId

![][public]
![][const]

```cpp theme={null}
dp_id ansys::dpf::Field::entityId(dp_index entity_index) const
```

**Returns**:

Entity id corresponding to a given entity index

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **entity\_index**: \[in] Index of entity for which to get Id.

**Return type**: [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e)

### Function scoping

![][public]
![][const]

```cpp theme={null}
Scoping ansys::dpf::Field::scoping() const
```

**Returns**:

[Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md) of the field.

**Return type**: [Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md)

### Function fieldDefinition

![][public]
![][const]

```cpp theme={null}
FieldDefinition ansys::dpf::Field::fieldDefinition() const
```

**Returns**:

[FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fielddefinition.md) of the field.

**Return type**: [FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fielddefinition.md)

### Function support

![][public]
![][const]

```cpp theme={null}
Support ansys::dpf::Field::support() const
```

**Returns**:

[Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) of the field.

**Return type**: Support

### Function setFieldDefinition

![][public]

```cpp theme={null}
void ansys::dpf::Field::setFieldDefinition(FieldDefinition const &f)
```

Set the [FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fielddefinition.md).

**Parameters**:

* [FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fielddefinition.md) const & **f**

**Return type**: void

### Function setScoping

![][public]

```cpp theme={null}
void ansys::dpf::Field::setScoping(ansys::dpf::Scoping const &s)
```

set the [Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md) of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [ansys::dpf::Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-scoping.md) const & **s**

**Return type**: void

### Function setData

![][public]

```cpp theme={null}
void ansys::dpf::Field::setData(std::vector< double > const &data)
```

Set the data of the field.

**Parameters**:

* std::vector\< double > const & **data**: \[in] Vector of data.

**Return type**: void

### Function setData

![][public]

```cpp theme={null}
void ansys::dpf::Field::setData(double const *const data, int size)
```

Set the data of the field.

**Parameters**:

* double const \*const **data**: \[in] List of data.
* int **size**: \[in] Size of list.

**Return type**: void

### Function setDataPointer

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::setDataPointer(std::vector< int > &data) const
```

Set the data pointer of the field.

**Parameters**:

* std::vector\< int > & **data**: \[in] Vector of data.

**Return type**: void

### Function setDataPointer

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::setDataPointer(int const *const data, int size) const
```

Set the data pointer of the field.

**Parameters**:

* int const \*const **data**: \[in] List of data.
* int **size**: \[in] Size of list.

**Return type**: void

### Function setSupport

![][public]

```cpp theme={null}
void ansys::dpf::Field::setSupport(ansys::dpf::Support const &s)
```

Set the support of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [ansys::dpf::Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-support.md) const & **s**: \[in] [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) to support.

**Return type**: void

### Function setSupport

![][public]

```cpp theme={null}
void ansys::dpf::Field::setSupport(ansys::dpf::TimeFreqSupport const &s)
```

Set the support of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [ansys::dpf::TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-timefreqsupport.md) const & **s**: \[in] [TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-timefreqsupport.md) to support.

**Return type**: void

### Function setSupport

![][public]

```cpp theme={null}
void ansys::dpf::Field::setSupport(ansys::dpf::MeshedRegion const &s)
```

Set the support of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [ansys::dpf::MeshedRegion](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-meshedregion.md) const & **s**: \[in] [MeshedRegion](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-meshedregion.md) to support.

**Return type**: void

### Function reserve

![][public]

```cpp theme={null}
void ansys::dpf::Field::reserve(dp_int number_of_entities, dp_int overall_size=0)
```

Reserve the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md). Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities**: \[in] Number of entities.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **overall\_size** = 0 : \[in] Total size of entity data.

**Return type**: void

### Function resize

![][public]

```cpp theme={null}
void ansys::dpf::Field::resize(dp_int number_of_entities, dp_int overall_size)
```

Reserve the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities**: \[in] Number of entities.
* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **overall\_size**: \[in] Total size of entity data.

**Return type**: void

### Function resizeDataPointer

![][public]

```cpp theme={null}
void ansys::dpf::Field::resizeDataPointer(dp_int number_of_entities)
```

\[in] Number of entities

Resize the dataPointer array.

**Parameters**:

* [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a60d181a1f9d29cc7cc38b25dac4401f0) **number\_of\_entities**

**Return type**: void

### Function fillCursor

![][public]
![][const]

```cpp theme={null}
void ansys::dpf::Field::fillCursor(dp_index index, FieldCursor &f) const
```

Get data at a given index.

**Parameters**:

* [dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1a417548d1b705a9ba54ba9429afe68920) **index**: \[in] Index of entity for which to get data.
* [FieldCursor](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fieldcursor.md) & **f**: \[out] [FieldCursor](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-fieldcursor.md) with which to contain data.

**Return type**: void

### Function push\_back

![][public]

```cpp theme={null}
void ansys::dpf::Field::push_back(dp_id entity_id, std::vector< dp_double > const &values)
```

Push back the entity data.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Index of entity for which to push data.
* std::vector\< [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) > const & **values**: \[in] Vector of data for entity.

**Return type**: void

### Function push\_back

![][public]

```cpp theme={null}
void ansys::dpf::Field::push_back(dp_id entity_id, const dp_double *values, int size)
```

Push back the entity data.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Index of entity for which to push data.
* const [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) \* **values**: \[in] Ptr on data for entity.
* int **size**: \[in] Number of entities.

**Return type**: void

### Function push\_back

![][public]

```cpp theme={null}
void ansys::dpf::Field::push_back(dp_id entity_id, dp_double *values, int size)
```

Push back the entity data.

**Parameters**:

* [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1ab4574c9af3f2bb8011da7d1f4c8da20e) **entity\_id**: \[in] Index of entity for which to push data.
* [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/namespaceansys-dpf.md#namespaceansys-dpf-1acb480013bfed185b5e34a0bdcb0e3790) \* **values**: \[in] Ptr on data for entity.
* int **size**: \[in] Number of entities.

**Return type**: void

### Function deep\_copy

![][public]
![][const]

```cpp theme={null}
Field ansys::dpf::Field::deep_copy(ansys::dpf::Client const *const client=nullptr) const
```

Make a deep copy on a given client.

**Parameters**:

* [ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client** = nullptr : \[in] Remote client

**Return type**: Field

### Function cloneToCustomTypeField

![][public]
![][const]

```cpp theme={null}
CustomTypeField ansys::dpf::Field::cloneToCustomTypeField(ansys::dpf::Client const *const client=nullptr, bool const copy_ids=true, bool const copy_data_ptr=true, bool const copy_support=true) const
```

Creates a new custom type field object from current field without its data.

**Parameters**:

* [ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client** = nullptr : \[in] Remote client
* bool const **copy\_ids** = true : \[in] Boolean to decide if scoping ids are to be copied
* bool const **copy\_data\_ptr** = true : \[in] Boolean to decide if data pointer is to be copied
* bool const **copy\_support** = true : \[in] Boolean to decide if the support reference is to be copied

**Return type**: [CustomTypeField](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-customtypefield.md)

### Function cloneToField

![][public]
![][const]

```cpp theme={null}
Field ansys::dpf::Field::cloneToField(ansys::dpf::Client const *const client=nullptr, bool const copy_ids=true, bool const copy_data_ptr=true, bool const copy_support=true) const
```

Creates a new field object from current field without its data.

**Parameters**:

* [ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client** = nullptr : \[in] Remote client
* bool const **copy\_ids** = true : \[in] Boolean to decide if scoping ids are to be copied
* bool const **copy\_data\_ptr** = true : \[in] Boolean to decide if data pointer is to be copied
* bool const **copy\_support** = true : \[in] Boolean to decide if the support reference is to be copied

**Return type**: Field

### Function cloneToPropertyField

![][public]
![][const]

```cpp theme={null}
PropertyField ansys::dpf::Field::cloneToPropertyField(ansys::dpf::Client const *const client=nullptr, bool const copy_ids=true, bool const copy_data_ptr=true, bool const copy_support=true) const
```

Creates a new property field object from current field without its data.

**Parameters**:

* [ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-client.md) const \*const **client** = nullptr : \[in] Remote client
* bool const **copy\_ids** = true : \[in] Boolean to decide if scoping ids are to be copied
* bool const **copy\_data\_ptr** = true : \[in] Boolean to decide if data pointer is to be copied
* bool const **copy\_support** = true : \[in] Boolean to decide if the support reference is to be copied

**Return type**: [PropertyField](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-propertyfield.md)

### Function getHeaderAsDataTree

![][public]
![][const]

```cpp theme={null}
DataTree ansys::dpf::Field::getHeaderAsDataTree() const
```

Get the header of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) as a [DataTree](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datatree.md) object.

**Return type**: DataTree

### Function setHeaderAsDataTree

![][public]

```cpp theme={null}
void ansys::dpf::Field::setHeaderAsDataTree(const DataTree &datatree)
```

Set the header of the field using a [DataTree](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-datatree.md) object.

**Parameters**:

* const DataTree & **datatree**

**Return type**: void

## Public static functions

### Function emptyField

![][public]
![][static]

```cpp theme={null}
static Field ansys::dpf::Field::emptyField()
```

Create an empty [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).
**Returns**:

Empty [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Return type**: Field

### Function createFieldWithTransformation

![][public]
![][static]

```cpp theme={null}
static Field ansys::dpf::Field::createFieldWithTransformation(Workflow transformation_wf, int reserved_number_of_entity=0, const std::vector< int > &dimensions={ 1 }, const Location &loc=locations::nodal, std::string const &input_name_to_connect="input_field", std::string const &output_name_to_eval="transformed_field")
```

Instantiate a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) with Transformation. For each call to a getter, the workflow in input is connected this [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) to input\_name\_to\_connect and the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md) output in output\_name\_to\_eval is used as the getter instance.

**Parameters**:

* Workflow **transformation\_wf**: \[in] Transformation workflow.
* int **reserved\_number\_of\_entity** = 0 : \[in] Number of entities.
* const std::vector\< int > & **dimensions** = \{ 1 } : \[in] Dimension of each entity.
* const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-location.md) & **loc** = [locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/structansys-dpf-locations.md#structansys-dpf-locations-1aa4e1967b0838d8597200c606c8564d29)
* std::string const & **input\_name\_to\_connect** = "input\_field" : \[in] Name of the input of the workflow to connect. Should take a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).
* std::string const & **output\_name\_to\_eval** = "transformed\_field" : \[in] Name of the output of the workflow to evaluate. Should return a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/api-reference/classansys-dpf-field.md).

**Return type**: Field

[C++]: https://img.shields.io/badge/language-C%2B%2B-blue "C++"

[const]: https://img.shields.io/badge/-const-lightblue "const"

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

[static]: https://img.shields.io/badge/-static-lightgrey "static"
