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.
List of all members
Kratos::GatherModelPartUtility Class Reference

#include <gather_modelpart_utility.h>

Collaboration diagram for Kratos::GatherModelPartUtility:

Public Member Functions

Life Cycle
 GatherModelPartUtility (const int GatherRank, ModelPart &rOriginModelPart, ModelPart &rDestinationModelPart)
 Default constructor. More...
 
 GatherModelPartUtility (const int GatherRank, ModelPart &rOriginModelPart, const int MeshId, ModelPart &rDestinationModelPart)
 Default constructor. More...
 
Input and output
std::string Info () const
 Turn back information as a string. More...
 
void PrintInfo (std::ostream &rOStream) const
 Print information about this object. More...
 
void PrintData (std::ostream &rOStream) const
 Print object's data. More...
 

Type Definitions

using NodesContainerType = ModelPart::NodesContainerType
 Nodes container definition. More...
 
using ElementsContainerType = ModelPart::ElementsContainerType
 Elements container definition. More...
 
using ConditionsContainerType = ModelPart::ConditionsContainerType
 Conditions container definition. More...
 
 KRATOS_CLASS_POINTER_DEFINITION (GatherModelPartUtility)
 Pointer definition of GatherModelPartUtility. More...
 

Operations

void GatherOnMaster ()
 This function gathers the model part on the master rank. More...
 
template<class TDataType >
void GatherOnMaster (const Variable< TDataType > &rVariable)
 The function gathers the model part from the master rank to the other ranks. More...
 
template<class TDataType >
void ScatterFromMaster (const Variable< TDataType > &rVariable)
 The function scatters the model part from the master rank to the other ranks. More...
 
static void GatherEntitiesFromOtherPartitions (ModelPart &rModelPart, const std::map< int, std::vector< std::size_t >> &rNodesToBring, const std::map< int, std::vector< std::size_t >> &rElementsToBring, const std::map< int, std::vector< std::size_t >> &rConditionsToBring, const bool CallExecuteAfterBringingEntities=true, const int EchoLevel=0)
 Function to gather entities from other partitions. More...
 
static void GatherNodesFromOtherPartitions (ModelPart &rModelPart, const std::map< int, std::vector< std::size_t >> &rNodesToBring, const bool CallExecuteAfterBringingEntities=true, const int EchoLevel=0)
 Function to gather nodes from other partitions. More...
 
static void GatherElementsFromOtherPartitions (ModelPart &rModelPart, const std::map< int, std::vector< std::size_t >> &rElementsToBring, const bool CallExecuteAfterBringingEntities=true, const int EchoLevel=0)
 Function to gather elements from other partitions. More...
 
static void GatherConditionsFromOtherPartitions (ModelPart &rModelPart, const std::map< int, std::vector< std::size_t >> &rConditionsToBring, const bool CallExecuteAfterBringingEntities=true, const int EchoLevel=0)
 Function to gather conditions from other partitions. More...
 

Member Typedef Documentation

◆ ConditionsContainerType

Conditions container definition.

◆ ElementsContainerType

Elements container definition.

◆ NodesContainerType

Nodes container definition.

Constructor & Destructor Documentation

◆ GatherModelPartUtility() [1/2]

Kratos::GatherModelPartUtility::GatherModelPartUtility ( const int  GatherRank,
ModelPart rOriginModelPart,
ModelPart rDestinationModelPart 
)
inline

Default constructor.

This function is designed to obtain data from "origin_model_part.GetMesh(mesh_id)", copy it to a new model part and make rank "gather_rank" to have a copy of it. Transferred nodes will be treated as ghost on the gather_rank

Parameters
GatherRankMPI rank to which the model part is gathered
rOriginModelPartModel part on which the origin mesh is contained
rDestinationModelPartModel part to which we gather the data

◆ GatherModelPartUtility() [2/2]

GatherModelPartUtility::GatherModelPartUtility ( const int  GatherRank,
ModelPart rOriginModelPart,
const int  MeshId,
ModelPart rDestinationModelPart 
)

Default constructor.

This function is designed to obtain data from "origin_model_part.GetMesh(mesh_id)", copy it to a new model part and make rank "gather_rank" to have a copy of it. Transferred nodes will be treated as ghost on the gather_rank

Parameters
GatherRankMPI rank to which the model part is gathered
rOriginModelPartModel part on which the origin mesh is contained
MeshIdId of the mesh which contains the data
rDestinationModelPartModel part to which we gather the data

Member Function Documentation

◆ GatherConditionsFromOtherPartitions()

void GatherModelPartUtility::GatherConditionsFromOtherPartitions ( ModelPart rModelPart,
const std::map< int, std::vector< std::size_t >> &  rConditionsToBring,
const bool  CallExecuteAfterBringingEntities = true,
const int  EchoLevel = 0 
)
static

