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.
tetrahedra_mesh_edge_swapping_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 #if !defined(KRATOS_TETRAHEDRA_MESH_EDGE_SWAPPING_PROCESS_H_INCLUDED )
14 #define KRATOS_TETRAHEDRA_MESH_EDGE_SWAPPING_PROCESS_H_INCLUDED
15 
16 
17 
18 // System includes
19 #include <string>
20 #include <iostream>
21 #include <unordered_map>
22 
23 // External includes
24 
25 
26 // Project includes
27 #include "includes/define.h"
28 #include "includes/model_part.h"
29 #include "processes/process.h"
31 
32 namespace Kratos
33 {
36 
39 
41 
43  class KRATOS_API(KRATOS_CORE) TetrahedraMeshEdgeSwappingProcess : public Process
44  {
45  public:
48 
51 
52  using PointType=Node;
53 
57 
60 
62 
65 
66 
70 
71 
75 
76  void Execute() override;
77 
78 
82 
83 
87 
88 
92 
94  std::string Info() const override;
95 
97  void PrintInfo(std::ostream& rOStream) const override;
98 
100  void PrintData(std::ostream& rOStream) const override;
101 
102 
106 
107 
109 
110  private:
111 
112 
113  class Edge
114  {
115  PointType* mpPoint1;
116  PointType* mpPoint2;
117  public:
118  Edge():mpPoint1(nullptr), mpPoint2(nullptr){}
119  Edge(PointType* pPoint1, PointType* pPoint2): mpPoint1(pPoint1), mpPoint2(pPoint2){}
120 
121  bool operator == (Edge const& rOther) const {
122  return ((mpPoint1 == rOther.mpPoint1) && (mpPoint2 == rOther.mpPoint2))
123  || ((mpPoint1 == rOther.mpPoint2) && (mpPoint2 == rOther.mpPoint1));
124  }
125 
126  std::size_t operator()(Edge const& TheEdge) const
127  {
128  std::size_t h1 = std::hash<PointType*>{}(TheEdge.mpPoint1);
129  std::size_t h2 = std::hash<PointType*>{}(TheEdge.mpPoint2);
130  return h1 + h2;
131  }
132 
133  PointType const * GetPoint1() const {return mpPoint1;}
134  PointType const * GetPoint2() const {return mpPoint2;}
135  };
136 
137  using EdgesContainerType = std::unordered_map<Edge, TetrahedraEdgeShell, Edge>;
138 
139 
142 
143 
147 
148  ModelPart& mrModelPart;
149 
153 
154 
158 
159 
163 
164 
168 
169 
173 
175  TetrahedraMeshEdgeSwappingProcess& operator=(TetrahedraMeshEdgeSwappingProcess const& rOther);
176 
178  TetrahedraMeshEdgeSwappingProcess(TetrahedraMeshEdgeSwappingProcess const& rOther);
179 
180 
182 
183  }; // Class TetrahedraMeshEdgeSwappingProcess
184 
186 
189 
190 
194 
195 
197  inline std::istream& operator >> (std::istream& rIStream,
199 
201  inline std::ostream& operator << (std::ostream& rOStream,
203  {
204  rThis.PrintInfo(rOStream);
205  rOStream << std::endl;
206  rThis.PrintData(rOStream);
207 
208  return rOStream;
209  }
211 
213 
214 } // namespace Kratos.
215 
216 #endif // KRATOS_TETRAHEDRA_MESH_EDGE_SWAPPING_PROCESS_H_INCLUDED defined
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
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
Short class definition.
Definition: tetrahedra_mesh_edge_swapping_process.h:44
TetrahedraMeshEdgeSwappingProcess()=delete
Default constructor.
KRATOS_CLASS_POINTER_DEFINITION(TetrahedraMeshEdgeSwappingProcess)
Pointer definition of TetrahedraMeshEdgeSwappingProcess.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: tetrahedra_mesh_edge_swapping_process.cpp:79
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: tetrahedra_mesh_edge_swapping_process.cpp:84
Kratos::ModelPart ModelPart
Definition: kratos_wrapper.h:31
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
bool operator==(const Flags &Left, const Flags &Right)
Definition: flags.cpp:45
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
Configure::PointType PointType
Definition: transfer_utility.h:245