ansys::dpf::Field Class Reference
Last update: 10.07.2023
ansys::dpf::Field Class Reference
Data for an entity. More...
#include <dpf_api.h>
Public Member Functions | |
Field (int reserved_number_of_entity=0, const std::vector< int > &dimensions={ 1 }, const Location &loc=locations::nodal) | |
Field (Client const *const client, int reserved_number_of_entity=0, const std::vector< int > &dimensions={ 1 }, const Location &loc=locations::nodal) | |
Field (int id, Client const *const client) | |
Field (Field const &) | |
Field (Field &&) | |
Field & | operator= (Field const &) |
Field & | operator= (Field &&) |
bool | identicalPointers (Field const &f) const |
dp_int | numberOfComponents () const |
dp_int | numberOfEntities () const |
dp_int | numberOfElementaryData () const |
dp_int | numberOfElementaryDataByEntityIndex (dp_int entityIndex) const |
dp_int | numberOfElementaryDataByEntityId (dp_int entityId) const |
dp_int | dataSize () const |
std::string | name () const |
void | setName (const std::string &name) |
dp_double *const | data (int &size) const |
DpfVector< double > | data () const |
DpfVector< int > | dataPointer () const |
void | getData (std::vector< dp_double > &data_to_fill) const |
dp_double *const | entityData (dp_index entity_index, dp_int &size) const |
void | entityData (dp_index entity_index, DpfVector< double > &data) const |
dp_double *const | entityDataById (dp_id entity_id, dp_int &size) const |
void | entityDataById (dp_id entity_id, DpfVector< double > &data) const |
dp_id | entityId (dp_index entity_index) const |
Scoping | scoping () const |
FieldDefinition | fieldDefinition () const |
Support | support () const |
void | setFieldDefinition (FieldDefinition const &f) |
void | setScoping (ansys::dpf::Scoping const &s) |
void | setData (std::vector< double > const &data) |
void | setData (double const *const data, int size) |
void | setDataPointer (std::vector< int > &data) const |
void | setDataPointer (int const *const data, int size) const |
void | setSupport (ansys::dpf::Support const &s) |
void | setSupport (ansys::dpf::TimeFreqSupport const &s) |
void | setSupport (ansys::dpf::MeshedRegion const &s) |
void | reserve (dp_int number_of_entities, dp_int overall_size=0) |
void | resize (dp_int number_of_entities, dp_int overall_size) |
void | fillCursor (dp_index index, FieldCursor &f) const |
void | push_back (dp_id entity_id, std::vector< dp_double > const &values) |
void | push_back (dp_id entity_id, const dp_double *values, int size) |
void | push_back (dp_id entity_id, dp_double *values, int size) |
Field | deep_copy (ansys::dpf::Client const *const client) const |
Field | 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 Field | emptyField () |
Detailed Description
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...)
- Examples
- CompleteRST.cpp, DataApis.cpp, DataExport.cpp, ModelTest.cpp, OperatorsApis.cpp, and WorkflowExamples.cpp.
Constructor & Destructor Documentation
◆ Field() [1/3]
ansys::dpf::Field::Field | ( | int | reserved_number_of_entity = 0 , |
const std::vector< int > & | dimensions = { 1 } , |
||
const Location & | loc = locations::nodal |
||
) |
Create a group of data with given dimensions and locations.
- Parameters
-
[in] reserved_number_of_entity Number of entities. [in] dimensions Dimension of each entity. [in] loc Location of entities.
◆ Field() [2/3]
ansys::dpf::Field::Field | ( | Client const *const | client, |
int | reserved_number_of_entity = 0 , |
||
const std::vector< int > & | dimensions = { 1 } , |
||
const Location & | loc = locations::nodal |
||
) |
Create a group of data with given dimensions and locations on a server.
- Parameters
-
[in] client Remote client. [in] reserved_number_of_entity Number of entities. [in] dimensions Dimension of each entity. [in] loc Location of entities.
◆ Field() [3/3]
ansys::dpf::Field::Field | ( | int | id, |
Client const *const | client | ||
) |
Member Function Documentation
◆ data() [1/2]
◆ data() [2/2]
dp_double *const ansys::dpf::Field::data | ( | int & | size | ) | const |
- Returns
- Pointer to data array.
- Parameters
-
[out] size Size of returned data array.
- Examples
- DataApis.cpp, DataExport.cpp, ModelTest.cpp, and OperatorsApis.cpp.
◆ dataPointer()
◆ dataSize()
dp_int ansys::dpf::Field::dataSize | ( | ) | const |
- Returns
- Size of the data container.
- Examples
- DataExport.cpp, and ModelTest.cpp.
◆ deep_copy() [1/2]
Field ansys::dpf::Field::deep_copy | ( | ) | const |
Make a deep copy locally.
◆ deep_copy() [2/2]
Field ansys::dpf::Field::deep_copy | ( | ansys::dpf::Client const *const | client | ) | const |
Make a deep copy on a given client.
- Parameters
-
[in] client Remote client
◆ emptyField()
◆ entityData() [1/2]
- Returns
- Pointer to data array of an entity, by index.
- Parameters
-
[in] entity_index Index of entity for which to get data. [out] size Size of returned data array.
- Examples
- DataApis.cpp.
◆ entityData() [2/2]
- Returns
- DpfVector of data array of an entity, by index.
- Parameters
-
[in] entity_index Index of entity for which to get data. [out] data Pointer to the data.
◆ entityDataById() [1/2]
- Returns
- Pointer to data array of an entity, by id.
- Parameters
-
[in] entity_id Id of entity for which to get data. [out] size Size of returned data array.
- Examples
- DataApis.cpp.
◆ entityDataById() [2/2]
- Returns
- DpfVector of data array of an entity, by id.
- Parameters
-
[in] entity_id Id of entity for which to get data. [out] data Pointer to the data.
◆ entityId()
- Returns
- Entity id corresponding to a given entity index
- Parameters
-
[in] entity_index Index of entity for which to get Id.
◆ fieldDefinition()
FieldDefinition ansys::dpf::Field::fieldDefinition | ( | ) | const |
- Returns
- FieldDefinition of the field.
- Examples
- AveragingTest.cpp, DataApis.cpp, and DataExport.cpp.
◆ fillCursor()
void ansys::dpf::Field::fillCursor | ( | dp_index | index, |
FieldCursor & | f | ||
) | const |
Get data at a given index.
- Parameters
-
[in] index Index of entity for which to get data. [out] f FieldCursor with which to contain data.
- Examples
- DataApis.cpp.
◆ getData()
void ansys::dpf::Field::getData | ( | std::vector< dp_double > & | data_to_fill | ) | const |
Copy the data for all entities in a vector of double.
- Parameters
-
[out] data_to_fill Vector of data for all entities.
◆ identicalPointers()
bool ansys::dpf::Field::identicalPointers | ( | Field const & | f | ) | const |
Compare field with input field f.
- Parameters
-
[in] f Field with which to compare.
◆ name()
std::string ansys::dpf::Field::name | ( | ) | const |
- Returns
- Name of Field.
◆ numberOfComponents()
dp_int ansys::dpf::Field::numberOfComponents | ( | ) | const |
- Returns
- Number of components in the elementary data.
- Examples
- DataApis.cpp.
◆ numberOfElementaryData()
dp_int ansys::dpf::Field::numberOfElementaryData | ( | ) | const |
- Returns
- Number of elementary data (size = number of components) contained in the Field.
◆ numberOfElementaryDataByEntityId()
- Returns
- Number of elementary data by entity id.
◆ numberOfElementaryDataByEntityIndex()
- Returns
- Number of elementary data by entity index.
◆ numberOfEntities()
dp_int ansys::dpf::Field::numberOfEntities | ( | ) | const |
◆ push_back() [1/3]
Push back the entity data.
- 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/3]
Push back the entity data.
- 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() [3/3]
Push back the entity data.
- Parameters
-
[in] entity_id Index of entity for which to push data. [in] values Vector of data for entity.
- Examples
- DataApis.cpp.
◆ 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()
Scoping ansys::dpf::Field::scoping | ( | ) | const |
- Returns
- Scoping of the field.
- Examples
- DataApis.cpp, and DataExport.cpp.
◆ setData() [1/2]
void ansys::dpf::Field::setData | ( | double const *const | data, |
int | size | ||
) |
Set the data of the field.
- Parameters
-
[in] data List of data. [in] size Size of list.
◆ setData() [2/2]
void ansys::dpf::Field::setData | ( | std::vector< double > const & | data | ) |
Set the data of the field.
- Parameters
-
[in] data Vector of data.
- Examples
- DataApis.cpp, and OperatorsApis.cpp.
◆ setDataPointer() [1/2]
void ansys::dpf::Field::setDataPointer | ( | int const *const | data, |
int | size | ||
) | const |
Set the data pointer of the field.
- Parameters
-
[in] data List of data. [in] size Size of list.
◆ setDataPointer() [2/2]
void ansys::dpf::Field::setDataPointer | ( | std::vector< int > & | data | ) | const |
Set the data pointer of the field.
- Parameters
-
[in] data Vector of data.
◆ setFieldDefinition()
void ansys::dpf::Field::setFieldDefinition | ( | FieldDefinition const & | f | ) |
Set the FieldDefinition.
- Examples
- DataApis.cpp.
◆ setName()
void ansys::dpf::Field::setName | ( | const std::string & | name | ) |
Set name of Field.
- Parameters
-
[in] name New name.
◆ setScoping()
void ansys::dpf::Field::setScoping | ( | ansys::dpf::Scoping const & | s | ) |
◆ setSupport() [1/3]
void ansys::dpf::Field::setSupport | ( | ansys::dpf::MeshedRegion const & | s | ) |
Set the support of the Field.
- Parameters
-
[in] s MeshedRegion to support.
◆ setSupport() [2/3]
void ansys::dpf::Field::setSupport | ( | ansys::dpf::Support const & | s | ) |
◆ setSupport() [3/3]
void ansys::dpf::Field::setSupport | ( | ansys::dpf::TimeFreqSupport const & | s | ) |
Set the support of the Field.
- Parameters
-
[in] s TimeFreqSupport to support.