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.
mesher.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosDelaunayMeshingApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: April 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_MESHER_H_INCLUDED )
11 #define KRATOS_MESHER_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
18 #include "includes/model_part.h"
21 #include "utilities/openmp_utils.h"
24 
25 
27 //Data:
28 //StepData:
29 //Flags: (checked)
30 // (set)
31 // (modified)
32 // (reset)
33 
34 namespace Kratos
35 {
36 
39 
43 
47 
51 
55 
57 
59 class KRATOS_API(DELAUNAY_MESHING_APPLICATION) Mesher
60 {
61 public:
62 
65 
68 
69  typedef std::size_t SizeType;
70  typedef std::size_t IndexType;
71 
75 
82 
84  Mesher() {}
85 
87  Mesher(Mesher const& rOther)
88  :mpMeshingVariables(rOther.mpMeshingVariables)
89  ,mPreMeshingProcesses(rOther.mPreMeshingProcesses)
90  ,mPostMeshingProcesses(rOther.mPostMeshingProcesses)
91  ,mpMesherUtilities(rOther.mpMesherUtilities)
92  ,mpDataTransferUtilities(rOther.mpDataTransferUtilities)
93  ,mEchoLevel(rOther.mEchoLevel)
94  {};
95 
97  virtual ~Mesher() {}
98 
99 
103 
104 
108 
109 
110  //************* STARTING METHODS
111 
116  void Initialize();
117 
118 
122  virtual void SetEchoLevel(int Level)
123  {
124  mEchoLevel = Level;
125  }
126 
128  {
129  return mEchoLevel;
130  }
131 
135  void SetMeshingParameters( MeshingParametersType::Pointer& rMeshingParameters );
136 
140  void SetPreMeshingProcess( MesherProcess::Pointer pPreMeshingProcess );
141 
142  void SetPostMeshingProcess( MesherProcess::Pointer pPostMeshingProcess );
143 
144 
145  void SetPreMeshingProcessVector( std::vector<MesherProcess::Pointer>& rPreMeshingProcessVector );
146 
147  void SetPostMeshingProcessVector( std::vector<MesherProcess::Pointer>& rPostMeshingProcessVector );
148 
149 
153  void SetMesherUtilities( MesherUtilities::Pointer rMesherUtilities );
154 
158  void SetDataTransferUtilities( MeshDataTransferUtilities::Pointer rDataTransferUtilities );
159 
160 
161  //*******************************************************************************************
162  //*******************************************************************************************
163 
167  virtual void InitializeMesher(ModelPart& rModelPart);
168 
169 
173  virtual void ExecuteMeshing(ModelPart& rModelPart);
174 
178  virtual void FinalizeMesher(ModelPart& rModelPart);
179 
183 
184 
188 
189 
193 
195  virtual std::string Info() const
196  {
197  return "Mesher";
198  }
199 
201  virtual void PrintInfo(std::ostream& rOStream) const
202  {
203  rOStream << Info();
204  }
205 
207  virtual void PrintData(std::ostream& rOStream) const
208  {
209  }
210 
211 
215 
216 
218 
219 protected:
222 
223 
227 
228  MeshingParametersType::Pointer mpMeshingVariables;
229 
230  std::vector<MesherProcess::Pointer> mPreMeshingProcesses;
231  std::vector<MesherProcess::Pointer> mPostMeshingProcesses;
232 
233  MesherUtilities::Pointer mpMesherUtilities;
234 
235  MeshDataTransferUtilities::Pointer mpDataTransferUtilities;
236 
238 
242 
244  Mesher& operator=(Mesher const& rOther);
245 
249 
253  virtual void StartEcho(ModelPart& rSubModelPart,
254  std::string GenerationMessage);
255 
256 
260  virtual void EndEcho(ModelPart& rSubModelPart,
261  std::string GenerationMessage);
262 
263 
264 
268  virtual void SetNodes(ModelPart& rModelPart,
269  MeshingParametersType& rMeshingVariables);
270 
274  virtual void SetElements(ModelPart& rModelPart,
275  MeshingParametersType& rMeshingVariables);
276 
280  virtual void SetNeighbours(ModelPart& rModelPart,
281  MeshingParametersType& rMeshingVariables);
282 
283 
287  virtual void ExecutePreMeshingProcesses();
288 
289 
293  virtual void ExecutePostMeshingProcesses();
294 
295 
296 
300  virtual void Generate (ModelPart& rModelPart,
301  MeshingParametersType& rMeshingVariables){};
302 
303 
307  virtual void SetElementNeighbours(ModelPart& rModelPart,
308  MeshingParametersType& rMeshingVariables);
309 
313  virtual void RecoverBoundaryPosition(ModelPart& rModelPart,
314  MeshingParametersType& rMeshingVariables);
315 
316 
320 
321 
325 
326 
330 
331 
333 
334 private:
337 
338 
342 
343 
347 
348 
352 
353 
357 
358 
362 
363 
367 
369 
370 }; // Class Mesher
371 
373 
376 
377 
381 
382 
384 inline std::istream& operator >> (std::istream& rIStream,
385  Mesher& rThis);
386 
388 inline std::ostream& operator << (std::ostream& rOStream,
389  const Mesher& rThis)
390 {
391  rThis.PrintInfo(rOStream);
392  rOStream << std::endl;
393  rThis.PrintData(rOStream);
394 
395  return rOStream;
396 }
398 
399 
400 } // namespace Kratos.
401 
402 #endif // KRATOS_MESHER_H_INCLUDED defined
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
Short class definition.
Definition: mesher.hpp:60
virtual ~Mesher()
Destructor.
Definition: mesher.hpp:97
MeshDataTransferUtilities::Pointer mpDataTransferUtilities
Definition: mesher.hpp:235
virtual void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: mesher.hpp:207
int GetEchoLevel()
Definition: mesher.hpp:127
std::size_t IndexType
Definition: mesher.hpp:70
virtual void SetEchoLevel(int Level)
Definition: mesher.hpp:122
std::size_t SizeType
Definition: mesher.hpp:69
int mEchoLevel
Definition: mesher.hpp:237
KRATOS_CLASS_POINTER_DEFINITION(Mesher)
Pointer definition of Mesher.
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: mesher.hpp:77
Mesher(Mesher const &rOther)
Copy constructor.
Definition: mesher.hpp:87
virtual std::string Info() const
Turn back information as a string.
Definition: mesher.hpp:195
std::vector< MesherProcess::Pointer > mPostMeshingProcesses
Definition: mesher.hpp:231
Mesher()
Default constructor.
Definition: mesher.hpp:84
virtual void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: mesher.hpp:201
std::vector< MesherProcess::Pointer > mPreMeshingProcesses
Definition: mesher.hpp:230
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: mesher.hpp:78
MesherUtilities::MeshingInfoParameters InfoParametersType
Definition: mesher.hpp:72
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: mesher.hpp:76
MesherUtilities::MeshingParameters MeshingParametersType
Definition: mesher.hpp:73
MeshingParametersType::Pointer mpMeshingVariables
Definition: mesher.hpp:228
MesherUtilities::RefiningParameters RefineParametersType
Definition: mesher.hpp:74
virtual void Generate(ModelPart &rModelPart, MeshingParametersType &rMeshingVariables)
Definition: mesher.hpp:300
MesherUtilities::Pointer mpMesherUtilities
Definition: mesher.hpp:233
Mesher & operator=(Mesher const &rOther)
Assignment operator.
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
Definition: mesher_utilities.hpp:269
Definition: mesher_utilities.hpp:631
Definition: mesher_utilities.hpp:479