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.
parallel_fill_communicator.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Riccardo Rossi
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/define.h"
22 
23 namespace Kratos
24 {
25 
28 
32 
36 
40 
44 
54 class KRATOS_API(KRATOS_MPI_CORE) ParallelFillCommunicator
55  : public FillCommunicator
56 {
57 public:
60 
63 
67 
72  KRATOS_DEPRECATED_MESSAGE("This constructor is deprecated, please use the one that accepts a DataCommunicator")
74 
81  ModelPart& rModelPart,
82  const DataCommunicator& rDataCommunicator
83  );
84 
87 
91 
95 
100  void Execute() override;
101 
107  void PrintModelPartDebugInfo(const ModelPart& rModelPart) override;
108 
112 
116 
120 
122  std::string Info() const override;
123 
125  void PrintInfo(std::ostream& rOStream) const override;
126 
128  void PrintData(std::ostream& rOStream) const override;
129 
133 
135 protected:
138 
142 
146 
150 
155  void ComputeCommunicationPlan(ModelPart& rModelPart);
156 
158  void InitializeParallelCommunicationMeshes(
159  ModelPart& rModelPart,
160  const std::vector<int>& rColors,
161  const int MyRank
162  );
163 
165  void GenerateMeshes(
166  const int NeighbourPID,
167  const int MyPID,
168  const unsigned int Color,
169  ModelPart& rModelPart
170  );
171 
175 
179 
183 
185 private:
188 
192 
193  bool mPartitionIndexCheckPerformed = false;
194 
198 
202 
206 
210 
214 
216 
218 
220 
222 
224 
225 }; // Class ParallelFillCommunicator
226 
228 
231 
235 
237 inline std::istream & operator >>(std::istream& rIStream,
239 {
240  return rIStream;
241 }
242 
244 inline std::ostream & operator <<(std::ostream& rOStream,
245  const ParallelFillCommunicator& rThis)
246 {
247  rThis.PrintInfo(rOStream);
248  rOStream << std::endl;
249  rThis.PrintData(rOStream);
250 
251  return rOStream;
252 }
254 
255 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Serial (do-nothing) version of a wrapper class for MPI communication.
Definition: data_communicator.h:318
Base class defining the API for the fill communicator utilities.
Definition: fill_communicator.h:52
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This function recomputes the communication plan for MPI.
Definition: parallel_fill_communicator.h:56
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: parallel_fill_communicator.cpp:170
KRATOS_CLASS_POINTER_DEFINITION(ParallelFillCommunicator)
Pointer definition of ParallelFillCommunicator.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: parallel_fill_communicator.cpp:165
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Kratos::PeriodicInterfaceProcess Process operator(std::istream &rIStream, PeriodicInterfaceProcess &rThis)
input stream function
namespace KRATOS_DEPRECATED_MESSAGE("Please use std::filesystem directly") filesystem
Definition: kratos_filesystem.h:33
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
default
Definition: generate_gid_list_file.py:35
tuple const
Definition: ode_solve.py:403
namespace
Definition: array_1d.h:793