Skip to main content

DPF Cpp Client Library 2026 R1

Class ansys::dpf::FieldsContainer

Last update: 25.03.2026

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.

Inherits from:

  • ansys::dpf::CollectionBase

Members

Friends

Public functions

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer()

Return type:

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer(Client const *const client)

Create a new fields container on a server.

Parameters:

  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function FieldsContainer

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:

  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.
  • std::vector< std::string > const & labels: [in] Labels for fields.

Return type:

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer(int id, Client const *const client)

Retrieve an existing instance of FieldsContainer on a server.

Parameters:

  • int id: [in] Id of the FieldsContainer object on the server's database.
  • Client const *const client: [in] Client instance designating the IP, port and protocol to use.

Return type:

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer(const std::vector< std::string > &labels)

Create a collection of fields with the given labels.

Parameters:

  • const std::vector< std::string > & labels: [in] Labels for fields.

Return type:

Function ~FieldsContainer

virtual ansys::dpf::FieldsContainer::~FieldsContainer()

Return type:

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer(FieldsContainer const &)

Parameters:

  • FieldsContainer const &

Return type:

Function FieldsContainer

ansys::dpf::FieldsContainer::FieldsContainer(FieldsContainer &&) noexcept

Parameters:

  • FieldsContainer &&

Return type:

Function operator=

FieldsContainer & ansys::dpf::FieldsContainer::operator=(FieldsContainer const &)

Parameters:

  • FieldsContainer const &

Return type: FieldsContainer &

Function operator=

FieldsContainer & ansys::dpf::FieldsContainer::operator=(FieldsContainer &&) noexcept

Parameters:

  • FieldsContainer &&

Return type: FieldsContainer &

Function operator[]

Field ansys::dpf::FieldsContainer::operator[](dp_int index)

Get field at index. Returns:

Field given by index.

Parameters:

  • dp_int index: [in] Index of field within container.

Return type: Field

Function at

Field ansys::dpf::FieldsContainer::at(dp_index index)

Get field at index. Returns:

Field given by index.

Parameters:

  • dp_index index: [in] Index of field within container.

Return type: Field

Function at

const Field ansys::dpf::FieldsContainer::at(dp_index index) const

Get field at index. Returns:

Field given by index.

Parameters:

Return type: const Field

Function update

void ansys::dpf::FieldsContainer::update(Field &f, dp_index index)

Update Field at index

Parameters:

  • Field & f: [in] New field data.
  • dp_index index: [in] Index of field within container.

Return type: void

Function add

void ansys::dpf::FieldsContainer::add(LabelSpace const &lab_space, Field const &f, bool can_replace=true)

Add Field to LabelSpace.

Parameters:

  • LabelSpace const & lab_space: [in] LabelSpace to which to add Field.
  • Field const & f: [in] Field to add to LabelSpace.
  • bool can_replace = true : [in] if can_replace is false, then, the entity is pushed back without checking if the label space already exists.

Return type: void

Function getFields

std::vector< Field > ansys::dpf::FieldsContainer::getFields(LabelSpace const &lab_space) const

Returns:

Fields given by LabelSpace

Parameters:

Return type: std::vector< Field >

Function getField

Field ansys::dpf::FieldsContainer::getField(LabelSpace const &lab_space) const

Returns:

First Field given by LabelSpace

Parameters:

Return type: Field

Function getFieldsIndeces

std::vector< int > ansys::dpf::FieldsContainer::getFieldsIndeces(LabelSpace const &lab_space) const

Returns:

Field indices for field given by LabelSpace

Parameters:

Return type: std::vector< int >

Function getMatchingField

Field ansys::dpf::FieldsContainer::getMatchingField(LabelSpace const &label_space) const

Returns:

First matching Field for given label space.

Parameters:

Return type: Field

Function getMatchingFieldIndices

DpfVector< dp_index > ansys::dpf::FieldsContainer::getMatchingFieldIndices(LabelSpace const &label_space) const

Returns:

Vector of matching Field to the given label space.

Parameters:

  • LabelSpace const & label_space: [in] Label space for which to get entries.

Return type: DpfVector< dp_index >

Function 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:

  • dp_int time_id: [in] Time Set Id (1 to # of time sets).
  • dp_int complex_id = 0 : [in] Flag indicating to return imaginary part of result (0 = real part, 1 = imaginary part).

Return type: std::vector< Field >

Function 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:

Return type: FieldsContainer

Function 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:

Return type: FieldsContainer

Public static functions

Function emptyFieldsContainer

static FieldsContainer ansys::dpf::FieldsContainer::emptyFieldsContainer()

Create an empty fields container. Returns:

Empty FieldsContainer.

Return type: FieldsContainer

Connect with Ansys