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.
tesselation_utilities_2d.h
Go to the documentation of this file.
1 // Kratos Multi-Physics - ThermalDEM Application
2 //
3 // License: BSD License
4 // Kratos default license: kratos/license.txt
5 //
6 // Main authors: Rafael Rangel (rrangel@cimne.upc.edu)
7 //
8 
9 #ifndef TESSELATION_UTILITIES_2D_H_INCLUDED
10 #define TESSELATION_UTILITIES_2D_H_INCLUDED
11 
12 // System includes
13 
14 // External includes
15 #ifndef TETLIBRARY
16 #define TETLIBRARY
17 #endif
18 
19 #if !defined(KRATOS_TETGEN_EXTERNAL_H_INCLUDED)
20 #define KRATOS_TETGEN_EXTERNAL_H_INCLUDED
21 #include "tetgen.h"
22 #endif
23 
24 #ifndef TRILIBRARY
25 #define TRILIBRARY
26 #endif
27 
28 #include "triangle.h"
29 #include "includes/model_part.h"
30 
31 // Project includes
33 
34 namespace Kratos
35 {
36  extern "C" {
37  void triangulate(char*, struct triangulateio*, struct triangulateio*, struct triangulateio*);
38  void trifree(void*);
39  }
40 
41  class KRATOS_API(THERMAL_DEM_APPLICATION) TesselationUtilities2D
42  {
43  public:
44 
45  // Pointer definition
47 
48  // Constructor / Destructor
51 
52  // Public methods
53  void ExecuteInitialize (ModelPart& rModelPart, bool update_voronoi, bool update_porosity);
54  void ExecuteInitializeSolutionStep (ModelPart& rModelPart);
55 
56  protected:
57 
58  // Protected methods
59  void Triangulation (ModelPart& rModelPart);
60  void UpdateVoronoi (ModelPart& rModelPart, struct triangulateio& rOut, struct triangulateio& rVorOut);
61  void UpdatePorosity (ModelPart& rModelPart, struct triangulateio& rOut, struct triangulateio& rVorOut);
62  void ComputeAlphaRadius (ModelPart& rModelPart, struct triangulateio& rOut);
63  bool AlphaShape (std::vector<double>& coords);
64  void AddParticleArea (ModelPart& rModelPart, std::vector<int>& addedParticle, double& particle_area, const int id);
65  void ClearTriangle (struct triangulateio& rTr);
66  void FreeTriangle (struct triangulateio& rTr);
67 
68  // Protected attributes
71  double mAlphaRadius;
72  std::string mSwitches;
73 
74  private:
75 
76  // Assignment operator
78 
79  }; // Class TesselationUtilities2D
80 } // namespace Kratos
81 
82 #endif // TESSELATION_UTILITIES_2D_H_INCLUDED
PeriodicInterfaceProcess & operator=(const PeriodicInterfaceProcess &)=delete
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
Definition: tesselation_utilities_2d.h:42
KRATOS_CLASS_POINTER_DEFINITION(TesselationUtilities2D)
std::string mSwitches
Definition: tesselation_utilities_2d.h:72
double mAlphaRadius
Definition: tesselation_utilities_2d.h:71
bool mUpdatePorosiy
Definition: tesselation_utilities_2d.h:70
bool mUpdateVoronoi
Definition: tesselation_utilities_2d.h:69
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
void trifree(void *)
void triangulate(char *, struct triangulateio *, struct triangulateio *, struct triangulateio *)