> ## 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::Field Class Reference

Data for an entity.

`#include <dpf_api.h>`

Inheritance diagram for ansys::dpf::Field:

![](https://mintcdn.com/synopsys-00a47cbc/Srh1_f--TdKCLyqD/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.png?fit=max\&auto=format\&n=Srh1_f--TdKCLyqD\&q=85\&s=70ec601f93042734e56ea2f4b4b324f0)

## Public Member Functions

| Type | Name |
| - | - |
| | [Field](#a5b349cc76039499cc2e45a4b59ff391c) (int reserved\_number\_of\_entity=0, const std::vector\< int > \&dimensions=\{ 1 }, const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1Location.md) \&loc=[locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1locations.md#aa4e1967b0838d8597200c606c8564d29)) |
| | [Field](#a1a7812deadb92b60a8ad382111793e55) ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) const \*const client, int reserved\_number\_of\_entity=0, const std::vector\< int > \&dimensions=\{ 1 }, const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1Location.md) \&loc=[locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1locations.md#aa4e1967b0838d8597200c606c8564d29)) |
| | [Field](#a613eb66562508f1a4bf9d60cbda5f51e) (int id, [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) const \*const client) |
| | **Field** ([Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) const &) |
| | **Field** ([Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) &&) noexcept |
| [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) & | **operator=** ([Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) const &) |
| [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) & | **operator=** ([Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) &&) noexcept |
| bool | [identicalPointers](#a89f7fdf190bfa038716dfe935de0600f) ([Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) const \&f) const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [numberOfComponents](#a70f7cda2d633297489b91de6761fd625) () const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [numberOfEntities](#aad1f933384be1117a1338c0563cdefc0) () const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [numberOfElementaryData](#aad232d58b75a9171de077b48865ef317) () const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [numberOfElementaryDataByEntityIndex](#ae1f8f67e890a35211cbc6b260598731c) ([dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) entityIndex) const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [numberOfElementaryDataByEntityId](#aacac972372720f98b3ae69c296e80c5c) ([dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) [entityId](#ad183afaa6ffbe34608e271e2c2c05f86)) const |
| [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) | [dataSize](#a9bb7ac154ee6720cbb98b1c09e056942) () const |
| std::string | [name](#a64744679ebb47624268eb77552dac2c1) () const |
| void | [setName](#a79553d0764c52a5b8162c3ba4e61b97b) (const std::string &[name](#a64744679ebb47624268eb77552dac2c1)) |
| void | [addStringProperty](#afe00866305c1af63e4a6114aafe0c7ad) (const char \*key, const char \*sProp) const |
| bool | [getStringProperty](#ad6b1721493b8ecb05ee4b49729422cb0) (const char \*key, std::string \&sProp) const |
| [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) \*const | [data](#a0967a8c6cee105a679dd1151a5d41004) (int \&size) const |
| [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md)\< double > | [data](#ad435429e8f1b152c7b4dad665665d9a4) () const |
| [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md)\< int > | [dataPointer](#a47656e1ead80a6f2cac7c21266429212) () const |
| void | [getData](#a3acedce4650d3f5671aa1dec3bba92ad) (std::vector\< [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) > \&data\_to\_fill) const |
| [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) \*const | [entityData](#a1312be4b895a62a391eb66865897d27c) ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) entity\_index, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) \&size) const |
| void | [entityData](#a025c29d3369376e0b22bcfb098a12776) ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) entity\_index, [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md)\< double > &[data](#a0967a8c6cee105a679dd1151a5d41004)) const |
| [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) \*const | [entityDataById](#a50ed01d59770f646c41777d496e0ff9c) ([dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) entity\_id, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) \&size) const |
| void | [entityDataById](#a076c79e9088dc22be2e2a5ccb23aa683) ([dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) entity\_id, [DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md)\< double > &[data](#a0967a8c6cee105a679dd1151a5d41004)) const |
| [dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) | [entityId](#ad183afaa6ffbe34608e271e2c2c05f86) ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) entity\_index) const |
| [Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Scoping.md) | [scoping](#aa16920741c1432c16e46ec6da26b3f04) () const |
| [FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldDefinition.md) | [fieldDefinition](#a860e65caa16f612746ad116429282fd3) () const |
| [Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Support.md) | [support](#a773481e9f7efb04d74c72be914b317d6) () const |
| void | [setFieldDefinition](#a471c3f541458acc9c05dfb019a99abb3) ([FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldDefinition.md) const \&f) |
| void | [setScoping](#a5220cacdfcd50fca2d5108734e1432df) ([ansys::dpf::Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Scoping.md) const \&s) |
| void | [setData](#a9f7828d92496843cc5f15ee9e32f6c4a) (std::vector\< double > const &[data](#a0967a8c6cee105a679dd1151a5d41004)) |
| void | [setData](#ab53cf7a45c6c86b630674a1ee8935612) (double const \*const [data](#a0967a8c6cee105a679dd1151a5d41004), int size) |
| void | [setDataPointer](#ae41503c5a4a91ae422b359234fb30363) (std::vector\< int > &[data](#a0967a8c6cee105a679dd1151a5d41004)) const |
| void | [setDataPointer](#a9079f65aeb2e8b685d554f83826d45b8) (int const \*const [data](#a0967a8c6cee105a679dd1151a5d41004), int size) const |
| void | [setSupport](#ab71f825765a7ce1b37373443917ec23e) ([ansys::dpf::Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Support.md) const \&s) |
| void | [setSupport](#a14d300919db7ae24a917af9e1262cea3) ([ansys::dpf::TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1TimeFreqSupport.md) const \&s) |
| void | [setSupport](#ae846597f402a69d4d78d5c8b5e80d219) ([ansys::dpf::MeshedRegion](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1MeshedRegion.md) const \&s) |
| void | [reserve](#a3ac63a716581db77e88fa898befb1139) ([dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) number\_of\_entities, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) overall\_size=0) |
| void | [resize](#a83962ecd81cbcbf54fde2d101ec01106) ([dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) number\_of\_entities, [dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) overall\_size) |
| void | [resizeDataPointer](#a0f6abc999f38f54dfeaa144e996d3830) ([dp\_int](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a60d181a1f9d29cc7cc38b25dac4401f0) number\_of\_entities) \[in] Number of entities |
| void | [fillCursor](#a96f5eeb13fb81117d3a096e5da245eab) ([dp\_index](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#a417548d1b705a9ba54ba9429afe68920) index, [FieldCursor](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldCursor.md) \&f) const |
| void | [push\_back](#a5b717ed309ddf287134905f71ada833b) ([dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) entity\_id, std::vector\< [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) > const \&values) |
| void | [push\_back](#aae349d3de14b42f8b238f194db139fbc) ([dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) entity\_id, const [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) \*values, int size) |
| void | [push\_back](#ab387a8da1a2dc0ea0f94ba7c9cc4419f) ([dp\_id](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#ab4574c9af3f2bb8011da7d1f4c8da20e) entity\_id, [dp\_double](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/namespaceansys_1_1dpf#acb480013bfed185b5e34a0bdcb0e3790) \*values, int size) |
| [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) | [deep\_copy](#aab82032844ca177841de8c3011dab297) ([ansys::dpf::Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) const \*const client) const |
| [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) | [deep\_copy](#aa838791f5e7d7a272b9fbe441d7e4a4f) () const |

> [accordion] Public Member Functions inherited from ansys::dpf::DpfTypes
>
> Public Member Functions inherited from [ansys::dpf::DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md)
>
> | Type | Name |
> | - | - |
> | virtual bool | [empty](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a39cd546c42518e2332be8f287db95459) () const |
> | virtual bool | [hasInternalObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#ae198f89868d85c7db6dc1a934a1d3c15) () const |
> | virtual std::string | [describe](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a9977945710983bc03d2940fa007847b2) () const |
> | so::API const \* | [callAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#aea34d37e0c080126eff70db34bf46597) () const |
> | bool | [isOnCommonAPI](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a9f9789ff61cc9d400a2a344830706b73) () const |
> | bool | [getClient](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a968afd9daa0b0f13b65a2ac61369d73a) ([Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) \&client) const |
> | bool | [hasBeenMovedLocally](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#a1a5634202c15404b6b24e8f50e51cb66) () const |
> | bool | [isSameObject](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md#aa64d5f8fcd7d85ad6ebf708494dbefd7) ([DpfTypes](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfTypes.md) const \&rhs) const |

## Static Public Member Functions

| Type | Name |
| - | - |
| static [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) | [emptyField](#a5b60dee96313f0f9791c11e1c7f58d5b) () |
| static [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) | [createFieldWithTransformation](#a6770fd347138639cf36ff4a58d6b527b) ([Workflow](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Workflow.md) transformation\_wf, int reserved\_number\_of\_entity=0, const std::vector\< int > \&dimensions=\{ 1 }, const [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1Location.md) \&loc=[locations::nodal](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1locations.md#aa4e1967b0838d8597200c606c8564d29), std::string const \&input\_name\_to\_connect="input\_field", std::string const \&output\_name\_to\_eval="transformed\_field") |

## Detailed Description

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

**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), [ModelTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ModelTest_8cpp-example.md), [OperatorsApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/OperatorsApis_8cpp-example.md), [ResultTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ResultTest_8cpp-example.md), and [WorkflowExamples.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/WorkflowExamples_8cpp-example.md).

## Constructor & Destructor Documentation

### Field() \[1/3]

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | reserved\_number\_of\_entity | Number of entities. |
| \[in] | dimensions | Dimension of each entity. |
| \[in] | loc | [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1Location.md) of entities. |

### Field() \[2/3]

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | client | Remote client. |
| \[in] | reserved\_number\_of\_entity | Number of entities. |
| \[in] | dimensions | Dimension of each entity. |
| \[in] | loc | [Location](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/structansys_1_1dpf_1_1Location.md) of entities. |

### Field() \[3/3]

```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/2025-r1/classansys_1_1dpf_1_1Field.md) on a server. \


**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | id | Id of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) object on the server's database. |
| \[in] | client | [Client](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Client.md) instance designating the IP, port and protocol to use. |

## Member Function Documentation

### addStringProperty()

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

### createFieldWithTransformation()

```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"
)
```

`static`

Instantiate a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.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/2025-r1/classansys_1_1dpf_1_1Field.md) to input\_name\_to\_connect and the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) output in output\_name\_to\_eval is used as the getter instance.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | transformation\_wf | Transformation workflow. |
| \[in] | reserved\_number\_of\_entity | Number of entities. |
| \[in] | dimensions | Dimension of each entity. |
| \[in] | input\_name\_to\_connect | Name of the input of the workflow to connect. Should take a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md). |
| \[in] | output\_name\_to\_eval | Name of the output of the workflow to evaluate. Should return a [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md). |

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

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

**Returns**

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md) of data array.

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

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

**Returns**

Pointer to data array.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[out] | size | Size of returned data array. |

**Examples**

[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), [ModelTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ModelTest_8cpp-example.md), and [OperatorsApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/OperatorsApis_8cpp-example.md).

### dataPointer()

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

**Returns**

[DpfVector](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1DpfVector.md) of data pointer array.

### dataSize()

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

**Returns**

Size of the data container.

**Examples**

[DataExport.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/DataExport_8cpp-example.md), and [ModelTest.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/ModelTest_8cpp-example.md).

### deep\_copy() \[1/2]

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

Make a deep copy locally.

### deep\_copy() \[2/2]

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

Make a deep copy on a given client.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | client | Remote client |

### emptyField()

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

`static`

Create an empty [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md).

**Returns**

Empty [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md).

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

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_index | Index of entity for which to get data. |
| \[out] | size | Size of returned data array. |

**Examples**

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

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

```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/2025-r1/classansys_1_1dpf_1_1DpfVector.md) of data array of an entity, by index.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_index | Index of entity for which to get data. |
| \[out] | data | Pointer to the data. |

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

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_id | Id of entity for which to get data. |
| \[out] | size | Size of returned data array. |

**Examples**

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

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

```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/2025-r1/classansys_1_1dpf_1_1DpfVector.md) of data array of an entity, by id.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_id | Id of entity for which to get data. |
| \[out] | data | Pointer to the data. |

### entityId()

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

**Returns**

Entity id corresponding to a given entity index

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_index | Index of entity for which to get Id. |

### fieldDefinition()

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

**Returns**

[FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldDefinition.md) of the field.

**Examples**

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

### fillCursor()

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

Get data at a given index.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | index | Index of entity for which to get data. |
| \[out] | f | [FieldCursor](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldCursor.md) with which to contain data. |

**Examples**

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

### getData()

```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**

| Direction | Name | Description |
| - | - | - |
| \[out] | data\_to\_fill | Vector of data for all entities. |

**Examples**

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

### getStringProperty()

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

### identicalPointers()

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

Compare field with input field f.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | f | [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) with which to compare. |

### name()

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

**Returns**

Name of [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md).

### numberOfComponents()

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

**Returns**

Number of components in the elementary data.

**Examples**

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

### numberOfElementaryData()

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

### numberOfElementaryDataByEntityId()

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

**Returns**

Number of elementary data by entity id.

### numberOfElementaryDataByEntityIndex()

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

**Returns**

Number of elementary data by entity index.

### numberOfEntities()

```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/2025-r1/classansys_1_1dpf_1_1Field.md). Only implemented for in process udage. For gRPC usage, use [scoping()](#aa16920741c1432c16e46ec6da26b3f04).size().

### push\_back() \[1/3]

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_id | Index of entity for which to push data. |
| \[in] | values | Ptr on data for entity. |
| \[in] | size | Number of entities. |

### push\_back() \[2/3]

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

Push back the entity data.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_id | Index of entity for which to push data. |
| \[in] | values | Ptr on data for entity. |
| \[in] | size | Number of entities. |

### push\_back() \[3/3]

```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**

| Direction | Name | Description |
| - | - | - |
| \[in] | entity\_id | Index of entity for which to push data. |
| \[in] | values | Vector of data for entity. |

**Examples**

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

### reserve()

```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/2025-r1/classansys_1_1dpf_1_1Field.md). Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | number\_of\_entities | Number of entities. |
| \[in] | overall\_size | Total size of entity data. |

### resize()

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | number\_of\_entities | Number of entities. |
| \[in] | overall\_size | Total size of entity data. |

### resizeDataPointer()

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

\[in] Number of entities

Resize the dataPointer array.

### scoping()

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

**Returns**

[Scoping](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Scoping.md) of the field.

**Examples**

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

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

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

Set the data of the field.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | data | List of data. |
| \[in] | size | Size of list. |

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

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

Set the data of the field.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | data | Vector of data. |

**Examples**

[DataApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/DataApis_8cpp-example.md), and [OperatorsApis.cpp](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/OperatorsApis_8cpp-example.md).

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

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

Set the data pointer of the field.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | data | List of data. |
| \[in] | size | Size of list. |

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

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

Set the data pointer of the field.

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | data | Vector of data. |

### setFieldDefinition()

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

Set the [FieldDefinition](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1FieldDefinition.md).

**Examples**

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

### setName()

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | name | New name. |

### setScoping()

```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/2025-r1/classansys_1_1dpf_1_1Scoping.md) of the [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md).

### setSupport() \[1/3]

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | s | [MeshedRegion](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1MeshedRegion.md) to support. |

### setSupport() \[2/3]

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | s | [Field](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Field.md) to support. |

**Examples**

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

### setSupport() \[3/3]

```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/2025-r1/classansys_1_1dpf_1_1Field.md).

**Parameters**

| Direction | Name | Description |
| - | - | - |
| \[in] | s | [TimeFreqSupport](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1TimeFreqSupport.md) to support. |

### support()

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

**Returns**

[Support](https://developer.synopsys.com/docs/dpf/dpf-cpp-client-library/2025-r1/classansys_1_1dpf_1_1Support.md) of the field.
