Skip to main content

DPF C++ Client Library 2024 R2

ansys::dpf::PropertyField Class Reference

Last update: 16.07.2025

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::PropertyField:
ansys::dpf::DpfTypes

Public Member Functions

 PropertyField (Client const *const client, dp_int number_of_entities=0, dp_int data_size=0)
 
 PropertyField (dp_int number_of_entities=0, dp_int data_size=0)
 
 PropertyField (int id, Client const *const client)
 
 PropertyField (PropertyField const &)
 
 PropertyField (PropertyField &&) noexcept
 
PropertyFieldoperator= (PropertyField const &)
 
PropertyFieldoperator= (PropertyField &&) noexcept
 
FieldDefinition fieldDefinition () const
 
void setFieldDefinition (FieldDefinition const &f)
 
std::string name () const
 
void setName (const std::string &name)
 
Location location () const
 
Scoping scoping () const
 
dp_int dataSize () const
 
dp_int numberOfComponents () const
 
dp_int numberOfElementaryData () const
 
void push_back (dp_id entity_id, std::vector< int > const &values)
 
void push_back (dp_id entity_id, const int *values, int size)
 
void push_back (dp_id entity_id, int *values, int size)
 
void setData (std::vector< int > const &data)
 
void setData (int const *const data, int size)
 
void setDataPointer (std::vector< int > const &data)
 
void setDataPointer (int *const data, int size)
 
void setScoping (ansys::dpf::Scoping &s)
 
const dp_intdataByIndex (dp_index entity_index, int &size) const
 
const dp_intdataById (dp_id entity_id, int &size) const
 
void fillCursor (dp_index index, PropFieldCursor &cursor) const
 
void getIds (std::vector< dp_id > &ids_to_fill) const
 
void getData (std::vector< dp_int > &values_to_fill) const
 
DpfVector< int > data () const
 
DpfVector< int > dataPointer () const
 
void entityData (dp_index entity_index, DpfVector< int > &data) const
 
void entityDataById (dp_id entity_id, DpfVector< int > &data) const
 
void reserve (dp_int number_of_entities, dp_int overall_size=0)
 
void resize (dp_int number_of_entities, dp_int overall_size)
 
PropertyField deep_copy (ansys::dpf::Client const *const client) const
 
PropertyField deep_copy () const
 
- Public Member Functions inherited from ansys::dpf::DpfTypes
virtual bool empty () const
 
virtual bool hasInternalObject () const
 
virtual std::string describe () const
 
so::API const * callAPI () const
 
bool isOnCommonAPI () const
 
bool getClient (Client &client) const
 
bool hasBeenMovedLocally () const
 
bool isSameObject (DpfTypes const &rhs) const
 

Static Public Member Functions

static PropertyField emptyPropertyField ()
 
static PropertyField createPropertyFieldWithTransformation (Workflow transformation_wf, int reserved_number_of_entity=0, int reserved_data_size=0, std::string const &input_name_to_connect="input_field", std::string const &output_name_to_eval="transformed_field")
 

Detailed Description