Function to gather conditions from other partitions.

This function is intended to gather conditions from other partitions. The map indicates the partitions to gather and the vector the conditions to gather from each partition. In the current serial case it does nothing.

Parameters
rModelPartModel part to gather entities from other partitions
rConditionsToBringConditions to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented. The map represents the following. The key (int) the rank where to bring the conditions, and the vector of indexes, the ids of the conditions to bring
CallExecuteAfterBringingEntitiesCall Execute after gathering conditions
EchoLevelThe verbosity level

◆ GatherElementsFromOtherPartitions()

void GatherModelPartUtility::GatherElementsFromOtherPartitions ( ModelPart rModelPart,
const std::map< int, std::vector< std::size_t >> &  rElementsToBring,
const bool  CallExecuteAfterBringingEntities = true,
const int  EchoLevel = 0 
)
static

Function to gather elements from other partitions.

This function is intended to gather elements from other partitions. The map indicates the partitions to gather and the vector the elements to gather from each partition. In the current serial case it does nothing.

Parameters
rModelPartModel part to gather elements from other partitions
rElementsToBringElements to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented. The map represents the following. The key (int) the rank where to bring the elements, and the vector of indexes, the ids of the elements to bring
CallExecuteAfterBringingEntitiesCall Execute after gathering elements
EchoLevelThe verbosity level

◆ GatherEntitiesFromOtherPartitions()

void GatherModelPartUtility::GatherEntitiesFromOtherPartitions ( ModelPart rModelPart,
const std::map< int, std::vector< std::size_t >> &  rNodesToBring,
const std::map< int, std::vector< std::size_t >> &  rElementsToBring,
const std::map< int, std::vector< std::size_t >> &  rConditionsToBring,
const bool  CallExecuteAfterBringingEntities = true,
const int  EchoLevel = 0 
)
static

Function to gather entities from other partitions.

This function is intended to gather entities from other partitions. The map indicates the partitions to gather and the vector the entities to gather from each partition. In the current serial case it does nothing. The map represents the following. The key (int) the rank where to bring the entities, and the vector of indexes, the ids of the entities to bring

Parameters
rModelPartModel part to gather entities from other partitions
rNodesToBringNodes to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented.
rElementsToBringElements to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented.
rConditionsToBringConditions to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented.
CallExecuteAfterBringingEntitiesCall Execute after gathering entities
EchoLevelThe verbosity level

◆ GatherNodesFromOtherPartitions()

void GatherModelPartUtility::GatherNodesFromOtherPartitions ( ModelPart rModelPart,
const std::map< int, std::vector< std::size_t >> &  rNodesToBring,
const bool  CallExecuteAfterBringingEntities = true,
const int  EchoLevel = 0 
)
static

Function to gather nodes from other partitions.

This function is intended to gather nodes from other partitions. The map indicates the partitions to gather and the vector the nodes to gather from each partition. In the current serial case it does nothing.

Parameters
rModelPartModel part to gather nodes from other partitions
rNodesToBringNodes to gather from other partitions. It must be an ordered map to ensure the order of the ranks. This is a synchronous MPI implementation, and order matters until asynchronous is implemented. The map represents the following. The key (int) the rank where to bring the nodes, and the vector of indexes, the ids of the nodes to bring
CallExecuteAfterBringingEntitiesCall Execute after gathering nodes
EchoLevelThe verbosity level

◆ GatherOnMaster() [1/2]

void GatherModelPartUtility::GatherOnMaster ( )

This function gathers the model part on the master rank.

◆ GatherOnMaster() [2/2]

template<class TDataType >
void GatherModelPartUtility::GatherOnMaster ( const Variable< TDataType > &  rVariable)

The function gathers the model part from the master rank to the other ranks.

Parameters
rVariableThe variable to be gathered

◆ Info()

std::string GatherModelPartUtility::Info ( ) const

Turn back information as a string.

◆ KRATOS_CLASS_POINTER_DEFINITION()

Kratos::GatherModelPartUtility::KRATOS_CLASS_POINTER_DEFINITION ( GatherModelPartUtility  )

Pointer definition of GatherModelPartUtility.

◆ PrintData()

void GatherModelPartUtility::PrintData ( std::ostream &  rOStream) const

Print object's data.

◆ PrintInfo()

void GatherModelPartUtility::PrintInfo ( std::ostream &  rOStream) const

Print information about this object.

◆ ScatterFromMaster()

template<class TDataType >
template void GatherModelPartUtility::ScatterFromMaster ( const Variable< TDataType > &  rVariable)

The function scatters the model part from the master rank to the other ranks.

Parameters
rVariableThe variable to be scattered

The documentation for this class was generated from the following files: