Skip to main content

DPF C++ client library 2023 R2

ansys::dpf::Scoping Class Reference

Last update: 10.07.2023

Define a set of entities by ids. More...

#include <dpf_api.h>

Inheritance diagram for ansys::dpf::Scoping:
ansys::dpf::DpfTypes

Public Member Functions

 Scoping ()
 
 Scoping (std::vector< dp_id > const &ids, ansys::dpf::Location location)
 
 Scoping (std::vector< dp_id > const &ids, ansys::dpf::Location location, Client const *const client)
 
 Scoping (Client const *const client)
 
 Scoping (int id, Client const *const client)
 
 Scoping (Scoping const &)
 
 Scoping (Scoping &&)
 
Scopingoperator= (Scoping const &)
 
Scopingoperator= (Scoping &&)
 
ansys::dpf::Location location () const
 
void setLocation (ansys::dpf::Location location)
 
void setIds (std::vector< dp_id > const &ids)
 
void setIds (dp_id *ids, dp_int size)
 
bool identicalPointers (Scoping const &f) const
 
dp_int size () const
 
dp_id idByIndex (dp_int index) const
 
dp_index indexById (dp_int id) const
 
dp_id at (dp_int index) const
 
const dp_idids (dp_int &size) const
 
DpfVector< int > ids () const
 
void getIds (std::vector< dp_id > &ids_to_fill) const
 
void emplace (dp_index index, dp_id id)
 
std::string hashIds () const
 
void reserve (dp_int size)
 
void resize (dp_int size)
 
Scoping 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 Scoping emptyScoping ()
 

Detailed Description

Define a set of entities by ids.

The scoping is entities ids representing a subset of the model's support. Typically, scoping can represent node ids, element ids, time steps, frequencies, joints... Its location indicates what kind of entity the scoping is referring to. Scopings are used to identify the entities where a field is scoped or to choose (through an input pin) a subset on which an operator should compute its result.

Examples
CompleteRST.cpp, DataApis.cpp, ModelTest.cpp, and OperatorsApis.cpp.

Constructor & Destructor Documentation

◆ Scoping() [1/5]

ansys::dpf::Scoping::Scoping ( )

Create a new scoping.

◆ Scoping() [2/5]

ansys::dpf::Scoping::Scoping ( std::vector< dp_id > const &  ids,
ansys::dpf::Location  location 
)

Create a scoping of ids at a location.

Parameters
[in]idsVector of ids.
[in]locationLocation of scoping.

◆ Scoping() [3/5]

ansys::dpf::Scoping::Scoping ( std::vector< dp_id > const &  ids,
ansys::dpf::Location  location,
Client const *const  client 
)

Create a scoping of ids at a location.

Parameters
[in]idsVector of ids.
[in]locationLocation of scoping.
[in]clientClient instance designating the IP, port and protocol to use.

◆ Scoping() [4/5]

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

Create a new scoping on a server.

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

◆ Scoping() [5/5]

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

Retrieve an existing instance of Scoping on a server.

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

Member Function Documentation

◆ at()

dp_id ansys::dpf::Scoping::at ( dp_int  index) const
Returns
Id at index offset into vector of ids.

◆ deep_copy()

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

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

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

◆ emplace()

void ansys::dpf::Scoping::emplace ( dp_index  index,
dp_id  id 
)

Set offset index into scoping to new id.

Parameters
[in]indexLocation for new id.
[in]idNew id.
Examples
DataApis.cpp.

◆ emptyScoping()

static Scoping ansys::dpf::Scoping::emptyScoping ( )
static

Create an empty scoping.

Returns
Empty Scoping

◆ getIds()

void ansys::dpf::Scoping::getIds ( std::vector< dp_id > &  ids_to_fill) const

Update ids_to_fill with scoping ids.

Parameters
[out]ids_to_fillvector of ids.
Examples
DataApis.cpp.

◆ idByIndex()

dp_id ansys::dpf::Scoping::idByIndex ( dp_int  index) const
Returns
Id at index offset into vector of ids.
Parameters
[in]indexindex into vector of ids.
Examples
DataApis.cpp.

◆ identicalPointers()

bool ansys::dpf::Scoping::identicalPointers ( Scoping const &  f) const

Compare scoping with input scoping f.

Parameters
[in]fScoping with which to compare.

◆ ids() [1/2]

DpfVector< int > ansys::dpf::Scoping::ids ( ) const
Returns
DpfVector of ids array.

◆ ids() [2/2]

const dp_id * ansys::dpf::Scoping::ids ( dp_int size) const
Returns
Pointer to list of ids.
Parameters
[out]sizeLength of list.
Examples
DataApis.cpp.

◆ indexById()

dp_index ansys::dpf::Scoping::indexById ( dp_int  id) const
Returns
Index of id within vector of ids.
-1 if id not found.
Parameters
[in]idid.
Examples
DataApis.cpp.

◆ location()

ansys::dpf::Location ansys::dpf::Scoping::location ( ) const
Returns
Location of ids.
Examples
DataApis.cpp, and ModelTest.cpp.

◆ reserve()

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

Reserve the container of ids.

◆ resize()

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

Resize the container of ids.

◆ setIds() [1/2]

void ansys::dpf::Scoping::setIds ( dp_id ids,
dp_int  size 
)

Update scoping to list of new ids.

Parameters
[in]idsList of ids.
[in]sizeNumber of ids.

◆ setIds() [2/2]

void ansys::dpf::Scoping::setIds ( std::vector< dp_id > const &  ids)

Update scoping to vector of new ids.

Parameters
[in]idsNew ids.
Examples
DataApis.cpp.

◆ setLocation()

void ansys::dpf::Scoping::setLocation ( ansys::dpf::Location  location)

Set location of scoping.

Parameters
[in]locationNew location for scoping.
Examples
DataApis.cpp.

◆ size()

dp_int ansys::dpf::Scoping::size ( ) const
Returns
Number of entries in scoping.
Examples
DataApis.cpp, DataExport.cpp, and ModelTest.cpp.