Holds Integral (int32) data describing a Property located on given entities (the Property Field's data is bounded with its scoping). Is the equivalent of the Field but with integral values data (and not double values).

Examples
DataApis.cpp, and ModelTest.cpp.

Constructor & Destructor Documentation

◆ PropertyField() [1/3]

ansys::dpf::PropertyField::PropertyField ( Client const *const  client,
dp_int  number_of_entities = 0,
dp_int  data_size = 0 
)

Create an empty property field with a client.

Parameters
[in]clientClient to create the property field on.
[in]number_of_entitiesNumber of entities.
[in]data_sizeReserved size of data.

◆ PropertyField() [2/3]

ansys::dpf::PropertyField::PropertyField ( dp_int  number_of_entities = 0,
dp_int  data_size = 0 
)

Create a property with number of entities and data size.

Parameters
[in]number_of_entitiesNumber of entities.
[in]data_sizeReserved size of data.

◆ PropertyField() [3/3]

ansys::dpf::PropertyField::PropertyField ( int  id,
Client const *const  client 
)

Retrieve an existing instance of PropertyField on a server.

Parameters
[in]idId of the Field object on the server's database.
[in]clientClient instance designating the IP, port and protocol to use.

Member Function Documentation

◆ createPropertyFieldWithTransformation()

static PropertyField ansys::dpf::PropertyField::createPropertyFieldWithTransformation ( Workflow  transformation_wf,
int  reserved_number_of_entity = 0,
int  reserved_data_size = 0,
std::string const &  input_name_to_connect = "input_field",
std::string const &  output_name_to_eval = "transformed_field" 
)
static

Instantiate a PropertyField with Transformation. For each call to a getter, the workflow in input is connected this PropertyField to input_name_to_connect and the PropertyField output in output_name_to_eval is used as the getter instance.

Parameters
[in]transformation_wfTransformation workflow.
[in]input_name_to_connectName of the input of the workflow to connect. Should take a Field.
[in]output_name_to_evalName of the output of the workflow to evaluate. Should return a Field.

◆ data()

DpfVector< int > ansys::dpf::PropertyField::data ( ) const
Returns
DpfVector of data array.

◆ dataById()

const dp_int * ansys::dpf::PropertyField::dataById ( dp_id  entity_id,
int &  size 
) const
Returns
Pointer to entity data given by id.
Parameters
[in]entity_idId of entity for which to get data.
[out]sizeSize of return data.

◆ dataByIndex()

const dp_int * ansys::dpf::PropertyField::dataByIndex ( dp_index  entity_index,
int &  size 
) const
Returns
Pointer to entity data given by index.
Parameters
[in]entity_indexIndex of entity for which to get data.
[out]sizeSize of return data.

◆ dataPointer()

DpfVector< int > ansys::dpf::PropertyField::dataPointer ( ) const
Returns
DpfVector of data array.

◆ dataSize()

dp_int ansys::dpf::PropertyField::dataSize ( ) const
Returns
Size of the data container.
Examples
ModelTest.cpp.

◆ deep_copy() [1/2]

PropertyField ansys::dpf::PropertyField::deep_copy ( ) const

Make a deep copy locally.

◆ deep_copy() [2/2]

PropertyField ansys::dpf::PropertyField::deep_copy ( ansys::dpf::Client const *const  client) const

Make a deep copy on a given client.

Parameters
[in]clientRemote client

◆ entityData()

void ansys::dpf::PropertyField::entityData ( dp_index  entity_index,
DpfVector< int > &  data 
) const
Returns
DpfVector of data array of an entity, by index.
Parameters
[in]entity_indexIndex of entity for which to get data.
[out]dataPointer to the data.

◆ entityDataById()

void ansys::dpf::PropertyField::entityDataById ( dp_id  entity_id,
DpfVector< int > &  data 
) const
Returns
DpfVector of data array of an entity, by id.
Parameters
[in]entity_idId of entity for which to get data.
[out]dataPointer to the data.

◆ fieldDefinition()

FieldDefinition ansys::dpf::PropertyField::fieldDefinition ( ) const
Returns
FieldDefinition of the field.

◆ fillCursor()

void ansys::dpf::PropertyField::fillCursor ( dp_index  index,
PropFieldCursor cursor 
) const

Get data at a given index.

Parameters
[in]indexIndex of entity for which to get data.
[out]cursorPropFieldCursor with which to contain data.
Examples
DataApis.cpp.

◆ getData()

void ansys::dpf::PropertyField::getData ( std::vector< dp_int > &  values_to_fill) const

Get all data for property entities.

Parameters
[out]values_to_fillProperty entity data.

◆ getIds()

void ansys::dpf::PropertyField::getIds ( std::vector< dp_id > &  ids_to_fill) const

Get ids of property entities.

Parameters
[out]ids_to_fillEntity ids.

◆ location()

Location ansys::dpf::PropertyField::location ( ) const
Returns
Location of the property.

◆ name()

std::string ansys::dpf::PropertyField::name ( ) const
Returns
Name of CustomTypeField.

◆ numberOfComponents()

dp_int ansys::dpf::PropertyField::numberOfComponents ( ) const
Returns
Number of components in the property data.

◆ numberOfElementaryData()

dp_int ansys::dpf::PropertyField::numberOfElementaryData ( ) const
Returns
Number of elementary data (size = number of components) contained in the PropertyField.

◆ push_back() [1/3]

void ansys::dpf::PropertyField::push_back ( dp_id  entity_id,
const int *  values,
int  size 
)

Push back the entity data.

Parameters
[in]entity_idIndex of entity for which to push data.
[in]valuesPtr on data for entity.
[in]sizeNumber of entities.

◆ push_back() [2/3]

void ansys::dpf::PropertyField::push_back ( dp_id  entity_id,
int *  values,
int  size 
)

Push back the entity data.

Parameters
[in]entity_idIndex of entity for which to push data.
[in]valuesPtr on data for entity.
[in]sizeNumber of entities.

◆ push_back() [3/3]

void ansys::dpf::PropertyField::push_back ( dp_id  entity_id,
std::vector< int > const &  values 
)

Push back the entity data.

Parameters
[in]entity_idId of entity for which to push data.
[in]valuesVector of data for entity.

◆ reserve()

void ansys::dpf::PropertyField::reserve ( dp_int  number_of_entities,
dp_int  overall_size = 0 
)

Reserve the Field. Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.

Parameters
[in]number_of_entitiesNumber of entities.
[in]overall_sizeTotal size of entity data.

◆ resize()

void ansys::dpf::PropertyField::resize ( dp_int  number_of_entities,
dp_int  overall_size 
)

Reserve the Field.

Parameters
[in]number_of_entitiesNumber of entities.
[in]overall_sizeTotal size of entity data.

◆ scoping()

Scoping ansys::dpf::PropertyField::scoping ( ) const
Returns
Scoping of the property.

◆ setData() [1/2]

void ansys::dpf::PropertyField::setData ( int const *const  data,
int  size 
)

Set the data of the property field.

Parameters
[in]dataList of data.
[in]sizeSize of list.

◆ setData() [2/2]

void ansys::dpf::PropertyField::setData ( std::vector< int > const &  data)

Set the data of the property field.

Parameters
[in]dataVector of data.

◆ setDataPointer() [1/2]

void ansys::dpf::PropertyField::setDataPointer ( int *const  data,
int  size 
)

Set the data pointer of the property field.

Parameters
[in]dataList of data.
[in]sizeSize of list.

◆ setDataPointer() [2/2]

void ansys::dpf::PropertyField::setDataPointer ( std::vector< int > const &  data)

Set the data pointer of the property field.

Parameters
[in]dataVector of data.

◆ setFieldDefinition()

void ansys::dpf::PropertyField::setFieldDefinition ( FieldDefinition const &  f)

Set the FieldDefinition.

◆ setName()

void ansys::dpf::PropertyField::setName ( const std::string &  name)

Set name of CustomTypeField.

Parameters
[in]nameNew name.

◆ setScoping()

void ansys::dpf::PropertyField::setScoping ( ansys::dpf::Scoping s)

Set the scoping of the property field.

Connect with Ansys