This class is used to manage global pointers. Overall, the GlobalPointerUtilities class provides a useful utility for retrieving global pointers to entities in a distributed Kratos simulation.
More...
#include <global_pointer_utilities.h>
|
| GlobalPointerUtilities () |
| Default constructor. More...
|
|
virtual | ~GlobalPointerUtilities () |
| Destructor. More...
|
|
template<class TContainerType > |
static std::unordered_map< int, GlobalPointer< typename TContainerType::value_type > > | RetrieveGlobalIndexedPointersMap (const TContainerType &rContainer, const std::vector< int > &rIdList, const DataCommunicator &rDataCommunicator) |
| Retrieves a map of global pointers corresponding to the given entity ids, where the global pointers point to the entities in the container and are tagged with their global rank. More...
|
|
template<class TContainerType > |
static GlobalPointersVector< typename TContainerType::value_type > | LocalRetrieveGlobalPointers (const TContainerType &rContainer, const DataCommunicator &rDataCommunicator) |
| Retrieve global pointers for entities in container, given a data communicator. Only local entities are retrieved. More...
|
|
template<class TContainerType > |
static GlobalPointersVector< typename TContainerType::value_type > | GlobalRetrieveGlobalPointers (const TContainerType &rContainer, const DataCommunicator &rDataCommunicator) |
| Retrieve global pointers for entities in container, given a data communicator. All entities are retrieved. More...
|
|
template<class TContainerType > |
static GlobalPointersVector< typename TContainerType::value_type > | RetrieveGlobalIndexedPointers (const TContainerType &rContainer, const std::vector< int > &rIdList, const DataCommunicator &rDataCommunicator) |
| Retrieve global indexed pointers from container and data communicator. More...
|
|
This class is used to manage global pointers. Overall, the GlobalPointerUtilities class provides a useful utility for retrieving global pointers to entities in a distributed Kratos simulation.
The class provides a method GetGlobalPointers that retrieves a map of global pointers corresponding to the given entity ids. The GetGlobalPointers method takes a reference to a container rContainer that holds the entities, a const reference to a vector of ids rIdList for the entities we need to retrieve, and a reference to a DataCommunicator object rDataCommunicator. The method returns an unordered map of global pointers corresponding to the given entity ids. The method first checks if the execution is distributed, and if so, it finds the rank of the node that owns the entity if it is remote, and gathers everything onto the master_rank processor. It then creates a map of global pointers corresponding to the given entity ids, where the global pointers point to the entities in the container and are tagged with their global rank.
- See also
- GlobalPointer
-
GlobalPointersVector
-
GlobalPointersUnorderedMap
- Author
- Riccardo Rossi
◆ GlobalPointerUtilities()
Kratos::GlobalPointerUtilities::GlobalPointerUtilities |
( |
| ) |
|
|
inline |
◆ ~GlobalPointerUtilities()
virtual Kratos::GlobalPointerUtilities::~GlobalPointerUtilities |
( |
| ) |
|
|
inlinevirtual |
◆ GlobalRetrieveGlobalPointers()
template<class TContainerType >
static GlobalPointersVector< typename TContainerType::value_type > Kratos::GlobalPointerUtilities::GlobalRetrieveGlobalPointers |
( |
const TContainerType & |
rContainer, |
|
|
const DataCommunicator & |
rDataCommunicator |
|
) |
| |
|
inlinestatic |
Retrieve global pointers for entities in container, given a data communicator. All entities are retrieved.
- Parameters
-
rContainer | container of entities from which to retrieve pointers |
rDataCommunicator | data communicator to use for retrieval |
- Returns
- vector of global pointers to entities in container
◆ Info()
virtual std::string Kratos::GlobalPointerUtilities::Info |
( |
| ) |
const |
|
inlinevirtual |
Turn back information as a string.
◆ KRATOS_CLASS_POINTER_DEFINITION()
◆ LocalRetrieveGlobalPointers()
template<class TContainerType >
static GlobalPointersVector< typename TContainerType::value_type > Kratos::GlobalPointerUtilities::LocalRetrieveGlobalPointers |
( |
const TContainerType & |
rContainer, |
|
|
const DataCommunicator & |
rDataCommunicator |
|
) |
| |
|
inlinestatic |
Retrieve global pointers for entities in container, given a data communicator. Only local entities are retrieved.
- Parameters
-
rContainer | container of entities from which to retrieve pointers |
rDataCommunicator | data communicator to use for retrieval |
- Returns
- vector of global pointers to entities in container
◆ PrintData()
virtual void Kratos::GlobalPointerUtilities::PrintData |
( |
std::ostream & |
rOStream | ) |
const |
|
inlinevirtual |
◆ PrintInfo()
virtual void Kratos::GlobalPointerUtilities::PrintInfo |
( |
std::ostream & |
rOStream | ) |
const |
|
inlinevirtual |
Print information about this object.
◆ RetrieveGlobalIndexedPointers()
template<class TContainerType >
static GlobalPointersVector< typename TContainerType::value_type > Kratos::GlobalPointerUtilities::RetrieveGlobalIndexedPointers |
( |
const TContainerType & |
rContainer, |
|
|
const std::vector< int > & |
rIdList, |
|
|
const DataCommunicator & |
rDataCommunicator |
|
) |
| |
|
inlinestatic |
Retrieve global indexed pointers from container and data communicator.
- Parameters
-
rContainer | Container to retrieve pointers from |
rIdList | List of ids to retrieve pointers for |
rDataCommunicator | Communicator to retrieve data from |
- Returns
- GlobalPointersVector containing pointers for all ids in rIdList
- Exceptions
-
KRATOS_ERROR | if an id in rIdList is not found for the current processor rank |
◆ RetrieveGlobalIndexedPointersMap()
template<class TContainerType >
static std::unordered_map< int, GlobalPointer<typename TContainerType::value_type> > Kratos::GlobalPointerUtilities::RetrieveGlobalIndexedPointersMap |
( |
const TContainerType & |
rContainer, |
|
|
const std::vector< int > & |
rIdList, |
|
|
const DataCommunicator & |
rDataCommunicator |
|
) |
| |
|
inlinestatic |
Retrieves a map of global pointers corresponding to the given entity ids, where the global pointers point to the entities in the container and are tagged with their global rank.
If the execution is distributed, it finds the rank of the node that owns the entity if it is remote, and gathers everything onto the master_rank processor.
- Parameters
-
rContainer | a reference to the container that holds the entities |
rIdList | a const reference to a vector of ids for the entities we need to retrieve |
rDataCommunicator | a reference to a DataCommunicator object |
- Returns
- the unordered map of global pointers corresponding to the given entity ids in (id, global_pointer) pairs
The documentation for this class was generated from the following file: