Skip to main content
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…) Inherits from:

Members

Friends

Public functions

Function Field

Create a group of data with given dimensions and locations. Parameters:
  • int reserved_number_of_entity = 0 : [in] Number of entities.
  • const std::vector< int > & dimensions = { 1 } : [in] Dimension of each entity.
  • const Location & loc = locations::nodal : [in] Location of entities.
Return type:

Function Field

Create a group of data with given dimensions and locations on a server. Parameters:
  • Client const *const client: [in] Remote client.
  • int reserved_number_of_entity = 0 : [in] Number of entities.
  • const std::vector< int > & dimensions = { 1 } : [in] Dimension of each entity.
  • const Location & loc = locations::nodal : [in] Location of entities.
Return type:

Function Field

Retrieve an existing instance of Field on a server. Parameters:
  • int id: [in] Id of the Field object on the server’s database.
  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.
Return type:

Function ~Field

Return type:

Function Field

Parameters:
  • Field const &
Return type:

Function Field

Parameters:
  • Field &&
Return type:

Function operator=

Parameters:
  • Field const &
Return type: Field &

Function operator=

Parameters:
  • Field &&
Return type: Field &

Function identicalPointers

Compare field with input field f. Parameters:
  • Field const & f: [in] Field with which to compare.
Return type: bool

Function numberOfComponents

Returns: Number of components in the elementary data. Return type: dp_int

Function numberOfEntities

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

Returns: Number of elementary data (size = number of components) contained in the Field. Return type: dp_int

Function numberOfElementaryDataByEntityIndex

Returns: Number of elementary data by entity index. Parameters: Return type: dp_int

Function numberOfElementaryDataByEntityId

Returns: Number of elementary data by entity id. Parameters: Return type: dp_int

Function dataSize

Returns: Size of the data container. Return type: dp_int

Function name

Returns: Name of Field. Return type: std::string

Function setName

Set name of Field. Parameters:
  • const std::string & name: [in] New name.
Return type: void

Function addStringProperty

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

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 data

Returns: Pointer to data array. Parameters:
  • int & size: [out] Size of returned data array.
Return type: dp_double *const

Function data

Returns: DpfVector of data array. Return type: DpfVector< double >

Function dataPointer

Returns: DpfVector of data pointer array. Return type: DpfVector< int >

Function getData

Copy the data for all entities in a vector of double. Parameters:
  • std::vector< dp_double > & data_to_fill: [out] Vector of data for all entities.
Return type: void

Function entityData

Returns: Pointer to data array of an entity, by index. Parameters:
  • dp_index entity_index: [in] Index of entity for which to get data.
  • dp_int & size: [out] Size of returned data array.
Return type: dp_double *const

Function entityData

Returns: DpfVector of data array of an entity, by index. Parameters:
  • dp_index entity_index: [in] Index of entity for which to get data.
  • DpfVector< double > & data: [out] Pointer to the data.
Return type: void

Function entityDataById

Returns: Pointer to data array of an entity, by id. Parameters:
  • dp_id entity_id: [in] Id of entity for which to get data.
  • dp_int & size: [out] Size of returned data array.
Return type: dp_double *const

Function entityDataById

Returns: DpfVector of data array of an entity, by id. Parameters:
  • dp_id entity_id: [in] Id of entity for which to get data.
  • DpfVector< double > & data: [out] Pointer to the data.
Return type: void

Function entityId

Returns: Entity id corresponding to a given entity index Parameters:
  • dp_index entity_index: [in] Index of entity for which to get Id.
Return type: dp_id

Function scoping

Returns: Scoping of the field. Return type: Scoping

Function fieldDefinition

Returns: FieldDefinition of the field. Return type: FieldDefinition

Function support

Returns: Support of the field. Return type: Support

Function setFieldDefinition

Set the FieldDefinition. Parameters: Return type: void

Function setScoping

set the Scoping of the Field. Parameters: Return type: void

Function setData

Set the data of the field. Parameters:
  • std::vector< double > const & data: [in] Vector of data.
Return type: void

Function setData

Set the data of the field. Parameters:
  • double const *const data: [in] List of data.
  • int size: [in] Size of list.
Return type: void

Function setDataPointer

Set the data pointer of the field. Parameters:
  • std::vector< int > & data: [in] Vector of data.
Return type: void

Function setDataPointer

Set the data pointer of the field. Parameters:
  • int const *const data: [in] List of data.
  • int size: [in] Size of list.
Return type: void

Function setSupport

Set the support of the Field. Parameters: Return type: void

Function setSupport

Set the support of the Field. Parameters: Return type: void

Function setSupport

Set the support of the Field. Parameters: Return type: void

Function reserve

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

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

[in] Number of entities Resize the dataPointer array. Parameters: Return type: void

Function fillCursor

Get data at a given index. Parameters: Return type: void

Function push_back

Push back the entity data. Parameters:
  • dp_id entity_id: [in] Index of entity for which to push data.
  • std::vector< dp_double > const & values: [in] Vector of data for entity.
Return type: void

Function push_back

Push back the entity data. Parameters:
  • dp_id entity_id: [in] Index of entity for which to push data.
  • const dp_double * values: [in] Ptr on data for entity.
  • int size: [in] Number of entities.
Return type: void

Function push_back

Push back the entity data. Parameters:
  • dp_id entity_id: [in] Index of entity for which to push data.
  • dp_double * values: [in] Ptr on data for entity.
  • int size: [in] Number of entities.
Return type: void

Function deep_copy

Make a deep copy on a given client. Parameters: Return type: Field

Function cloneToCustomTypeField

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

Creates a new 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: Field

Function cloneToPropertyField

Creates a new property 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: PropertyField

Function getHeaderAsDataTree

Get the header of the Field as a DataTree object. Return type: DataTree

Function setHeaderAsDataTree

Set the header of the field using a DataTree object. Parameters:
  • const DataTree & datatree
Return type: void

Public static functions

Function emptyField

Create an empty Field. Returns: Empty Field. Return type: Field

Function createFieldWithTransformation

Instantiate a Field with Transformation. For each call to a getter, the workflow in input is connected this Field to input_name_to_connect and the Field output in output_name_to_eval is used as the getter instance. Parameters:
  • Workflow transformation_wf: [in] Transformation workflow.
  • int reserved_number_of_entity = 0 : [in] Number of entities.
  • const std::vector< int > & dimensions = { 1 } : [in] Dimension of each entity.
  • const Location & loc = locations::nodal
  • std::string const & input_name_to_connect = “input_field” : [in] Name of the input of the workflow to connect. Should take a Field.
  • std::string const & output_name_to_eval = “transformed_field” : [in] Name of the output of the workflow to evaluate. Should return a Field.
Return type: Field