ansys::dpf::CustomTypeField Class Reference
Last update: 10.07.2023
ansys::dpf::CustomTypeField Class Reference
#include <dpf_api.h>
Public Member Functions | |
template<typename UnitaryDataType > | |
CustomTypeField (Client const *const client, UnitaryDataType *, dp_int reserved_number_of_entities=0, dp_int reserved_num_unitary_data=0) | |
template<typename UnitaryDataType > | |
CustomTypeField (UnitaryDataType *, dp_int reserved_number_of_entities=0, dp_int reserved_num_unitary_data=0) | |
CustomTypeField (Client const *const client, dp_int unitary_data_num_bytes, dp_int reserved_number_of_entities=0, dp_int reserved_num_unitary_data=0) | |
CustomTypeField (dp_int unitary_data_num_bytes, dp_int reserved_number_of_entities=0, dp_int reserved_num_unitary_data=0) | |
CustomTypeField (CustomTypeField const &) | |
CustomTypeField (CustomTypeField &&) | |
CustomTypeField & | operator= (CustomTypeField const &) |
CustomTypeField & | operator= (CustomTypeField &&) |
bool | identicalPointers (CustomTypeField const &f) const |
std::string | name () const |
void | setName (const std::string &name) |
Scoping | scoping () const |
dp_int | dataSize () const |
dp_int | numberOfComponents () const |
dp_int | numberOfEntities () const |
dp_int | numberOfElementaryData () const |
template<typename UnitaryDataType > | |
void | push_back (dp_id entity_id, std::vector< UnitaryDataType > const &values) |
template<typename UnitaryDataType > | |
void | push_back (dp_id entity_id, const UnitaryDataType *values, dp_int size) |
template<typename UnitaryDataType > | |
void | setData (std::vector< UnitaryDataType > const &data) |
template<typename UnitaryDataType > | |
void | setData (UnitaryDataType const *const data, int size) |
void | setDataPointer (std::vector< dp_int > const &data) |
void | setDataPointer (dp_int const *const data, int size) |
void | setScoping (ansys::dpf::Scoping &s) |
template<typename UnitaryDataType > | |
void | getData (std::vector< UnitaryDataType > &values_to_fill) const |
template<typename UnitaryDataType > | |
DpfVector< UnitaryDataType > | data () const |
DpfVector< int > | dataPointer () const |
template<typename UnitaryDataType > | |
void | entityData (dp_index entity_index, DpfVector< UnitaryDataType > &data) const |
template<typename UnitaryDataType > | |
void | entityDataById (dp_id entity_id, DpfVector< UnitaryDataType > &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) |
FieldDefinition | fieldDefinition () const |
Support | support () const |
void | setSupport (ansys::dpf::Support &s) |
void | setFieldDefinition (FieldDefinition const &f) |
template<typename UnitaryDataType > | |
bool | isOfUnitaryType () 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 CustomTypeField | emptyCustomTypeField () |
Detailed Description
Holds data located on given entities (the Field's data is bounded with its scoping). The unitary data type can be chosen by the user (it can be int32, float, char...). Is the equivalent of the Field but with custom type values data. (and not double values).
Constructor & Destructor Documentation
◆ CustomTypeField() [1/4]
ansys::dpf::CustomTypeField::CustomTypeField | ( | Client const *const | client, |
UnitaryDataType * | , | ||
dp_int | reserved_number_of_entities = 0 , |
||
dp_int | reserved_num_unitary_data = 0 |
||
) |
Create an empty custom type field with a client. The unitary data type will be UnitaryDataType. For example, use ansys::dpf::CustomTypeField f(ansys::dpf::UseType<float>()).
- Parameters
-
[in] client Client to create the custom property field on. [in] reserved_number_of_entities Number of entities to reserve in the scoping. [in] reserved_num_unitary_data Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
◆ CustomTypeField() [2/4]
ansys::dpf::CustomTypeField::CustomTypeField | ( | UnitaryDataType * | , |
dp_int | reserved_number_of_entities = 0 , |
||
dp_int | reserved_num_unitary_data = 0 |
||
) |
Create a property with number of entities and data size. The unitary data type will be UnitaryDataType. For example, use ansys::dpf::CustomTypeField f(ansys::dpf::UseType<float>()).
- Parameters
-
[in] reserved_number_of_entities Number of entities to reserve in the scoping. [in] reserved_num_unitary_data Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
◆ CustomTypeField() [3/4]
ansys::dpf::CustomTypeField::CustomTypeField | ( | Client const *const | client, |
dp_int | unitary_data_num_bytes, | ||
dp_int | reserved_number_of_entities = 0 , |
||
dp_int | reserved_num_unitary_data = 0 |
||
) |
Create an empty custom type field with a client. The unitary data type will be of size unitary_data_num_bytes.
- Parameters
-
[in] client Client to create the custom property field on. [in] unitary_data_num_bytes Num bytes by unitary data. [in] reserved_number_of_entities Number of entities to reserve in the scoping. [in] reserved_num_unitary_data Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
◆ CustomTypeField() [4/4]
ansys::dpf::CustomTypeField::CustomTypeField | ( | dp_int | unitary_data_num_bytes, |
dp_int | reserved_number_of_entities = 0 , |
||
dp_int | reserved_num_unitary_data = 0 |
||
) |
Create a property with number of entities and data size. The unitary data type will be of size unitary_data_num_bytes.
- Parameters
-
[in] unitary_data_num_bytes Num bytes by unitary data. [in] reserved_number_of_entities Number of entities to reserve in the scoping. [in] reserved_num_unitary_data Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
Member Function Documentation
◆ data()
DpfVector< UnitaryDataType > ansys::dpf::CustomTypeField::data |
- Returns
- DpfVector of data array. The unitary data type should be UnitaryDataType.
◆ dataPointer()
◆ dataSize()
dp_int ansys::dpf::CustomTypeField::dataSize | ( | ) | const |
- Returns
- Size of the data container.
◆ entityData()
void ansys::dpf::CustomTypeField::entityData | ( | dp_index | entity_index, |
DpfVector< UnitaryDataType > & | data | ||
) | const |
- Returns
- DpfVector of data array of an entity, by index. The unitary data type should be UnitaryDataType.
- Parameters
-
[in] entity_index Index of entity for which to get data. [out] data Pointer to the data.
◆ entityDataById()
void ansys::dpf::CustomTypeField::entityDataById | ( | dp_id | entity_id, |
DpfVector< UnitaryDataType > & | data | ||
) | const |
- Returns
- DpfVector of data array of an entity, by id. The unitary data type should be UnitaryDataType.
- Parameters
-
[in] entity_id Id of entity for which to get data. [out] data Pointer to the data.
◆ fieldDefinition()
FieldDefinition ansys::dpf::CustomTypeField::fieldDefinition | ( | ) | const |
- Returns
- FieldDefinition of the field.
◆ getData()
void ansys::dpf::CustomTypeField::getData | ( | std::vector< UnitaryDataType > & | values_to_fill | ) | const |
Get all data for property entities. The unitary data type should be UnitaryDataType.
- Parameters
-
[out] values_to_fill Property entity data.
◆ identicalPointers()
bool ansys::dpf::CustomTypeField::identicalPointers | ( | CustomTypeField const & | f | ) | const |
Compare field with input field f.
- Parameters
-
[in] f Field with which to compare.
◆ isOfUnitaryType()
bool ansys::dpf::CustomTypeField::isOfUnitaryType |
tests the type of the Field.
◆ name()
std::string ansys::dpf::CustomTypeField::name | ( | ) | const |
- Returns
- Name of CustomTypeField.
◆ numberOfComponents()
dp_int ansys::dpf::CustomTypeField::numberOfComponents | ( | ) | const |
- Returns
- Number of components in the property data.
◆ numberOfElementaryData()
dp_int ansys::dpf::CustomTypeField::numberOfElementaryData | ( | ) | const |
- Returns
- Number of elementary data (size = number of components) contained in the CustomTypeField.
◆ numberOfEntities()
dp_int ansys::dpf::CustomTypeField::numberOfEntities | ( | ) | const |
◆ push_back() [1/2]
void ansys::dpf::CustomTypeField::push_back | ( | dp_id | entity_id, |
const UnitaryDataType * | values, | ||
dp_int | size | ||
) |
Push back the entity data. The unitary data type should be UnitaryDataType.
- Parameters
-
[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/2]
void ansys::dpf::CustomTypeField::push_back | ( | dp_id | entity_id, |
std::vector< UnitaryDataType > const & | values | ||
) |
Push back the entity data. The unitary data type should be UnitaryDataType.
- Parameters
-
[in] entity_id Id of entity for which to push data. [in] values Vector of data for entity.
◆ reserve()
Reserve the Field. Only implemented for in process udage. To reserve the size for gRPC usage, use the constructor.
- Parameters
-
[in] number_of_entities Number of entities. [in] overall_size Total size of entity data.
◆ resize()
Reserve the Field.
- Parameters
-
[in] number_of_entities Number of entities. [in] overall_size Total size of entity data.
◆ scoping()
◆ setData() [1/2]
void ansys::dpf::CustomTypeField::setData | ( | std::vector< UnitaryDataType > const & | data | ) |
Set the data of the custom property field.
Push back the entity data. The unitary data type should be UnitaryDataType.
- Parameters
-
[in] data Vector of data.
◆ setData() [2/2]
void ansys::dpf::CustomTypeField::setData | ( | UnitaryDataType const *const | data, |
int | size | ||
) |
Set the data of the custom property field. The unitary data type should be UnitaryDataType.
- Parameters
-
[in] data List of data. [in] size Size of list.
◆ setDataPointer() [1/2]
void ansys::dpf::CustomTypeField::setDataPointer | ( | dp_int const *const | data, |
int | size | ||
) |
Set the data pointer of the custom type field.
- Parameters
-
[in] data List of data. [in] size Size of list.
◆ setDataPointer() [2/2]
void ansys::dpf::CustomTypeField::setDataPointer | ( | std::vector< dp_int > const & | data | ) |
Set the data pointer of the custom type field.
- Parameters
-
[in] data Vector of data.
◆ setFieldDefinition()
void ansys::dpf::CustomTypeField::setFieldDefinition | ( | FieldDefinition const & | f | ) |
Set the FieldDefinition.
◆ setName()
void ansys::dpf::CustomTypeField::setName | ( | const std::string & | name | ) |
Set name of CustomTypeField.
- Parameters
-
[in] name New name.
◆ setScoping()
void ansys::dpf::CustomTypeField::setScoping | ( | ansys::dpf::Scoping & | s | ) |
Set the scoping of the custom property field.
◆ setSupport()
void ansys::dpf::CustomTypeField::setSupport | ( | ansys::dpf::Support & | s | ) |