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.
structured_mesh_generator_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 #pragma once
15 
16 // System includes
17 #include <string>
18 #include <iostream>
19 
20 
21 // External includes
22 
23 
24 // Project includes
25 #include "processes/process.h"
26 #include "includes/model_part.h"
28 
29 
30 namespace Kratos
31 {
32 
35 
38 
40 
49 class KRATOS_API(KRATOS_CORE) StructuredMeshGeneratorProcess : public Process
50 {
51 
52 public:
55 
57 
60 
64 
67 
71  const GeometryType& rGeometry,
72  ModelPart& rOutputModelPart,
73  Parameters TheParameters);
74 
76  GeometryType::Pointer pGeometry,
77  ModelPart& rOutputModelPart,
78  Parameters TheParameters)
80  *pGeometry,
81  rOutputModelPart,
82  TheParameters)
83  {};
84 
87 
89  ~StructuredMeshGeneratorProcess() override ;
90 
94 
97 
101 
102  void Execute() override;
103 
104  int Check() override;
105 
109  const Parameters GetDefaultParameters() const override;
110 
114 
115 
119 
120 
124 
126  std::string Info() const override;
127 
129  void PrintInfo(std::ostream& rOStream) const override;
130 
132  void PrintData(std::ostream& rOStream) const override;
133 
134 
138 
139 
141 
142 private:
145 
146 
150 
151  const GeometryType& mrGeometry;
152  std::size_t mNumberOfDivisions;
153  std::size_t mStartNodeId;
154  std::size_t mStartElementId;
155  std::size_t mStartConditionId;
156  std::size_t mElementPropertiesId;
157  std::size_t mConditiongPropertiesId;
158  std::string mElementName;
159  std::string mConditionName;
160  std::string mBodySubModelPartName;
161  std::string mSkinSubModelPartName;
162  bool mCreateSkinSubModelPart;
163  bool mCreateBodySubModelPart;
164  ModelPart& mrOutputModelPart;
165 
169 
170  void Generate2DMesh();
171 
172  void Generate3DMesh();
173 
174  void GenerateNodes2D(Point const& rMinPoint, Point const& rMaxPoint);
175 
176  void GenerateNodes3D(Point const& rMinPoint, Point const& rMaxPoint);
177 
178  void GenerateTriangularElements();
179 
180  void GenerateTetrahedraElements();
181 
182  void CreateCellTetrahedra(std::size_t I, std::size_t J, std::size_t K, Properties::Pointer pProperties);
183 
184  std::size_t GetNodeId(std::size_t I, std::size_t J, std::size_t K);
185 
186  void GetLocalCoordinatesRange(Point& rMinPoint, Point& rMaxPoint);
187 
188  bool CheckDomainGeometry();
189 
190  bool CheckDomainGeometryConnectivityForQuadrilateral2D4();
191 
192  bool CheckDomainGeometryConnectivityForHexahedra3D8();
193 
197 
198 
202 
203 
207 
208 
210 }; // Class StructuredMeshGeneratorProcess
212 
215 
216 
220 
221 
223 inline std::istream& operator >> (std::istream& rIStream,
225 
227 inline std::ostream& operator << (std::ostream& rOStream,
228  const StructuredMeshGeneratorProcess& rThis)
229 {
230  rThis.PrintInfo(rOStream);
231  rOStream << std::endl;
232  rThis.PrintData(rOStream);
233 
234  return rOStream;
235 }
237 
239 
240 } // namespace Kratos.
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
Geometry base class.
Definition: geometry.h:71
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
Point class.
Definition: point.h:59
The base class for all processes in Kratos.
Definition: process.h:49
Short class definition.
Definition: structured_mesh_generator_process.h:50
StructuredMeshGeneratorProcess(StructuredMeshGeneratorProcess const &rOther)=delete
The object is not copyable.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: structured_mesh_generator_process.cpp:139
StructuredMeshGeneratorProcess(GeometryType::Pointer pGeometry, ModelPart &rOutputModelPart, Parameters TheParameters)
Definition: structured_mesh_generator_process.h:75
StructuredMeshGeneratorProcess & operator=(StructuredMeshGeneratorProcess const &rOther)=delete
It is not assignable.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: structured_mesh_generator_process.cpp:144
KRATOS_CLASS_POINTER_DEFINITION(StructuredMeshGeneratorProcess)
Pointer definition of StructuredMeshGeneratorProcess.
StructuredMeshGeneratorProcess()=delete
Default constructor is deleted.
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
J
Definition: sensitivityMatrix.py:58
K
Definition: sensitivityMatrix.py:73