ansys::dpf::FieldsContainer Class Reference
Last update: 16.07.2025Contains a group of fields. More...
#include <dpf_api.h>
Inherits ansys::dpf::CollectionBase.
Public Member Functions | |
| FieldsContainer (Client const *const client) | |
| FieldsContainer (Client const *const client, std::vector< std::string > const &labels) | |
| FieldsContainer (int id, Client const *const client) | |
| FieldsContainer (const std::vector< std::string > &labels) | |
| FieldsContainer (FieldsContainer const &) | |
| FieldsContainer (FieldsContainer &&) noexcept | |
| FieldsContainer & | operator= (FieldsContainer const &) |
| FieldsContainer & | operator= (FieldsContainer &&) noexcept |
| Field | operator[] (dp_int index) |
| Field | at (dp_index index) |
| const Field | at (dp_index index) const |
| void | update (Field &f, dp_index index) |
| void | add (LabelSpace const &lab_space, Field const &f) |
| std::vector< Field > | getFields (LabelSpace const &lab_space) const |
| Field | getField (LabelSpace const &lab_space) const |
| std::vector< int > | getFieldsIndeces (LabelSpace const &lab_space) const |
| std::vector< Field > | getFieldsForTimeId (dp_int time_id, dp_int complex_id=0) const |
| FieldsContainer | createSubFieldsContainer (LabelSpace const &lab_space) const |
| FieldsContainer | deep_copy (ansys::dpf::Client const *const client=nullptr) const |
Static Public Member Functions | |
| static FieldsContainer | emptyFieldsContainer () |
Detailed Description
Contains a group of fields.
FieldsContainer is a group of fields, used mainly in transient, harmonic, modal or multi-steps static analysis, where we can have a field for each time step or for each frequency. Consequently the fields container can describle a complete analysis with all its details.
The fields container is designed as a set of fields ordered through labels and ids. Labels identify how the fields are filtered. The most common fields container have the label "time" with ids corresponding to each time sets, the label "complex" will allow to separate real parts (id=0) from imaginary parts (id=1) in a harmonic analysis.
- See also
- Using collections and labels
Constructor & Destructor Documentation
◆ FieldsContainer() [1/4]
| ansys::dpf::FieldsContainer::FieldsContainer | ( | Client const *const | client | ) |
Create a new fields container on a server.
- Parameters
-
[in] client Client instance designating the IP, port and protocol to use.
◆ FieldsContainer() [2/4]
| ansys::dpf::FieldsContainer::FieldsContainer | ( | Client const *const | client, |
| std::vector< std::string > const & | labels | ||
| ) |
Create a collection of fields with the given labels on a server.
- Parameters
-
[in] client Client instance designating the IP, port and protocol to use. [in] labels Labels for fields.
◆ FieldsContainer() [3/4]
| ansys::dpf::FieldsContainer::FieldsContainer | ( | int | id, |
| Client const *const | client | ||
| ) |
Retrieve an existing instance of FieldsContainer on a server.
- Parameters
-
[in] id Id of the FieldsContainer object on the server's database. [in] client Client instance designating the IP, port and protocol to use.
◆ FieldsContainer() [4/4]
| ansys::dpf::FieldsContainer::FieldsContainer | ( | const std::vector< std::string > & | labels | ) |
Create a collection of fields with the given labels.
- Parameters
-
[in] labels Labels for fields.
Member Function Documentation
◆ add()
| void ansys::dpf::FieldsContainer::add | ( | LabelSpace const & | lab_space, |
| Field const & | f | ||
| ) |
Add Field to LabelSpace.
- Parameters
-
[in] lab_space LabelSpace to which to add Field. [in] f Field to add to LabelSpace.
- Examples
- DataApis.cpp, and DataExport.cpp.
◆ at() [1/2]
Get field at index.
- Returns
- Field given by index.
- Parameters
-
[in] index Index of field within container.
- Examples
- AveragingTest.cpp, and CompleteRST.cpp.
◆ at() [2/2]
◆ createSubFieldsContainer()
| FieldsContainer ansys::dpf::FieldsContainer::createSubFieldsContainer | ( | LabelSpace const & | lab_space | ) | const |
Create a new fields container with all the fields corresponding to the label space in input.
- Returns
- Created fields container.
- Parameters
-
[in] lab_space LabelSpace from which to get fields.
◆ deep_copy()
| FieldsContainer ansys::dpf::FieldsContainer::deep_copy | ( | ansys::dpf::Client const *const | client = nullptr | ) | const |
Create a new FieldsContainer on a server by copying all the data of this FieldsContainer.
- Parameters
-
[in] client Client instance designating the IP, port and protocol to use.
◆ emptyFieldsContainer()
|
static |
◆ getField()
| Field ansys::dpf::FieldsContainer::getField | ( | LabelSpace const & | lab_space | ) | const |
- Returns
- First Field given by LabelSpace
- Parameters
-
[in] lab_space LabelSpace for which to get field.
- Examples
- DataExport.cpp.
◆ getFields()
| std::vector< Field > ansys::dpf::FieldsContainer::getFields | ( | LabelSpace const & | lab_space | ) | const |
- Returns
- Fields given by LabelSpace
- Parameters
-
[in] lab_space LabelSpace for which to get fields.
◆ getFieldsForTimeId()
| std::vector< Field > ansys::dpf::FieldsContainer::getFieldsForTimeId | ( | dp_int | time_id, |
| dp_int | complex_id = 0 |
||
| ) | const |
- Returns
- Real or imaginary (by default real) Fields at given time set.
- Parameters
-
[in] time_id Time Set Id (1 to # of time sets). [in] complex_id Flag indicating to return imaginary part of result (0 = real part, 1 = imaginary part).
◆ getFieldsIndeces()
| std::vector< int > ansys::dpf::FieldsContainer::getFieldsIndeces | ( | LabelSpace const & | lab_space | ) | const |
- Returns
- Field indices for field given by LabelSpace
- Parameters
-
[in] lab_space LabelSpace defining field for which to get indices.
◆ operator[]()
Get field at index.
- Returns
- Field given by index.
- Parameters
-
[in] index Index of field within container.