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.
mpi_normal_calculation_utilities.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 author: Jordi Cotela
11 //
12 
13 #ifndef KRATOS_MPI_NORMAL_CALCULATION_UTILITIES_H
14 #define KRATOS_MPI_NORMAL_CALCULATION_UTILITIES_H
15 
16 // System includes
17 
18 // External includes
19 
20 
21 // Project includes
22 #include "includes/model_part.h"
23 
24 
25 namespace Kratos
26 {
29 
32 
36 
40 
44 
48 
50 class KRATOS_API(KRATOS_MPI_CORE) MPINormalCalculationUtils
51 {
52 public:
55 
58 
62 
65 
67  virtual ~MPINormalCalculationUtils();
68 
69 
73 
74 
78 
79  int Check(ModelPart& rModelPart);
80 
81  void OrientFaces(ModelPart& rModelPart,
82  bool OutwardsPositive);
83 
84  void CalculateOnSimplex(ModelPart& rModelPart,
85  int Dimension,
86  const Variable<double>& rVariable,
87  const double rAlpha);
88 
92 
93 
97 
98 
102 
104  std::string Info() const;
105 
107  void PrintInfo(std::ostream& rOStream) const;
108 
110  void PrintData(std::ostream& rOStream) const;
111 
112 
116 
117 
119 
120 protected:
123 
124 
128 
129 
133 
134 
138 
139 
143 
144 
148 
149 
153 
154 
156 
157 private:
160 
161 
165 
166 
170 
171 
175 
176 
177  void IdentifyFaces(ModelPart& rModelPart,
178  const Variable<double>& rVariable,
179  int& MaxNeigh,
180  int& NumNodes);
181 
182 
183  void InitializeNormalData(ModelPart& rModelPart,
184  const Variable<double>& rVariable,
185  int MaxNeigh,
186  std::vector<double>& rNormals,
187  std::vector<int>& pActiveNeigh,
188  const int NumNodes);
189 
190  void DetectEdges(ModelPart& rModelPart,
191  unsigned int Dimension,
192  double MaxAngle,
193  const std::vector<double>& rNormals,
194  const std::vector<int>& rActiveNeigh,
195  const int NumNodes,
196  const int MaxNeighs);
197 
198 
199  bool OrientElement(Geometry< Node >& rGeom);
200 
201 
202  void NormalContribution(Geometry< Node >&rGeom);
203 
204 
205  void FaceNormal2D(array_1d<double,3>& An,
206  Geometry<Node >& rGeometry);
207 
208 
209  void FaceNormal3D(array_1d<double,3>& An,
210  Geometry<Node >& rGeometry);
211 
212  void UpdateNodeNormals(ModelPart& rModelPart,
213  const unsigned int Dimension,
214  const Variable<double>& rVariable);
215 
216 
220 
221 
225 
226 
230 
233 
236 
237 
239 
240 }; // Class MPINormalCalculationUtils
241 
243 
246 
247 
251 
252 
254 inline std::istream& operator >> (std::istream& rIStream,
256 
258 inline std::ostream& operator << (std::ostream& rOStream,
259  const MPINormalCalculationUtils& rThis)
260 {
261  rThis.PrintInfo(rOStream);
262  rOStream << std::endl;
263  rThis.PrintData(rOStream);
264 
265  return rOStream;
266 }
268 
270 
271 } // namespace Kratos.
272 
273 #endif // KRATOS_MPI_NORMAL_CALCULATION_UTILITIES_H
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Geometry base class.
Definition: geometry.h:71
Some tools to calculate face and nodal normals on an MPI partitioned environment.
Definition: mpi_normal_calculation_utilities.h:51
KRATOS_CLASS_POINTER_DEFINITION(MPINormalCalculationUtils)
Pointer definition of MPINormalCalculationUtils.
void PrintInfo(std::ostream &rOStream) const
Print information about this object.
Definition: mpi_normal_calculation_utilities.cpp:207
void PrintData(std::ostream &rOStream) const
Print object's data.
Definition: mpi_normal_calculation_utilities.cpp:212
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