KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
|
A template class to proxy results, whether they are locally or remotely owned. More...
#include <pointer_communicator.h>
Public Types | |
using | TSendType = std::invoke_result_t< TFunctorType, GlobalPointer< TPointerDataType > & > |
Type alias for the result of applying the functor to a global pointer of TPointerDataType. More... | |
Public Member Functions | |
ResultsProxy (int current_rank, GlobalPointersUnorderedMap< TPointerDataType, TSendType > NonLocalData, TFunctorType UserFunctor, GlobalPointerCommunicator< TPointerDataType > *pPointerComm) | |
Constructor. More... | |
virtual | ~ResultsProxy () |
Destructor. More... | |
TSendType | Get (GlobalPointer< TPointerDataType > &rGlobalPointer) const |
Returns the effect of "user_function(rGlobalPointer)" whether the rGlobalPointer is locally or remotely owned. More... | |
TSendType | Get (const GlobalPointer< TPointerDataType > &rGlobalPointer) const |
Overload for constant GlobalPointer. More... | |
bool | Has (GlobalPointer< TPointerDataType > &rGlobalPointer) const |
Checks if the node has the GlobalPointer. More... | |
bool | Has (const GlobalPointer< TPointerDataType > &rGlobalPointer) const |
Overload for constant GlobalPointer. More... | |
void | Update () |
Updates the NonLocalData using the user functor and communicator. More... | |
A template class to proxy results, whether they are locally or remotely owned.
This class acts as a proxy for results. It holds data in a map and applies the user-provided functor to it. If data is locally owned, it applies the functor directly. If the data is remotely owned, it retrieves it from the map.
TPointerDataType | - The datatype for the pointer. |
TFunctorType | - The functor type to be used in processing. |
using Kratos::ResultsProxy< TPointerDataType, TFunctorType >::TSendType = std::invoke_result_t<TFunctorType,GlobalPointer<TPointerDataType>&> |
Type alias for the result of applying the functor to a global pointer of TPointerDataType.
|
inline |
Constructor.
current_rank | Current rank of the node. |
NonLocalData | Data that is not local to the node. |
UserFunctor | Functor to be used for computation. |
pPointerComm | Pointer to the communicator. |
|
inlinevirtual |
Destructor.
|
inline |
Overload for constant GlobalPointer.
rGlobalPointer | The constant pointer that is being checked. |
|
inline |
Returns the effect of "user_function(rGlobalPointer)" whether the rGlobalPointer is locally or remotely owned.
rGlobalPointer | The pointer that is being checked. |
|
inline |
Overload for constant GlobalPointer.
rGlobalPointer | The constant pointer that is being checked. |
|
inline |
Checks if the node has the GlobalPointer.
rGlobalPointer | The pointer that is being checked. |
|
inline |
Updates the NonLocalData using the user functor and communicator.