Skip to main content

DPF C++ Client Library 2025 R2

ansys::dpf::MeshesContainer Class Reference

Last update: 16.07.2025

#include <dpf_api.h>

Inherits ansys::dpf::CollectionBase.

Public Member Functions

 MeshesContainer (MeshesContainer const &)
 
 MeshesContainer (MeshesContainer &&) noexcept
 
 MeshesContainer (Client const *const client)
 
 MeshesContainer (Client const *const client, std::vector< std::string > const &labels)
 
 MeshesContainer (int id, Client const *const client)
 
 MeshesContainer (std::vector< std::string > const &labels)
 
MeshesContaineroperator= (MeshesContainer const &)
 
MeshesContaineroperator= (MeshesContainer &&) noexcept
 
MeshedRegion operator[] (dp_int index)
 
MeshedRegion at (dp_index index)
 
const MeshedRegion at (dp_index index) const
 
void update (MeshedRegion &f, dp_index index)
 
void add (LabelSpace const &labels, MeshedRegion const &f)
 
std::vector< MeshedRegiongetMeshes (LabelSpace const &label_space) const
 
MeshedRegion getMesh (LabelSpace const &label_space) const
 
std::vector< int > getMeshesIndices (LabelSpace const &lab_space) const
 
MeshesContainer createSubMeshesContainer (LabelSpace const &lab_space) const
 create a MeshesContainer with all the meshes corresponding to the label space in input
 
MeshesContainer deep_copy (ansys::dpf::Client const *const client=nullptr) const
 

Static Public Member Functions

static MeshesContainer emptyMeshesContainer ()
 

Detailed Description

Contains a group of meshes. The meshes container is designed as a set of meshes ordered through labels and ids. Labels identify how the fields are filtered. The most common meshes container have the label "body" with ids corresponding to each body entity.

See also
MeshedRegion
Using collections and labels
Examples
DataExport.cpp.

Constructor & Destructor Documentation

◆ MeshesContainer() [1/4]

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

Create a new meshes container on a server.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ MeshesContainer() [2/4]

ansys::dpf::MeshesContainer::MeshesContainer ( Client const *const  client,
std::vector< std::string > const &  labels 
)

Create a collection of meshes with the given labels on a server.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.
[in]labelsLabels for meshes.

◆ MeshesContainer() [3/4]

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

Retrieve an existing instance of MeshesContainer on a server.

Parameters
[in]idId of the MeshesContainer object on the server's database.
[in]clientClient instance designating the IP, port and protocol to use.

◆ MeshesContainer() [4/4]

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

Create mesh container for a group of meshed regions with the given labels.

Parameters
[in]labelsLabels for group of meshed regions.

Member Function Documentation

◆ add()

void ansys::dpf::MeshesContainer::add ( LabelSpace const &  labels,
MeshedRegion const &  f 
)

Add meshed region with given label space.

Parameters
[in]labelsLabel space for meshed region.
[in]fMeshed region to add.
Examples
DataExport.cpp.

◆ at() [1/2]

MeshedRegion ansys::dpf::MeshesContainer::at ( dp_index  index)
Returns
Meshed region for given index.
Parameters
[in]indexIndex of meshed region to get.

◆ at() [2/2]

const MeshedRegion ansys::dpf::MeshesContainer::at ( dp_index  index) const
Returns
Meshed region for given index.
Parameters
[in]indexIndex of meshed region to get.

◆ deep_copy()

MeshesContainer ansys::dpf::MeshesContainer::deep_copy ( ansys::dpf::Client const *const  client = nullptr) const

Create a new MeshesContainer on a server by copying all the data of this MeshesContainer.

Parameters
[in]clientClient instance designating the IP, port and protocol to use.

◆ emptyMeshesContainer()

static MeshesContainer ansys::dpf::MeshesContainer::emptyMeshesContainer ( )
static

Create an empty mesh container.

Returns
Empty mesh container.

◆ getMesh()

MeshedRegion ansys::dpf::MeshesContainer::getMesh ( LabelSpace const &  label_space) const
Returns
First meshed region for given label space.
Parameters
[in]label_spaceLabel space for which to get meshed region.

◆ getMeshes()

std::vector< MeshedRegion > ansys::dpf::MeshesContainer::getMeshes ( LabelSpace const &  label_space) const
Returns
Vector of meshed regions for given label space.
Parameters
[in]label_spaceLabel space for which to get meshed regions.

◆ operator[]()

MeshedRegion ansys::dpf::MeshesContainer::operator[] ( dp_int  index)
Returns
Meshed region for given index.
Parameters
[in]indexIndex of mesh within container.

◆ update()

void ansys::dpf::MeshesContainer::update ( MeshedRegion f,
dp_index  index 
)

Update a meshed region at index.

Parameters
[in]fNew meshed region.
[in]indexIndex of meshed region to update.

Connect with Ansys