Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::PropertyField Class Reference

Last update: 10.07.2023

#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 (PropertyField const &)
 
 PropertyField (PropertyField &&)
 
PropertyFieldoperator= (PropertyField const &)
 
PropertyFieldoperator= (PropertyField &&)
 
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 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 ()
 

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/2]

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/2]

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.

Member Function Documentation

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

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

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

◆ setScoping()

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

Set the scoping of the property field.