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.
cad_tessellation_modeler.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: Dagmawi Bekel
11 // Ruben Zorrilla
12 //
13 
14 #if USE_TRIANGLE_NONFREE_TPL
15 
16 #if !defined(KRATOS_CAD_TESSELLATION_MODELER_INCLUDED)
17 #define KRATOS_CAD_TESSELLATION_MODELER_INCLUDED
18 
19 // System includes
20 
21 // External includes
22 
23 // Project includes
24 #include "modeler.h"
29 
30 namespace Kratos {
31 
34 
36 
38 class KRATOS_API(KRATOS_CORE) CadTessellationModeler : public Modeler {
39 public:
42 
44  KRATOS_CLASS_POINTER_DEFINITION(CadTessellationModeler);
45 
46  typedef std::size_t IndexType;
47 
48  typedef std::size_t SizeType;
49 
50  typedef Node NodeType;
51 
52  typedef Point EmbeddedNodeType;
53 
54  typedef PointerVector<NodeType> ContainerNodeType;
55 
56  typedef PointerVector<EmbeddedNodeType> ContainerEmbeddedNodeType;
57 
58  typedef BrepSurface<ContainerNodeType, ContainerEmbeddedNodeType> BrepSurfaceType;
59 
60  typedef BrepCurveOnSurface<ContainerNodeType, ContainerEmbeddedNodeType> BrepCurveOnSurfaceType;
61 
65 
67  CadTessellationModeler() : Modeler()
68  {
69  }
70 
76  CadTessellationModeler(
77  Model& rModel,
78  Parameters ModelerParameters = Parameters())
79  : Modeler(rModel, ModelerParameters)
80  , mpModel(&rModel)
81  {
82  }
83 
85  virtual ~CadTessellationModeler() = default;
86 
90 
91 
95 
103  Modeler::Pointer Create(
104  Model& rModel,
105  const Parameters ModelParameters) const override;
106 
110 
114  void SetupModelPart() override;
115 
119 
121  std::string Info() const override
122  {
123  return "CadTessellationModeler";
124  }
125 
127  void PrintInfo(std::ostream& rOStream) const override
128  {
129  rOStream << Info();
130  }
131 
133  void PrintData(std::ostream& rOStream) const override
134  {
135  }
136 
138 
139 private:
140 
143 
144 
148 
149  Model* mpModel = nullptr;
150 
154 
155  friend class Serializer;
156 
160 
161 
165 
172  std::vector<array_1d<double, 2>> ComputeBoundaryTessellation(const BrepCurveOnSurfaceType& rBoundarySegment);
173 
180  std::vector<BoundedMatrix<double,3,3>> ComputeSurfaceTriangulation(
181  const BrepSurfaceType& rSurfaceGeometry,
182  const std::vector<array_1d<double, 2>>& rBoundaryLoop);
183 
193  std::vector<BoundedMatrix<double,3,3>> InsertGaussPointsExactSurface(
194  const BrepSurfaceType& rSurfaceGeometry,
195  const std::vector<double>& rPointsCoordinates,
196  const std::vector<IndexType>& rTriangleConnectivities);
197 
208  std::vector<BoundedMatrix<double,3,3>> InsertGaussPointsApproxSurface(
209  const BrepSurfaceType& rSurfaceGeometry,
210  const std::vector<double>& rPointsCoordinates,
211  const std::vector<IndexType>& rTriangleConnectivities);
212 
223  double ComputeDiscretizationError(
224  const std::vector<BoundedMatrix<double,3,3>>& rGaussPointsExact,
225  const std::vector<BoundedMatrix<double,3,3>>& rGaussPointsApprox);
226 
227 }; // Class CadTessellationModeler
228 
232 
234 inline std::istream& operator>>(std::istream& rIStream,
235  CadTessellationModeler& rThis)
236 {
237  return rIStream;
238 }
239 
241 inline std::ostream& operator<<(std::ostream& rOStream, const CadTessellationModeler& rThis)
242 {
243  rThis.PrintInfo(rOStream);
244  rOStream << std::endl;
245  rThis.PrintData(rOStream);
246 
247  return rOStream;
248 }
249 
251 
252 } // namespace Kratos.
253 
254 #endif // KRATOS_CAD_TESSELLATION_MODELER_INCLUDED defined
255 #endif
std::string Info() const override
Turn back information as a string.
Definition: periodic_interface_process.hpp:93
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
Modeler::Pointer Create(const std::string &ModelerName, Model &rModel, const Parameters ModelParameters)
Checks if the modeler is registered.
Definition: modeler_factory.cpp:30
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
Node NodeType
The definition of the node.
Definition: tetrahedral_mesh_orientation_check.h:34
std::size_t SizeType
The definition of the size type.
Definition: mortar_classes.h:43
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
dictionary Model
TODO replace this "model" for real one once available in kratos core.
Definition: script.py:94
#define KRATOS_CLASS_POINTER_DEFINITION(a)
Definition: smart_pointers.h:69