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.
|
Proxy class to update local and non-local data. More...
#include <pointer_map_communicator.h>
Public Types | |
Type definitions | |
using | ProxyType = ApplyProxy< TPointerDataType, TValueDataType, TApplyFunctor > |
using | TGPMapCommunicator = GlobalPointerMapCommunicator< TPointerDataType, TValueDataType > |
using | GlobalPointerType = GlobalPointer< TPointerDataType > |
using | DataVectorType = std::vector< TValueDataType > |
Public Member Functions | |
Life cycle | |
ApplyProxy (const TApplyFunctor &rApplyFunctor, TGPMapCommunicator &rPointerCommunicator) | |
Construct a new Apply Proxy object. More... | |
Public operations | |
void | Assign (GlobalPointerType &rGlobalPointer, const TValueDataType &rValue) |
Assigns value of the GlobalPointer. More... | |
void | SendAndApplyRemotely () |
This method does all the communication. More... | |
Friends | |
Friend class definitions | |
class | GlobalPointerMapCommunicator< TPointerDataType, TValueDataType > |
Proxy class to update local and non-local data.
This class is used to update local and non-local data with given TApplyFunctor and TApplyFunctor is used to update local TPointerDataType data, Data belonging to remote gps will be stored, and applied after communication in their owning rank.
Example:
Apply Update method with following Global Pointer map Rank: 0 Map Key (using node id) TEMPERATURE 1 5 2 10
Rank: 1 Map Key (using node id) TEMPERATURE 1 6 3 2
Rank: 2 Empty Global Pointer map
Signature of TApplyFunctor: void(TPointerDataType& rPointerDataTypeObject, const TValueDataType& NewValue)
TPointerDataType | |
TValueDataType | |
TApplyFunctor |
using Kratos::ApplyProxy< TPointerDataType, TValueDataType, TApplyFunctor >::DataVectorType = std::vector<TValueDataType> |
using Kratos::ApplyProxy< TPointerDataType, TValueDataType, TApplyFunctor >::GlobalPointerType = GlobalPointer<TPointerDataType> |
using Kratos::ApplyProxy< TPointerDataType, TValueDataType, TApplyFunctor >::ProxyType = ApplyProxy<TPointerDataType, TValueDataType, TApplyFunctor> |
using Kratos::ApplyProxy< TPointerDataType, TValueDataType, TApplyFunctor >::TGPMapCommunicator = GlobalPointerMapCommunicator<TPointerDataType, TValueDataType> |
|
inline |
Construct a new Apply Proxy object.
rApplyFunctor | Thread safe update lambda method |
rPointerCommunicator | Map communicator |
|
inline |
Assigns value of the GlobalPointer.
This method assigns gp value by rValue using mrApplyFunctor in the case if given rGlobalPointer is a local gp, otherwise mrNonLocalGlobalPointerMapsVector and mrNonLocalDataValueMapsVector are used to store new gp and value, which will be used in mpi communication.
In the case of serial job, this method calls AssignLocalData, where no checks are done to ensure gps are local because all gps are local.
In case of distributed job, this method calls AssignLocalAndRemoteData where checks are performed to identify gps are local or non-local, based on that mrApplyFunctor methods are called or values corresponding to remote gps are stored.
This does not have additional cost in serial run (except for function pointer call)
rGP | Global pointer of the destination |
rValue | Value to be used in assigning |
|
inline |
This method does all the communication.
This method should be called once (or least amount of times) since this involves doing mpi communication to update remote gp values.
This does not have any cost in the serial run.
Ghost mesh synchronization needs to be done afterwards.
|
friend |