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_node_collapsing_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_MESH_NODE_COLLAPSING_PROCESS_H_INCLUDED )
14 #define KRATOS_MESH_NODE_COLLAPSING_PROCESS_H_INCLUDED
15 
16 
17 
18 // System includes
19 #include <string>
20 #include <iostream>
21 
22 
23 // External includes
24 
25 
26 // Project includes
27 #include "includes/define.h"
28 #include "processes/process.h"
29 #include "includes/model_part.h"
30 
31 
32 namespace Kratos
33 {
36 
39 
41 
44  {
45  public:
48 
51 
55 
57 
61 
63  explicit MeshNodeCollapsingProcess(ModelPart& rModelPart);
64 
67 
70 
72  ~MeshNodeCollapsingProcess() override;
73 
74 
78 
81 
85 
86  void Execute() override;
87 
88 
92 
93 
97 
98 
102 
104  std::string Info() const override;
105 
107  void PrintInfo(std::ostream& rOStream) const override;
108 
110  void PrintData(std::ostream& rOStream) const override;
111 
112 
116 
117 
119 
120  protected:
125 
126  private:
129 
130 
134 
135 
139 
140  void CollapseNodes();
141 
142  void CollapseNode(Node& rThisNode);
143 
144  double CalculateQualityIfNodeCollapses(Node& rThisNode, Node const& rCoarseNode);
145 
146  double CalculateMinQualityOfNeighbourElements(Node& rThisNode, Node const& rCoarseNode);
147 
148  bool ElementHas(Element& rElement, Node const& rCoarseNode);
149 
150  void SwapElementNode(Element& rElement, Node const& rThisNode, Node::Pointer pCoarseNode);
151 
153 
154  }; // Class MeshNodeCollapsingProcess
155 
157 
160 
161 
165 
166 
168  inline std::istream& operator >> (std::istream& rIStream,
170 
172  inline std::ostream& operator << (std::ostream& rOStream,
173  const MeshNodeCollapsingProcess& rThis)
174  {
175  rThis.PrintInfo(rOStream);
176  rOStream << std::endl;
177  rThis.PrintData(rOStream);
178 
179  return rOStream;
180  }
182 
184 
185 } // namespace Kratos.
186 
187 #endif // KRATOS_MESH_NODE_COLLAPSING_PROCESS_H_INCLUDED defined
Base class for all Elements.
Definition: element.h:60
Remove the selected node from the mesh and collapse the connectivity arround it.
Definition: mesh_node_collapsing_process.h:44
MeshNodeCollapsingProcess(MeshNodeCollapsingProcess const &rOther)=delete
Copy constructor deleted.
MeshNodeCollapsingProcess & operator=(MeshNodeCollapsingProcess const &rOther)=delete
Assignment operator is deleted.
KRATOS_CLASS_POINTER_DEFINITION(MeshNodeCollapsingProcess)
Pointer definition of MeshNodeCollapsingProcess.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: mesh_node_collapsing_process.cpp:55
MeshNodeCollapsingProcess()=delete
Default constructor deleted.
~MeshNodeCollapsingProcess() override
Destructor.
Definition: mesh_node_collapsing_process.cpp:32
std::string Info() const override
Turn back information as a string.
Definition: mesh_node_collapsing_process.cpp:45
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: mesh_node_collapsing_process.cpp:50
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: mesh_node_collapsing_process.cpp:36
ModelPart & mrModelPart
Definition: mesh_node_collapsing_process.h:123
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
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