Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::ScopingsContainer Class Reference

Last update: 10.07.2023

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::ScopingsContainer:
ansys::dpf::DpfTypes

Public Member Functions

 ScopingsContainer (ScopingsContainer const &)
 
 ScopingsContainer (ScopingsContainer &&)
 
 ScopingsContainer (Client const *const client)
 
 ScopingsContainer (Client const *const client, std::vector< std::string > const &labels)
 
 ScopingsContainer (int id, Client const *const client)
 
 ScopingsContainer (std::vector< std::string > const &labels)
 
ScopingsContaineroperator= (ScopingsContainer const &)
 
ScopingsContaineroperator= (ScopingsContainer &&)
 
Scoping operator[] (dp_int index)
 
dp_int size () const
 
Scoping at (dp_index index)
 
const Scoping at (dp_index index) const
 
void update (Scoping &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, Scoping const &f)
 
dp_int getSizeFor (LabelSpace const &labels) const
 
std::vector< ScopinggetScopings (LabelSpace const &labels) const
 
std::vector< dp_indexgetScopingsIndices (LabelSpace const &lab_space) const
 
Scoping getScoping (LabelSpace const &labels) const
 
std::vector< std::string > labels () const
 
LabelSpace getLabelSpace (dp_index index) const
 
bool hasLabel (std::string const &label) const
 
Scoping labelScoping (std::string const &label) const
 @ return Scoping for given label. More...
 
ScopingsContainer createSubScopingsContainer (LabelSpace const &lab_space) const
 
std::string name () const
 
void setName (std::string name)
 
dp_id id () const
 
void setId (dp_id id)
 
ScopingsContainer 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 ScopingsContainer emptyScopingsContainer ()
 

Detailed Description

Contains a group of scopings.

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

Generally, a defined ScopingsContainer will contain Scoping entities to apply on the MeshedRegion entities of a corresponding MeshesContainer.

See also
Scoping
Using collections and labels
Examples
AveragingTest.cpp, and WorkflowExamples.cpp.

Constructor & Destructor Documentation

◆ ScopingsContainer() [1/4]

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

Create a new scopings container on a server.

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

◆ ScopingsContainer() [2/4]

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

Create a group of scopings with the given labels on a server.

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

◆ ScopingsContainer() [3/4]

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

Retrieve an existing instance of ScopingsContainer on a server.

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

◆ ScopingsContainer() [4/4]

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

Create a group of scopings with the given labels.

Parameters
[in]labelsLabels for group of scopings.

Member Function Documentation

◆ add()

void ansys::dpf::ScopingsContainer::add ( LabelSpace const &  labels,
Scoping const &  f 
)

Add new scoping with given labels to group.

Parameters
[in]labelsLabel space to use for new scoping.
[in]fScoping to add to group.

◆ addLabel() [1/2]

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

Add new scoping with given label to group of scopings.

Parameters
[in]labelLabel for new scoping.

◆ addLabel() [2/2]

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

Add label with value for new scoping in group of scopings.

Parameters
[in]labelLabel for new scoping.
[in]default_valueValue for label.

◆ addLabels()

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

Add list of labels for new scopings in group.

Parameters
[in]labelsLabels for new scopings.

◆ at() [1/2]

Scoping ansys::dpf::ScopingsContainer::at ( dp_index  index)
Returns
Scoping at given index.
Parameters
[in]indexIndex of scoping to get.

◆ at() [2/2]

const Scoping ansys::dpf::ScopingsContainer::at ( dp_index  index) const
Returns
Scoping at given index.
Parameters
[in]indexIndex of scoping to get.

◆ createSubScopingsContainer()

ScopingsContainer ansys::dpf::ScopingsContainer::createSubScopingsContainer ( LabelSpace const &  lab_space) const

Create a new ScopingsContainer with all the scopings corresponding to the label space in input

Parameters
[in]lab_spaceLabel space for which to create new scopings container.

◆ deep_copy()

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

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

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

◆ emptyScopingsContainer()

static ScopingsContainer ansys::dpf::ScopingsContainer::emptyScopingsContainer ( )
static

Create an empty scopings container.

Returns
Empty ScopingsContainer.

◆ getLabelSpace()

LabelSpace ansys::dpf::ScopingsContainer::getLabelSpace ( dp_index  index) const
Returns
Label space for given index into scoping container.
Parameters
[in]indexIndex for which to get label space.

◆ getScoping()

Scoping ansys::dpf::ScopingsContainer::getScoping ( LabelSpace const &  labels) const
Returns
First scoping for given label space.
Parameters
[in]labelsLabel space for which to get first scoping.

◆ getScopings()

std::vector< Scoping > ansys::dpf::ScopingsContainer::getScopings ( LabelSpace const &  labels) const
Returns
Vector of scopings for given label space.
Parameters
[in]labelsLabel space for whict to get scopings.

◆ getScopingsIndices()

std::vector< dp_index > ansys::dpf::ScopingsContainer::getScopingsIndices ( LabelSpace const &  lab_space) const
Returns
Scoping indices for scopings given by LabelSpace
Parameters
[in]lab_spaceLabelSpace defining scopings for which to get indices.

◆ getSizeFor()

dp_int ansys::dpf::ScopingsContainer::getSizeFor ( LabelSpace const &  labels) const
Returns
Number of scopings for given label space.
Parameters
[in]labelsLabel space for which to get number of scopings.

◆ hasLabel()

bool ansys::dpf::ScopingsContainer::hasLabel ( std::string const &  label) const
Returns
Indication if given label exists withing scoping container.
Parameters
[in]labelLabel for which to check existence.

◆ id()

dp_id ansys::dpf::ScopingsContainer::id ( ) const
Returns
Id of scopings container.

◆ labels()

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

◆ labelScoping()

Scoping ansys::dpf::ScopingsContainer::labelScoping ( std::string const &  label) const

@ return Scoping for given label.

Parameters
[in]labelLabel for which to get scoping.

◆ name()

std::string ansys::dpf::ScopingsContainer::name ( ) const
Returns
Name of scopings container.

◆ operator[]()

Scoping ansys::dpf::ScopingsContainer::operator[] ( dp_int  index)
Returns
Scoping at given index.
Parameters
[in]indexIndex of scoping.

◆ reserve()

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

Reserve space for given number of scopings.

Parameters
[in]sizeNumber of scopings.

◆ resize()

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

Resize container to given number of scopings.

Parameters
[in]sizeNumber of scopings.

◆ setId()

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

Set Id of scopings container.

Parameters
[in]idIds for scopings container.

◆ setName()

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

Set name of scopings container.

Parameters
[in]nameName for scopings container.

◆ size()

dp_int ansys::dpf::ScopingsContainer::size ( ) const
Returns
Number of scopings.
Examples
AveragingTest.cpp.

◆ update()

void ansys::dpf::ScopingsContainer::update ( Scoping f,
dp_index  index 
)

Update Scoping at given index.

Parameters
[in]fNew scoping.
[in]indexIndex of scoping to update.