ansys::dpf::FieldsContainer Class Reference
Last update: 10.07.2023
ansys::dpf::FieldsContainer Class Reference
Contains a group of fields. More...
#include <dpf_api.h>
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 &&) | |
FieldsContainer & | operator= (FieldsContainer const &) |
FieldsContainer & | operator= (FieldsContainer &&) |
Field | operator[] (dp_int index) |
dp_int | size () const |
Field | at (dp_index index) |
const Field | at (dp_index index) const |
void | update (Field &f, dp_index index) |
void | reserve (dp_int size) |
void | resize (dp_int size) |
void | addLabel (std::string const &label) |
void | addLabel (std::string const &label, dp_id default_value) |
void | addLabels (std::vector< std::string > const &labels) |
void | add (LabelSpace const &lab_space, Field const &f) |
dp_int | getSizeFor (LabelSpace const &lab_space) const |
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< std::string > | labels () const |
LabelSpace | getLabelSpace (dp_index index) const |
Scoping | labelScoping (std::string const &label) const |
std::vector< Field > | getFieldsForTimeId (dp_int time_id, dp_int complex_id=0) const |
bool | hasLabel (std::string const &label) const |
Support | support (std::string const &label=labels::time) const |
void | setSupport (ansys::dpf::Support const &support, std::string const &label=labels::time) |
void | setSupport (ansys::dpf::TimeFreqSupport const &support, std::string const &label=labels::time) |
FieldsContainer | createSubFieldsContainer (LabelSpace const &lab_space) const |
std::string | name () const |
void | setName (std::string name) |
dp_id | id () const |
void | setId (dp_id id) |
FieldsContainer | deep_copy (ansys::dpf::Client const *const client=nullptr) 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 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.
◆ addLabel() [1/2]
void ansys::dpf::FieldsContainer::addLabel | ( | std::string const & | label | ) |
◆ addLabel() [2/2]
void ansys::dpf::FieldsContainer::addLabel | ( | std::string const & | label, |
dp_id | default_value | ||
) |
Add new label with value.
- Parameters
-
[in] label New label. [in] default_value Value of label.
◆ addLabels()
void ansys::dpf::FieldsContainer::addLabels | ( | std::vector< std::string > const & | labels | ) |
◆ 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.
◆ getLabelSpace()
LabelSpace ansys::dpf::FieldsContainer::getLabelSpace | ( | dp_index | index | ) | const |
- Returns
- LabelSpace for given field index.
- Parameters
-
[in] index Index of field.
◆ getSizeFor()
dp_int ansys::dpf::FieldsContainer::getSizeFor | ( | LabelSpace const & | lab_space | ) | const |
- Returns
- Number of fields for given LabelSpace.
- Parameters
-
[in] lab_space LabelSpace for which to get number of fields.
◆ hasLabel()
bool ansys::dpf::FieldsContainer::hasLabel | ( | std::string const & | label | ) | const |
- Returns
- Indication that FieldsContainer has field given by label.
- Parameters
-
[in] label Field label.
◆ id()
dp_id ansys::dpf::FieldsContainer::id | ( | ) | const |
- Returns
- Id of FieldsContainer.
◆ labels()
std::vector< std::string > ansys::dpf::FieldsContainer::labels | ( | ) | const |
- Returns
- Vector of labels of fields container.
◆ labelScoping()
Scoping ansys::dpf::FieldsContainer::labelScoping | ( | std::string const & | label | ) | const |
◆ name()
std::string ansys::dpf::FieldsContainer::name | ( | ) | const |
- Returns
- Name of FieldsContainer.
◆ operator[]()
Get field at index.
- Returns
- Field given by index.
- Parameters
-
[in] index Index of field within container.
◆ reserve()
void ansys::dpf::FieldsContainer::reserve | ( | dp_int | size | ) |
Reserve space for fields
- Parameters
-
[in] size Number of fields for which to reserve space.
◆ resize()
void ansys::dpf::FieldsContainer::resize | ( | dp_int | size | ) |
Resize container to given size.
- Parameters
-
[in] size Set container to number of fields.
◆ setId()
void ansys::dpf::FieldsContainer::setId | ( | dp_id | id | ) |
Set Id of FieldsContainer.
- Parameters
-
[in] id New id.
◆ setName()
void ansys::dpf::FieldsContainer::setName | ( | std::string | name | ) |
Set name of FieldsContainer.
- Parameters
-
[in] name New name.
◆ setSupport() [1/2]
void ansys::dpf::FieldsContainer::setSupport | ( | ansys::dpf::Support const & | support, |
std::string const & | label = labels::time |
||
) |
◆ setSupport() [2/2]
void ansys::dpf::FieldsContainer::setSupport | ( | ansys::dpf::TimeFreqSupport const & | support, |
std::string const & | label = labels::time |
||
) |
Set TimeFreqSupport for given label.
◆ size()
dp_int ansys::dpf::FieldsContainer::size | ( | ) | const |
Get Number of fields in container.
- Returns
- Number of fields.
- Examples
- AveragingTest.cpp, DataExport.cpp, and ModelTest.cpp.
◆ support()
Support ansys::dpf::FieldsContainer::support | ( | std::string const & | label = labels::time | ) | const |