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.
mesh_local_smoothing_process.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: Pooyan Dadvand
11 //
12 //
13 
14 #if !defined(KRATOS_MESH_LOCAL_SMOOTHING_PROCESS_H_INCLUDED )
15 #define KRATOS_MESH_LOCAL_SMOOTHING_PROCESS_H_INCLUDED
16 
17 
18 
19 // System includes
20 #include <string>
21 #include <iostream>
22 
23 
24 // External includes
25 
26 
27 // Project includes
28 #include "includes/define.h"
29 #include "processes/process.h"
30 #include "includes/model_part.h"
31 
32 
33 
34 namespace Kratos
35 {
38 
41 
43 
47  class KRATOS_API(KRATOS_CORE) MeshLocalSmoothingProcess : public Process
48  {
49  public:
52 
55 
56  typedef Node NodeType;
57 
59 
60  typedef std::vector<Point > PointsVectorType;
61 
65 
69 
72  ModelPart &rModelPart,
73  double AptQuality = 0.5,
74  std::size_t MaxIterationsNumber = 10,
75  const Flags &rBoundaryFlag = BOUNDARY);
76 
78  ~MeshLocalSmoothingProcess() override;
79 
80 
84 
85 
89 
90  void Execute() override;
91 
95 
96 
100 
101 
105 
107  std::string Info() const override;
108 
110  void PrintInfo(std::ostream& rOStream) const override;
111 
113  void PrintData(std::ostream& rOStream) const override;
114 
115 
119 
120 
122 
123  protected:
126 
127 
131 
132 
136 
137 
141 
142  virtual void FindOptimumPositionsAndWeights(NodeType& rNode, PointsVectorType& rOptimumPoints, Vector& rWeights);
143 
144 
148 
149 
153 
154 
158 
159 
161 
162  private:
165 
166  ModelPart& mrModelPart;
167 
168  std::size_t mMaxIterationsNumber;
169 
170  double mAptQuality;
171 
172  std::size_t mNumberOfLowQualityElements;
173 
174  double mMeshMinQuality;
175 
176  double mMeshQualityNorm;
177 
178  const Flags &mrBoundaryFlag;
179 
180 
184 
185 
189 
190 
194 
195  void SelectLowQualityElementNodes();
196 
197  void PerformSmoothing();
198 
199  void InterpolateNodeOptimumPosition(PointsVectorType const& rOptimumPoints, Vector const& rWeights, Point& OptimumPosition);
200 
201  void MoveNodeIfImprovesMinimumQuality(NodeType& rNode, Point const& OptimumPosition);
202 
203 
207 
208 
212 
213 
217 
220 
223 
224 
226 
227  }; // Class MeshLocalSmoothingProcess
228 
230 
233 
234 
238 
239 
241  inline std::istream& operator >> (std::istream& rIStream,
243 
245  inline std::ostream& operator << (std::ostream& rOStream,
246  const MeshLocalSmoothingProcess& rThis)
247  {
248  rThis.PrintInfo(rOStream);
249  rOStream << std::endl;
250  rThis.PrintData(rOStream);
251 
252  return rOStream;
253  }
255 
257 
258 } // namespace Kratos.
259 
260 #endif // KRATOS_MESH_LOCAL_SMOOTHING_PROCESS_H_INCLUDED defined
261 
262 
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Definition: flags.h:58
This class is a vector which stores global pointers.
Definition: global_pointers_vector.h:61
The base class for local smoothing processes providing a laplacian smoothing.
Definition: mesh_local_smoothing_process.h:48
GlobalPointersVector< Node > NeighboursVectorType
Definition: mesh_local_smoothing_process.h:58
Node NodeType
Definition: mesh_local_smoothing_process.h:56
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mesh_local_smoothing_process.cpp:84
std::vector< Point > PointsVectorType
Definition: mesh_local_smoothing_process.h:60
KRATOS_CLASS_POINTER_DEFINITION(MeshLocalSmoothingProcess)
Pointer definition of MeshLocalSmoothingProcess.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesh_local_smoothing_process.cpp:90
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Point class.
Definition: point.h:59
The base class for all processes in Kratos.
Definition: process.h:49
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