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.
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: Ruben Zorrilla
11 //
12 
13 #pragma once
14 
15 // System includes
16 
17 // External includes
18 
19 // Project includes
20 #include "includes/define.h"
21 #include "includes/model_part.h"
22 
23 namespace Kratos
24 {
27 
31 
35 
39 
43 
51 class KRATOS_API(KRATOS_CORE) FillCommunicator
52 {
53 public:
56 
58  {
59  NO_PRINTING = 0, // No printing at all
60  INFO = 1, // Just some additional info is printed
61  DEBUG_INFO = 2 // Debug info (+ INFO level) is printed
62  };
63 
67 
70 
74 
79  KRATOS_DEPRECATED_MESSAGE("This constructor is deprecated, please use the one that accepts a DataCommunicator")
80  FillCommunicator(ModelPart& rModelPart);
81 
88  ModelPart& rModelPart,
89  const DataCommunicator& rDataCommunicator
90  );
91 
94 
96  virtual ~FillCommunicator() = default;
97 
101 
104 
108 
114  virtual void Execute();
115 
120  void PrintDebugInfo();
121 
128  virtual void PrintModelPartDebugInfo(const ModelPart& rModelPart);
129 
133 
139  {
140  mEchoLevel = EchoLevel;
141  }
142 
148  {
149  return mEchoLevel;
150  }
151 
155 
159 
161  virtual std::string Info() const;
162 
164  virtual void PrintInfo(std::ostream& rOStream) const;
165 
167  virtual void PrintData(std::ostream& rOStream) const;
168 
172 
174 protected:
177 
181 
183 
184  FillCommunicatorEchoLevel mEchoLevel = FillCommunicatorEchoLevel::NO_PRINTING;
185 
189 
193 
197 
203  {
204  return mrBaseModelPart;
205  }
206 
210 
214 
216 private:
219 
223 
224  ModelPart& mrBaseModelPart;
225 
229 
233 
237 
241 
245 
247 }; // Class FillCommunicator
248 
250 
253 
257 
259 inline std::istream & operator >>(
260  std::istream& rIStream,
261  FillCommunicator& rThis)
262 {
263  return rIStream;
264 }
265 
267 inline std::ostream & operator <<(
268  std::ostream& rOStream,
269  const FillCommunicator& rThis)
270 {
271  rThis.PrintInfo(rOStream);
272  rOStream << std::endl;
273  rThis.PrintData(rOStream);
274 
275  return rOStream;
276 }
277 
279 } // 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
FillCommunicatorEchoLevel
Definition: fill_communicator.h:58
const DataCommunicator & mrDataComm
Definition: fill_communicator.h:182
FillCommunicatorEchoLevel GetEchoLevel() const
Get the echo level.
Definition: fill_communicator.h:147
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: fill_communicator.cpp:82
ModelPart & GetBaseModelPart()
Get the base model part.
Definition: fill_communicator.h:202
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: fill_communicator.cpp:77
KRATOS_CLASS_POINTER_DEFINITION(FillCommunicator)
Pointer definition of FillCommunicator.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
static int EchoLevel
Definition: co_sim_EMPIRE_API.h:42
void SetEchoLevel(const int EchoLevel)
Definition: add_custom_io_to_python.cpp:344
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
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &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