Class ansys::dpf::CustomTypeField
Last update: 25.03.2026
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).
Inherits from:
Members
- addStringProperty
- callAPI
- cloneToCustomTypeField
- cloneToField
- cloneToPropertyField
- CustomTypeField
- CustomTypeField
- CustomTypeField
- CustomTypeField
- CustomTypeField
- CustomTypeField
- CustomTypeField
- data
- dataPointer
- dataSize
- deep_copy
- describe
- empty
- emptyCustomTypeField
- entityData
- entityDataById
- fieldDefinition
- getClient
- getData
- getHeaderAsDataTree
- getStringProperty
- hasBeenMovedLocally
- hasInternalObject
- identicalPointers
- isOfUnitaryType
- isOnCommonAPI
- isSameObject
- name
- numberOfComponents
- numberOfElementaryData
- numberOfEntities
- operator=
- operator=
- push_back
- push_back
- reserve
- resize
- resizeDataPointer
- scoping
- setData
- setData
- setDataPointer
- setDataPointer
- setFieldDefinition
- setHeaderAsDataTree
- setName
- setScoping
- setSupport
- setSupport
- setSupport
- support
- ~CustomTypeField
- ~DpfTypes
Friends
Public static functions
Function emptyCustomTypeField
static CustomTypeField ansys::dpf::CustomTypeField::emptyCustomTypeField()
Return type: CustomTypeField
Public functions
Function ~CustomTypeField
virtual ansys::dpf::CustomTypeField::~CustomTypeField()
Return type:
Function CustomTypeField
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
Parameters:
- Client const *const client: [in] Client to create the custom property field on.
- UnitaryDataType *
- dp_int reserved_number_of_entities = 0 : [in] Number of entities to reserve in the scoping.
- dp_int reserved_num_unitary_data = 0 : [in] Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
Return type:
Function CustomTypeField
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
Parameters:
- UnitaryDataType *
- dp_int reserved_number_of_entities = 0 : [in] Number of entities to reserve in the scoping.
- dp_int reserved_num_unitary_data = 0 : [in] Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
Return type:
Function CustomTypeField
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:
- Client const *const client: [in] Client to create the custom property field on.
- dp_int unitary_data_num_bytes: [in] Num bytes by unitary data.
- dp_int reserved_number_of_entities = 0 : [in] Number of entities to reserve in the scoping.
- dp_int reserved_num_unitary_data = 0 : [in] Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
Return type:
Function CustomTypeField
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:
- dp_int unitary_data_num_bytes: [in] Num bytes by unitary data.
- dp_int reserved_number_of_entities = 0 : [in] Number of entities to reserve in the scoping.
- dp_int reserved_num_unitary_data = 0 : [in] Reserved size of data=reserved_num_unitary_data*unitary_data_num_bytes.
Return type:
Function CustomTypeField
ansys::dpf::CustomTypeField::CustomTypeField(int id, Client const *const client)
Retrieve an existing instance of CustomTypeField on a server.
Parameters:
- int id: [in] Id of the CustomTypeField object on the server's database.
- Client const *const client: [in] Client instance designating the IP, port and protocol to use.
Return type:
Function CustomTypeField
ansys::dpf::CustomTypeField::CustomTypeField(CustomTypeField const &)
Parameters:
- CustomTypeField const &
Return type:
Function CustomTypeField
ansys::dpf::CustomTypeField::CustomTypeField(CustomTypeField &&) noexcept
Parameters:
- CustomTypeField &&
Return type:
Function operator=
CustomTypeField & ansys::dpf::CustomTypeField::operator=(CustomTypeField const &)
Parameters:
- CustomTypeField const &
Return type: CustomTypeField &
Function operator=
CustomTypeField & ansys::dpf::CustomTypeField::operator=(CustomTypeField &&) noexcept
Parameters:
- CustomTypeField &&
Return type: CustomTypeField &
Function identicalPointers
bool ansys::dpf::CustomTypeField::identicalPointers(CustomTypeField const &f) const
Compare field with input field f.
Parameters:
- CustomTypeField const & f: [in] Field with which to compare.
Return type: bool
Function name
std::string ansys::dpf::CustomTypeField::name() const
Returns:
Name of CustomTypeField.
Return type: std::string
Function setName
void ansys::dpf::CustomTypeField::setName(const std::string &name)
Set name of CustomTypeField.
Parameters:
- const std::string & name: [in] New name.
Return type: void
Function scoping
Scoping ansys::dpf::CustomTypeField::scoping() const
Returns:
Scoping of the property.
Return type: Scoping
Function dataSize
dp_int ansys::dpf::CustomTypeField::dataSize() const
Returns:
Size of the data container.
Return type: dp_int
Function numberOfComponents
dp_int ansys::dpf::CustomTypeField::numberOfComponents() const
Returns:
Number of components in the property data.
Return type: dp_int
Function numberOfEntities
dp_int ansys::dpf::CustomTypeField::numberOfEntities() const
Returns:
Number of entities in the Field Only implemented for in process udage. For gRPC usage, use scoping().size().
Return type: dp_int
Function numberOfElementaryData
dp_int ansys::dpf::CustomTypeField::numberOfElementaryData() const
Returns:
Number of elementary data (size = number of components) contained in the CustomTypeField.
Return type: dp_int
Function push_back
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:
- dp_id entity_id: [in] Id of entity for which to push data.
- std::vector< UnitaryDataType > const & values: [in] Vector of data for entity.
Return type: void
Function push_back
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:
- dp_id entity_id: [in] Index of entity for which to push data.
- const UnitaryDataType * values: [in] Ptr on data for entity.
- dp_int size: [in] Number of entities.
Return type: void
Function setData
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:
- std::vector< UnitaryDataType > const & data: [in] Vector of data.
Return type: void
Function setData
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:
- UnitaryDataType const *const data: [in] List of data.
- int size: [in] Size of list.
Return type: void
Function setDataPointer
void ansys::dpf::CustomTypeField::setDataPointer(std::vector< dp_int > const &data)
Set the data pointer of the custom type field.
Parameters:
- std::vector< dp_int > const & data: [in] Vector of data.
Return type: void
Function setDataPointer
void ansys::dpf::CustomTypeField::setDataPointer(dp_int const *const data, int size)
Set the data pointer of the custom type field.
Parameters:
- dp_int const *const data: [in] List of data.
- int size: [in] Size of list.
Return type: void
Function setScoping
void ansys::dpf::CustomTypeField::setScoping(ansys::dpf::Scoping const &s)
Set the scoping of the custom property field.
Parameters:
- ansys::dpf::Scoping const & s
Return type: void
Function addStringProperty
void ansys::dpf::CustomTypeField::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
bool ansys::dpf::CustomTypeField::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 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:
- std::vector< UnitaryDataType > & values_to_fill: [out] Property entity data.
Return type: void
Function data
DpfVector< UnitaryDataType > ansys::dpf::CustomTypeField::data() const
Returns:
DpfVector of data array. The unitary data type should be UnitaryDataType.
Return type: DpfVector< UnitaryDataType >
Function dataPointer
DpfVector< int > ansys::dpf::CustomTypeField::dataPointer() const
Returns:
DpfVector of data array.
Return type: DpfVector< int >
Function 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:
- dp_index entity_index: [in] Index of entity for which to get data.
- DpfVector< UnitaryDataType > & data: [out] Pointer to the data.
Return type: void
Function 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:
- dp_id entity_id: [in] Id of entity for which to get data.
- DpfVector< UnitaryDataType > & data: [out] Pointer to the data.
Return type: void
Function reserve
void ansys::dpf::CustomTypeField::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:
- dp_int number_of_entities: [in] Number of entities.
- dp_int overall_size = 0 : [in] Total size of entity data.
Return type: void
Function resize
void ansys::dpf::CustomTypeField::resize(dp_int number_of_entities, dp_int overall_size)
Reserve the Field.
Parameters:
- dp_int number_of_entities: [in] Number of entities.
- dp_int overall_size: [in] Total size of entity data.
Return type: void
Function resizeDataPointer
void ansys::dpf::CustomTypeField::resizeDataPointer(dp_int number_of_entities)
[in] Number of entities
Resize the dataPointer array.
Parameters:
- dp_int number_of_entities
Return type: void
Function fieldDefinition
FieldDefinition ansys::dpf::CustomTypeField::fieldDefinition() const
Returns:
FieldDefinition of the field.
Return type: FieldDefinition
Function support
Support ansys::dpf::CustomTypeField::support() const
Returns:
Support of the field.
Return type: Support
Function setSupport
void ansys::dpf::CustomTypeField::setSupport(ansys::dpf::Support &s)
Set the support of the Field.
Parameters:
- ansys::dpf::Support & s: [in] Field to support.
Return type: void
Function setSupport
void ansys::dpf::CustomTypeField::setSupport(ansys::dpf::TimeFreqSupport &s)
Set the support of the Field.
Parameters:
- ansys::dpf::TimeFreqSupport & s: [in] Field to support.
Return type: void
Function setSupport
void ansys::dpf::CustomTypeField::setSupport(ansys::dpf::MeshedRegion &s)
Set the support of the Field.
Parameters:
- ansys::dpf::MeshedRegion & s: [in] Field to support.
Return type: void
Function setFieldDefinition
void ansys::dpf::CustomTypeField::setFieldDefinition(FieldDefinition const &f)
Set the FieldDefinition.
Parameters:
- FieldDefinition const & f
Return type: void
Function isOfUnitaryType
bool ansys::dpf::CustomTypeField::isOfUnitaryType() const
tests the type of the Field.
Return type: bool
Function cloneToCustomTypeField
CustomTypeField ansys::dpf::CustomTypeField::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 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
Function cloneToField
Field ansys::dpf::CustomTypeField::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 custom type field without its data.
Parameters:
- ansys::dpf::Client 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
PropertyField ansys::dpf::CustomTypeField::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 custom type field without its data.
Parameters:
- ansys::dpf::Client 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
Function getHeaderAsDataTree
DataTree ansys::dpf::CustomTypeField::getHeaderAsDataTree() const
Get the header of the CustomTypeField as a DataTree object.
Return type: DataTree
Function setHeaderAsDataTree
void ansys::dpf::CustomTypeField::setHeaderAsDataTree(const DataTree &datatree)
Set the header of the CustomTypeField using a DataTree object.
Parameters:
- const DataTree & datatree
Return type: void
Function deep_copy
CustomTypeField ansys::dpf::CustomTypeField::deep_copy(ansys::dpf::Client const *const client=nullptr) const
Create a new CustomTypeField on a server by copying all the data of this CustomTypeField.
Parameters:
- ansys::dpf::Client const *const client = nullptr : [in] Client instance designating the IP, port and protocol to use.
Return type: CustomTypeField