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.
nurbs_surface_refinement_utilities.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 
11 #if !defined(KRATOS_NURBS_SURFACE_REFINEMENT_UTILITIES_H_INCLUDED )
12 #define KRATOS_NURBS_SURFACE_REFINEMENT_UTILITIES_H_INCLUDED
13 
14 // System includes
15 
16 // External includes
17 
18 // Project includes
20 #include "nurbs_utilities.h"
21 #include "includes/node.h"
22 
23 namespace Kratos {
24 
25 class KRATOS_API(KRATOS_CORE) NurbsSurfaceRefinementUtilities
26 {
27 public:
30 
31  typedef std::size_t IndexType;
32  typedef std::size_t SizeType;
33  typedef Node NodeType;
34 
36  typedef typename NurbsSurfaceGeometryType::Pointer NurbsSurfaceGeometryPointerType;
37 
41 
42  /*
43  * @brief Refines the u-knot vector of a NurbsSurfaceGeometry.
44  * @details This function adopts the surface knot-refinement algorithm from
45  * Piegl 1995, Algorithm A5.5.
46  *
47  * Portet from carat++ (https://www.bgu.tum.de/st/software/forschung/carat/)
48  * and ANurbs (https://github.com/oberbichler/ANurbs)
49  *
50  * @param rGeometry surface to be refined.
51  * @param rKnotsUToInsert Knots to be inserted.
52  * @param rPointsRefined the nodes for the refined geometry.
53  * @param rKnotsURefined the new knot vector.
54  * @param rWeightsRefined the new weight vector.
55  */
56  static void KnotRefinementU(
57  NurbsSurfaceGeometryType& rGeometry,
58  std::vector<double>& rKnotsUToInsert,
59  PointerVector<NodeType>& rPointsRefined,
60  Vector& rKnotsURefined,
61  Vector& rWeightsRefined);
62 
63  /*
64  * @brief Refines the v-knot vector of a NurbsSurfaceGeometry.
65  * @details This function adopts the surface knot-refinement algorithm from
66  * Piegl 1995, Algorithm A5.5.
67  *
68  * Portet from carat++ (https://www.bgu.tum.de/st/software/forschung/carat/)
69  * and ANurbs (https://github.com/oberbichler/ANurbs)
70  *
71  * @param rGeometry surface to be refined.
72  * @param rKnotsVToInsert Knots to be inserted.
73  * @param rPointsRefined the nodes for the refined geometry.
74  * @param rKnotsVRefined the new knot vector.
75  * @param rWeightsRefined the new weight vector.
76  */
77  static void KnotRefinementV(
78  NurbsSurfaceGeometryType& rGeometry,
79  std::vector<double>& rKnotsVToInsert,
80  PointerVector<NodeType>& rPointsRefined,
81  Vector& rKnotsVRefined,
82  Vector& rWeightsRefined);
83 
84  /*
85  * @brief Elevates the degree-u of a NurbsSurfaceGeometry.
86  * @details This function adopts the surface degree elevation algorithm from
87  * Piegl 1995, Algorithm A5.10.
88  *
89  * Portet from carat++ (https://www.bgu.tum.de/st/software/forschung/carat/)
90  *
91  * @param rGeometry surface to be refined.
92  * @param rDegreeUToElevate Degree to be elevated.
93  * @param rPointsRefined the nodes for the refined geometry.
94  * @param rKnotsURefined the new knot vector.
95  * @param rWeightsRefined the new weight vector.
96  */
97  static void DegreeElevationU(
98  NurbsSurfaceGeometryType& rGeometry,
99  SizeType& rDegreeUToElevate,
100  PointerVector<NodeType>& rPointsRefined,
101  Vector& rKnotsURefined,
102  Vector& rWeightsRefined);
103 
104  /*
105  * @brief Elevates the degree-v of a NurbsSurfaceGeometry.
106  * @details This function adopts the surface degree elevation algorithm from
107  * Piegl 1995, Algorithm A5.10.
108  *
109  * Portet from carat++ (https://www.bgu.tum.de/st/software/forschung/carat/)
110  *
111  * @param rGeometry surface to be refined.
112  * @param rDegreeVToElevate Degree to be elevated.
113  * @param rPointsRefined the nodes for the refined geometry.
114  * @param rKnotsVRefined the new knot vector.
115  * @param rWeightsRefined the new weight vector.
116  */
117  static void DegreeElevationV(
118  NurbsSurfaceGeometryType& rGeometry,
119  SizeType& rDegreeVToElevate,
120  PointerVector<NodeType>& rPointsRefined,
121  Vector& rKnotsVRefined,
122  Vector& rWeightsRefined);
123 
127 
128  /*
129  * @brief Sorts the knot vector, which is required for the refinement.
130  * Filters the knots to insert which are within the former knot span
131  * and accordingly coordinates of the former geometry.
132  *
133  * @param rKnotsToInsert the knot vector to be sorted and filtered.
134  * @param rKnotsOld the old knot vector, defining the limits.
135  */
136  static void SortAndFilter(
137  std::vector<double>&rKnotsToInsert,
138  const Vector& rKnotsOld);
139 
140 };
141 
142 } // End namespace kratos
143 
144 #endif // KRATOS_NURBS_SURFACE_REFINEMENT_UTILITIES_H_INCLUDED
This class defines the node.
Definition: node.h:65
Definition: nurbs_surface_geometry.h:38
Definition: nurbs_surface_refinement_utilities.h:26
NurbsSurfaceGeometryType::Pointer NurbsSurfaceGeometryPointerType
Definition: nurbs_surface_refinement_utilities.h:36
std::size_t IndexType
Definition: nurbs_surface_refinement_utilities.h:31
Node NodeType
Definition: nurbs_surface_refinement_utilities.h:33
std::size_t SizeType
Definition: nurbs_surface_refinement_utilities.h:32
NurbsSurfaceGeometry< 3, PointerVector< NodeType > > NurbsSurfaceGeometryType
Definition: nurbs_surface_refinement_utilities.h:35
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21