Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::MeshesContainer Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::MeshesContainer:
ansys::dpf::DpfTypes

Public Member Functions

 MeshesContainer (MeshesContainer const &)
 
 MeshesContainer (MeshesContainer &&)
 
 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 &&)
 
MeshedRegion operator[] (dp_int index)
 
dp_int size () const
 
MeshedRegion at (dp_index index)
 
const MeshedRegion at (dp_index index) const
 
void update (MeshedRegion &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 &labels, MeshedRegion const &f)
 
dp_int getSizeFor (LabelSpace const &label_space) const
 
std::vector< MeshedRegiongetMeshes (LabelSpace const &label_space) const
 
MeshedRegion getMesh (LabelSpace const &label_space) const
 
std::vector< std::string > labels () const
 
LabelSpace getLabelSpace (dp_index index) const
 
bool hasLabel (std::string const &label) const
 @ return Indication that given label exists within mesh container. More...
 
Scoping labelScoping (std::string const &label) const
 
MeshesContainer createSubMeshesContainer (LabelSpace const &lab_space) const
 create a MeshesContainer with all the meshes corresponding to the label space in input
 
std::string name () const
 
void setName (std::string name)
 
dp_id id () const
 @ return Id of mesh container.
 
void setId (dp_id id)
 
MeshesContainer 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 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.

◆ addLabel() [1/2]

void ansys::dpf::MeshesContainer::addLabel ( std::string const &  label)

Add label for new mesh group in mesh container.

Parameters
[in]labelNew group label.
Examples
DataExport.cpp.

◆ addLabel() [2/2]

void ansys::dpf::MeshesContainer::addLabel ( std::string const &  label,
dp_id  default_value 
)

Add label with value for new mesh group in mesh container.

Parameters
[in]labelNew group label.
[in]default_valueValue for label.

◆ addLabels()

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

Add list of labels for new mesh groups in mesh container.

Parameters
[in]labelsNew groups labels.

◆ 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.

◆ getLabelSpace()

LabelSpace ansys::dpf::MeshesContainer::getLabelSpace ( dp_index  index) const
Returns
LabelSpace for given index in mesh container.
Parameters
[in]indexIndex of meshes container for which to get label space.

◆ 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.

◆ getSizeFor()

dp_int ansys::dpf::MeshesContainer::getSizeFor ( LabelSpace const &  label_space) const
Returns
Number of meshed regions for given label space.
Parameters
[in]label_spaceLabel space for which to get number of meshed regions.

◆ hasLabel()

bool ansys::dpf::MeshesContainer::hasLabel ( std::string const &  label) const

@ return Indication that given label exists within mesh container.

Parameters
[in]labelLabel for which to check existence.

◆ labels()

std::vector< std::string > ansys::dpf::MeshesContainer::labels ( ) const
Returns
Vector of labels for mesh container.

◆ labelScoping()

Scoping ansys::dpf::MeshesContainer::labelScoping ( std::string const &  label) const
Returns
a scoping of the available ids in the meshes container for a given label
Parameters
[in]labelName of label.

◆ name()

std::string ansys::dpf::MeshesContainer::name ( ) const
Returns
Name of mesh container.

◆ operator[]()

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

◆ reserve()

void ansys::dpf::MeshesContainer::reserve ( dp_int  size)

Reserve space for given number of meshed regions.

Parameters
[in]sizeExpected number of meshed regions.

◆ resize()

void ansys::dpf::MeshesContainer::resize ( dp_int  size)

Resize meshes container to given number of meshed regions.

Parameters
[in]sizeNumber of meshed regions in container.

◆ setId()

void ansys::dpf::MeshesContainer::setId ( dp_id  id)

Set Id of mesh container.

Parameters
[in]idId for mesh container.

◆ setName()

void ansys::dpf::MeshesContainer::setName ( std::string  name)

Set name of mesh container.

Parameters
[in]nameName of mesh container.

◆ size()

dp_int ansys::dpf::MeshesContainer::size ( ) const
Returns
Number of meshed regions in 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.