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_curve_on_surface_geometry.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: Thomas Oberbichler
11 // Tobias Teschemacher
12 // Andreas Apostolatos
13 //
14 // Ported from the ANurbs library (https://github.com/oberbichler/ANurbs)
15 //
16 
17 #if !defined(KRATOS_NURBS_CURVE_ON_SURFACE_H_INCLUDED )
18 #define KRATOS_NURBS_CURVE_ON_SURFACE_H_INCLUDED
19 
20 // Project includes
21 #include "geometries/geometry.h"
22 
27 
29 
31 
32 namespace Kratos {
33 
34 template <int TWorkingSpaceDimension, class TCurveContainerPointType, class TSurfaceContainerPointType>
35 class NurbsCurveOnSurfaceGeometry : public Geometry<typename TSurfaceContainerPointType::value_type>
36 {
37 public:
40 
41  typedef typename TSurfaceContainerPointType::value_type NodeType;
42  typedef typename TCurveContainerPointType::value_type CurveNodeType;
43 
45  typedef typename GeometryType::Pointer GeometryPointer;
46 
48 
49  typedef typename BaseType::IndexType IndexType;
50  typedef typename BaseType::SizeType SizeType;
51 
54  typedef typename NurbsCurveType::Pointer NurbsCurvePointerType;
55 
60 
61  // using base class functionalities.
63  using BaseType::pGetPoint;
64  using BaseType::GetPoint;
65 
68 
72 
75  typename NurbsSurfaceType::Pointer pSurface,
76  typename NurbsCurveType::Pointer pCurve)
77  : BaseType(PointsArrayType(), &msGeometryData)
78  , mpNurbsSurface(pSurface)
79  , mpNurbsCurve(pCurve)
80  {
81  }
82 
85  : BaseType(PointsArrayType(), &msGeometryData)
86  {};
87 
90  : BaseType(rOther)
91  , mpNurbsSurface(rOther.mpNurbsSurface)
92  , mpNurbsCurve(rOther.mpNurbsCurve)
93  {
94  }
95 
97  template<class TOtherCurveContainerPointType, class TOtherSurfaceContainerPointType> NurbsCurveOnSurfaceGeometry(
99  : BaseType(rOther, &msGeometryData)
100  , mpNurbsSurface(rOther.mpNurbsSurface)
101  , mpNurbsCurve(rOther.mpNurbsCurve)
102  {
103  }
104 
106  ~NurbsCurveOnSurfaceGeometry() override = default;
107 
111 
114  {
115  BaseType::operator=(rOther);
116  mpNurbsSurface = rOther.mpNurbsSurface;
117  mpNurbsCurve = rOther.mpNurbsCurve;
118  return *this;
119  }
120 
122  template<class TOtherCurveContainerPointType, class TOtherSurfaceContainerPointType>
125  {
126  BaseType::operator=(rOther);
127  mpNurbsSurface = rOther.mpNurbsSurface;
128  mpNurbsCurve = rOther.mpNurbsCurve;
129  return *this;
130  }
131 
135 
136  typename BaseType::Pointer Create(
137  TSurfaceContainerPointType const& ThisPoints) const override
138  {
139  KRATOS_ERROR << "NurbsCurveOnSurfaceGeometry cannot be created with 'PointsArrayType const& ThisPoints'. "
140  << "'Create' is not allowed as it would not contain the required pointers to the surface and the curve."
141  << std::endl;
142  }
143 
147 
157  {
158  const auto& const_this = *this;
159  return std::const_pointer_cast<GeometryType>(
160  const_this.pGetGeometryPart(Index));
161  }
162 
171  const GeometryPointer pGetGeometryPart(const IndexType Index) const override
172  {
174  return mpNurbsSurface;
175 
176  KRATOS_ERROR << "Index " << Index << " not existing in NurbsCurveOnSurface: "
177  << this->Id() << std::endl;
178  }
179 
186  bool HasGeometryPart(const IndexType Index) const override
187  {
189  }
190 
194 
195  void Calculate(
196  const Variable<array_1d<double, 3>>& rVariable,
197  array_1d<double, 3>& rOutput
198  ) const override
199  {
200  if (rVariable == PARAMETER_2D_COORDINATES) {
201  array_1d<double, 3>& local_parameter = rOutput;
202  mpNurbsCurve->GlobalCoordinates(rOutput, local_parameter);
203  }
204  }
205 
209 
211  SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
212  {
213  return mpNurbsSurface->PolynomialDegree(0) + mpNurbsSurface->PolynomialDegree(1);
214  }
215 
221  {
222  return mpNurbsCurve;
223  }
224 
227  {
228  return mpNurbsCurve;
229  }
230 
234 
236  SizeType PointsNumberInDirection(IndexType LocalDirectionIndex) const override
237  {
238  return mpNurbsCurve->PointsNumberInDirection(LocalDirectionIndex);
239  }
240 
241  /* @brief Provides intersections of the nurbs curve with the knots of the surface,
242  * using the interval of this curve.
243  * @param vector of span intervals.
244  * @param index of chosen direction, for curves always 0.
245  */
246  void SpansLocalSpace(std::vector<double>& rSpans, IndexType DirectionIndex = 0) const override
247  {
248  auto interval = mpNurbsCurve->DomainInterval();
249  this->SpansLocalSpace(rSpans, interval.GetT0(), interval.GetT1());
250  }
251 
252  /* @brief Provides intersections of the nurbs curve with the knots of the surface.
253  * @return vector of interval limitations.
254  */
255  void SpansLocalSpace(std::vector<double>& rSpans,
256  double Start, double End) const
257  {
258  std::vector<double> surface_spans_u;
259  std::vector<double> surface_spans_v;
260  mpNurbsSurface->SpansLocalSpace(surface_spans_u, 0);
261  mpNurbsSurface->SpansLocalSpace(surface_spans_v, 1);
262 
264  rSpans,
265  *(mpNurbsCurve.get()), Start, End,
266  surface_spans_u, surface_spans_v,
267  1e-6);
268  }
269 
270  /* @brief Provides the nurbs boundaries of the NURBS/B-Spline curve.
271  * @return domain interval.
272  */
274  {
275  return mpNurbsCurve->DomainInterval();
276  }
277 
281 
282  /* @brief Makes projection of rPointGlobalCoordinates to
283  * the closest point on the curve, with
284  * local coordinates rProjectedPointLocalCoordinates.
285  *
286  * @param Tolerance is the breaking criteria.
287  * @return 1 -> projection succeeded
288  * 0 -> projection failed
289  */
291  const CoordinatesArrayType& rPointGlobalCoordinates,
292  CoordinatesArrayType& rProjectedPointLocalCoordinates,
293  const double Tolerance = std::numeric_limits<double>::epsilon()
294  ) const override
295  {
296  CoordinatesArrayType point_global_coordinates;
297 
299  rProjectedPointLocalCoordinates,
300  rPointGlobalCoordinates,
301  point_global_coordinates,
302  *this,
303  20, Tolerance);
304  }
305 
309 
310  /* @brief checks and returns if local coordinate rPointLocalCoordinates[0]
311  * is inside the local/parameter space.
312  * @return inside -> 1
313  * outside -> 0
314  */
316  const CoordinatesArrayType& rPointLocalCoordinates,
317  const double Tolerance = std::numeric_limits<double>::epsilon()
318  ) const override
319  {
320  return mpNurbsCurve->IsInsideLocalSpace(rPointLocalCoordinates, Tolerance);
321  }
322 
326 
327  /* @brief Makes a check if the provided paramater rPointLocalCoordinates[0]
328  * is inside the curve, or on the boundary or if it lays outside.
329  * If it is outside, it is set to the boundary which is closer to it.
330  * @return if rPointLocalCoordinates[0] was before the projection:
331  * on boundary -> 2 - meaning that it is equal to start or end point.
332  * inside -> 1
333  * outside -> 0
334  */
336  const CoordinatesArrayType& rPointLocalCoordinates,
337  CoordinatesArrayType& rClosestPointLocalCoordinates,
338  const double Tolerance = std::numeric_limits<double>::epsilon()
339  ) const override
340  {
341  return mpNurbsCurve->ClosestPointLocalToLocalSpace(rPointLocalCoordinates, rClosestPointLocalCoordinates, Tolerance);
342  }
343 
344 
348 
350  Point Center() const override
351  {
352  return mpNurbsSurface->Center();
353  }
354 
356  double Length() const override
357  {
358  IntegrationPointsArrayType integration_points;
359  IntegrationInfo integration_info = GetDefaultIntegrationInfo();
360  CreateIntegrationPoints(integration_points, integration_info);
361 
362  double length = 0.0;
363  for (IndexType i = 0; i < integration_points.size(); ++i) {
364  const double determinant_jacobian = DeterminantOfJacobian(integration_points[i]);
365  length += integration_points[i].Weight() * determinant_jacobian;
366  }
367  return length;
368  }
369 
373 
375  const CoordinatesArrayType& rPoint) const override
376  {
377  std::vector<CoordinatesArrayType> global_space_derivatives(2);
379  global_space_derivatives, rPoint, 1);
380  return norm_2(global_space_derivatives[1]);
381  }
382 
386 
389  {
390  IndexType p = mpNurbsSurface->PolynomialDegreeU() + mpNurbsSurface->PolynomialDegreeV() + 1;
392  }
393 
397 
398  /* Creates integration points according to the knot intersections
399  * of the underlying nurbs surface.
400  * @param result integration points.
401  */
403  IntegrationPointsArrayType& rIntegrationPoints,
404  IntegrationInfo& rIntegrationInfo) const override
405  {
406  std::vector<double> spans;
407  SpansLocalSpace(spans);
408 
410  rIntegrationPoints, spans, rIntegrationInfo);
411  }
412 
416 
429  GeometriesArrayType& rResultGeometries,
430  IndexType NumberOfShapeFunctionDerivatives,
431  const IntegrationPointsArrayType& rIntegrationPoints,
432  IntegrationInfo& rIntegrationInfo) override
433  {
434  // shape function container.
435  NurbsSurfaceShapeFunction shape_function_container(
436  mpNurbsSurface->PolynomialDegreeU(), mpNurbsSurface->PolynomialDegreeV(),
437  NumberOfShapeFunctionDerivatives);
438 
439  // Resize containers.
440  if (rResultGeometries.size() != rIntegrationPoints.size())
441  rResultGeometries.resize(rIntegrationPoints.size());
442 
443  auto default_method = this->GetDefaultIntegrationMethod();
444  SizeType num_nonzero_cps = shape_function_container.NumberOfNonzeroControlPoints();
445 
446  Matrix N(1, num_nonzero_cps);
447  DenseVector<Matrix> shape_function_derivatives(NumberOfShapeFunctionDerivatives - 1);
448  for (IndexType i = 0; i < NumberOfShapeFunctionDerivatives - 1; i++) {
449  shape_function_derivatives[i].resize(num_nonzero_cps, i + 2);
450  }
451 
452  for (IndexType i = 0; i < rIntegrationPoints.size(); ++i)
453  {
454  std::vector<CoordinatesArrayType> global_space_derivatives(2);
455  mpNurbsCurve->GlobalSpaceDerivatives(
456  global_space_derivatives,
457  rIntegrationPoints[i],
458  1);
459 
460  if (mpNurbsSurface->IsRational()) {
461  shape_function_container.ComputeNurbsShapeFunctionValues(
462  mpNurbsSurface->KnotsU(), mpNurbsSurface->KnotsV(), mpNurbsSurface->Weights(),
463  global_space_derivatives[0][0], global_space_derivatives[0][1]);
464  }
465  else {
466  shape_function_container.ComputeBSplineShapeFunctionValues(
467  mpNurbsSurface->KnotsU(), mpNurbsSurface->KnotsV(),
468  global_space_derivatives[0][0], global_space_derivatives[0][1]);
469  }
470 
472  PointsArrayType nonzero_control_points(num_nonzero_cps);
473  auto cp_indices = shape_function_container.ControlPointIndices(
474  mpNurbsSurface->NumberOfControlPointsU(), mpNurbsSurface->NumberOfControlPointsV());
475  for (IndexType j = 0; j < num_nonzero_cps; j++) {
476  nonzero_control_points(j) = mpNurbsSurface->pGetPoint(cp_indices[j]);
477  }
479  for (IndexType j = 0; j < num_nonzero_cps; j++) {
480  N(0, j) = shape_function_container(j, 0);
481  }
482 
484  if (NumberOfShapeFunctionDerivatives > 0) {
485  IndexType shape_derivative_index = 1;
486  for (IndexType n = 0; n < NumberOfShapeFunctionDerivatives - 1; n++) {
487  for (IndexType k = 0; k < n + 2; k++) {
488  for (IndexType j = 0; j < num_nonzero_cps; j++) {
489  shape_function_derivatives[n](j, k) = shape_function_container(j, shape_derivative_index + k);
490  }
491  }
492  shape_derivative_index += n + 2;
493  }
494  }
495 
497  default_method, rIntegrationPoints[i],
498  N, shape_function_derivatives);
499 
501  data_container, nonzero_control_points,
502  global_space_derivatives[1][0], global_space_derivatives[1][1], this);
503  }
504  }
505 
509 
510  /*
511  * @brief This method maps from dimension space to working space.
512  * From Piegl and Tiller, The NURBS Book, Algorithm A3.1/ A4.1
513  * @param rResult array_1d<double, 3> with the coordinates in working space
514  * @param LocalCoordinates The local coordinates in dimension space
515  * @return array_1d<double, 3> with the coordinates in working space
516  * @see PointLocalCoordinates
517  */
519  CoordinatesArrayType& rResult,
520  const CoordinatesArrayType& rLocalCoordinates
521  ) const override
522  {
523  // Compute the coordinates of the embedded curve in the parametric space of the surface
524  CoordinatesArrayType result_local = mpNurbsCurve->GlobalCoordinates(rResult, rLocalCoordinates);
525 
526  // Compute and return the coordinates of the surface in the geometric space
527  return mpNurbsSurface->GlobalCoordinates(rResult, result_local);
528  }
529 
540  std::vector<CoordinatesArrayType>& rGlobalSpaceDerivatives,
541  const CoordinatesArrayType& rCoordinates,
542  const SizeType DerivativeOrder) const override
543  {
544  // Check size of output
545  if (rGlobalSpaceDerivatives.size() != DerivativeOrder + 1) {
546  rGlobalSpaceDerivatives.resize(DerivativeOrder + 1);
547  }
548 
549  // Compute the gradients of the embedded curve in the parametric space of the surface
550  std::vector<array_1d<double, 3>> curve_derivatives;
551  mpNurbsCurve->GlobalSpaceDerivatives(curve_derivatives, rCoordinates, DerivativeOrder);
552 
553  // Compute the gradients of the surface in the geometric space
554  array_1d<double, 3> surface_coordinates = ZeroVector(3);
555  surface_coordinates[0] = curve_derivatives[0][0];
556  surface_coordinates[1] = curve_derivatives[0][1];
557  std::vector<array_1d<double, 3>> surface_derivatives;
558  mpNurbsSurface->GlobalSpaceDerivatives(surface_derivatives, surface_coordinates, DerivativeOrder);
559 
560  std::function<array_1d<double, 3>(int, int, int)> c;
561  c = [&](int DerivativeOrder, int i, int j) -> array_1d<double, 3> {
562  if (DerivativeOrder > 0) {
563  array_1d<double, 3> result = ZeroVector(3);
564 
565  for (int a = 1; a <= DerivativeOrder; a++) {
566  result += (
567  c(DerivativeOrder - a, i + 1, j) * curve_derivatives[a][0] +
568  c(DerivativeOrder - a, i, j + 1) * curve_derivatives[a][1]
569  ) * NurbsUtilities::GetBinomCoefficient(DerivativeOrder - 1, a - 1);
570  }
571 
572  return result;
573  }
574  else {
576  return surface_derivatives[index];
577  }
578  };
579  for (SizeType i = 0; i <= DerivativeOrder; i++) {
580  rGlobalSpaceDerivatives[i] = c(i, 0, 0);
581  }
582  }
583 
587 
589  {
591  }
592 
594  {
596  }
597 
601 
603  std::string Info() const override
604  {
605  return "2 dimensional nurbs curve on 3D surface.";
606  }
607 
609  void PrintInfo(std::ostream& rOStream) const override
610  {
611  rOStream << "2 dimensional nurbs curve on 3D surface.";
612  }
613 
615  void PrintData(std::ostream& rOStream) const override
616  {
617  }
618 
620 private:
623 
624  static const GeometryData msGeometryData;
625 
626  static const GeometryDimension msGeometryDimension;
627 
631 
632  typename NurbsSurfaceType::Pointer mpNurbsSurface;
633  typename NurbsCurveType::Pointer mpNurbsCurve;
634 
638 
639  friend class Serializer;
640 
641  void save(Serializer& rSerializer) const override
642  {
644  rSerializer.save("pNurbsSurface", mpNurbsSurface);
645  rSerializer.save("pNurbsCurve", mpNurbsCurve);
646  }
647 
648  void load(Serializer& rSerializer) override
649  {
651  rSerializer.load("pNurbsSurface", mpNurbsSurface);
652  rSerializer.load("pNurbsCurve", mpNurbsCurve);
653  }
654 
656 
657 }; // class NurbsCurveOnSurfaceGeometry
658 
659 template<int TWorkingSpaceDimension, class TCurveContainerPointType, class TSurfaceContainerPointType>
660 const GeometryData NurbsCurveOnSurfaceGeometry<TWorkingSpaceDimension, TCurveContainerPointType, TSurfaceContainerPointType>::msGeometryData(
663  {}, {}, {});
664 
665 template<int TWorkingSpaceDimension, class TCurveContainerPointType, class TSurfaceContainerPointType>
667 
668 } // namespace Kratos
669 
670 #endif // KRATOS_NURBS_CURVE_ON_SURFACE_H_INCLUDED defined
static GeometryPointerType CreateQuadraturePointCurveOnSurface(GeometryShapeFunctionContainer< GeometryData::IntegrationMethod > &rShapeFunctionContainer, PointsArrayType rPoints, double LocalTangentU, double LocalTangentV, GeometryType *pGeometryParent)
Definition: quadrature_points_utility.h:103
static void ComputeAxisIntersection(std::vector< double > &rIntersectionParameters, const GeometryType &rGeometry, double Start, double End, const std::vector< double > &rAxis1, const std::vector< double > &rAxis2, const double Tolerance)
Definition: curve_axis_intersection.h:146
Definition: geometry_data.h:60
KratosGeometryType
Definition: geometry_data.h:110
KratosGeometryFamily
Definition: geometry_data.h:91
Definition: geometry_dimension.h:42
Geometry base class.
Definition: geometry.h:71
Geometry & operator=(const Geometry &rOther)
Definition: geometry.h:400
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
std::size_t SizeType
Definition: geometry.h:144
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
std::size_t IndexType
Definition: geometry.h:137
IndexType const & Id() const
Id of this Geometry.
Definition: geometry.h:964
virtual void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo)
Definition: geometry.h:2331
static constexpr IndexType BACKGROUND_GEOMETRY_INDEX
Definition: geometry.h:220
IntegrationMethod GetDefaultIntegrationMethod() const
Definition: geometry.h:2004
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
Definition: geometry_shape_function_container.h:60
Integration information for the creation of integration points.
Definition: integration_info.h:35
static void CreateIntegrationPoints1D(IntegrationPointsArrayType &rIntegrationPoints, const std::vector< double > &rSpansLocalSpace, const IntegrationInfo &rIntegrationInfo)
Definition: integration_point_utilities.cpp:18
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Definition: nurbs_curve_geometry.h:33
Definition: nurbs_curve_on_surface_geometry.h:36
void GlobalSpaceDerivatives(std::vector< CoordinatesArrayType > &rGlobalSpaceDerivatives, const CoordinatesArrayType &rCoordinates, const SizeType DerivativeOrder) const override
This method maps from dimension space to working space and computes the number of derivatives at the ...
Definition: nurbs_curve_on_surface_geometry.h:539
NurbsCurveType::Pointer NurbsCurvePointerType
Definition: nurbs_curve_on_surface_geometry.h:54
BaseType::Pointer Create(TSurfaceContainerPointType const &ThisPoints) const override
Definition: nurbs_curve_on_surface_geometry.h:136
~NurbsCurveOnSurfaceGeometry() override=default
Destructor.
NurbsCurveOnSurfaceGeometry(NurbsCurveOnSurfaceGeometry const &rOther)
Copy constructor.
Definition: nurbs_curve_on_surface_geometry.h:89
NurbsCurveOnSurfaceGeometry & operator=(NurbsCurveOnSurfaceGeometry< TWorkingSpaceDimension, TOtherCurveContainerPointType, TOtherSurfaceContainerPointType > const &rOther)
Assignment operator for geometries with different point type.
Definition: nurbs_curve_on_surface_geometry.h:123
void Calculate(const Variable< array_1d< double, 3 >> &rVariable, array_1d< double, 3 > &rOutput) const override
Calculate with array_1d<double, 3>
Definition: nurbs_curve_on_surface_geometry.h:195
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: nurbs_curve_on_surface_geometry.h:588
const GeometryPointer pGetGeometryPart(const IndexType Index) const override
This function returns the pointer of the geometry which is corresponding to the trim index....
Definition: nurbs_curve_on_surface_geometry.h:171
GeometryPointer pGetGeometryPart(const IndexType Index) override
This function returns the pointer of the geometry which is corresponding to the trim index....
Definition: nurbs_curve_on_surface_geometry.h:156
TCurveContainerPointType::value_type CurveNodeType
Definition: nurbs_curve_on_surface_geometry.h:42
int IsInsideLocalSpace(const CoordinatesArrayType &rPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Checks if given point in local space coordinates of this geometry is inside the geometry boundaries.
Definition: nurbs_curve_on_surface_geometry.h:315
int ProjectionPointGlobalToLocalSpace(const CoordinatesArrayType &rPointGlobalCoordinates, CoordinatesArrayType &rProjectedPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Projects a point onto the geometry Projects a certain point on the geometry, or finds the closest poi...
Definition: nurbs_curve_on_surface_geometry.h:290
TSurfaceContainerPointType::value_type NodeType
Definition: nurbs_curve_on_surface_geometry.h:41
BaseType::IndexType IndexType
Definition: nurbs_curve_on_surface_geometry.h:49
BaseType::SizeType SizeType
Definition: nurbs_curve_on_surface_geometry.h:50
NurbsCurveGeometry< 2, TCurveContainerPointType > NurbsCurveType
Definition: nurbs_curve_on_surface_geometry.h:53
NurbsCurveOnSurfaceGeometry & operator=(const NurbsCurveOnSurfaceGeometry &rOther)
Assignment operator.
Definition: nurbs_curve_on_surface_geometry.h:113
void SpansLocalSpace(std::vector< double > &rSpans, IndexType DirectionIndex=0) const override
Definition: nurbs_curve_on_surface_geometry.h:246
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration dependent on the polynomial degree of the underlying surface.
Definition: nurbs_curve_on_surface_geometry.h:388
std::string Info() const override
Turn back information as a string.
Definition: nurbs_curve_on_surface_geometry.h:603
CoordinatesArrayType & GlobalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rLocalCoordinates) const override
Definition: nurbs_curve_on_surface_geometry.h:518
NurbsCurvePointerType pGetCurve()
Definition: nurbs_curve_on_surface_geometry.h:220
double DeterminantOfJacobian(const CoordinatesArrayType &rPoint) const override
Definition: nurbs_curve_on_surface_geometry.h:374
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: nurbs_curve_on_surface_geometry.h:56
SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
Return polynomial degree of the curve.
Definition: nurbs_curve_on_surface_geometry.h:211
NurbsCurveOnSurfaceGeometry(NurbsCurveOnSurfaceGeometry< TWorkingSpaceDimension, TOtherCurveContainerPointType, TOtherSurfaceContainerPointType > const &rOther)
Copy constructor, with different point type.
Definition: nurbs_curve_on_surface_geometry.h:97
BaseType::GeometriesArrayType GeometriesArrayType
Definition: nurbs_curve_on_surface_geometry.h:58
double Length() const override
Computes the length of a nurbs curve.
Definition: nurbs_curve_on_surface_geometry.h:356
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: nurbs_curve_on_surface_geometry.h:59
int ClosestPointLocalToLocalSpace(const CoordinatesArrayType &rPointLocalCoordinates, CoordinatesArrayType &rClosestPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Calculates the closes point projection This method calculates the closest point projection of a point...
Definition: nurbs_curve_on_surface_geometry.h:335
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) override
This method creates a list of quadrature point geometries from a list of integration points.
Definition: nurbs_curve_on_surface_geometry.h:428
bool HasGeometryPart(const IndexType Index) const override
This function is used to check if the index is GeometryType::BACKGROUND_GEOMETRY_INDEX.
Definition: nurbs_curve_on_surface_geometry.h:186
KRATOS_CLASS_POINTER_DEFINITION(NurbsCurveOnSurfaceGeometry)
Counted pointer of NurbsCurveOnSurfaceGeometry.
GeometryType::Pointer GeometryPointer
Definition: nurbs_curve_on_surface_geometry.h:45
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: nurbs_curve_on_surface_geometry.h:609
Geometry< NodeType > BaseType
Definition: nurbs_curve_on_surface_geometry.h:47
Point Center() const override
Provides the center of the underlying surface.
Definition: nurbs_curve_on_surface_geometry.h:350
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Definition: nurbs_curve_on_surface_geometry.h:402
NurbsSurfaceGeometry< 3, TSurfaceContainerPointType > NurbsSurfaceType
Definition: nurbs_curve_on_surface_geometry.h:52
NurbsCurveOnSurfaceGeometry(typename NurbsSurfaceType::Pointer pSurface, typename NurbsCurveType::Pointer pCurve)
Constructor.
Definition: nurbs_curve_on_surface_geometry.h:74
const NurbsCurvePointerType pGetCurve() const
Returns the const NurbsCurveOnSurface::Pointer of this brep.
Definition: nurbs_curve_on_surface_geometry.h:226
NurbsInterval DomainInterval() const
Definition: nurbs_curve_on_surface_geometry.h:273
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: nurbs_curve_on_surface_geometry.h:593
Geometry< NodeType > GeometryType
Definition: nurbs_curve_on_surface_geometry.h:44
BaseType::PointsArrayType PointsArrayType
Definition: nurbs_curve_on_surface_geometry.h:57
void SpansLocalSpace(std::vector< double > &rSpans, double Start, double End) const
Definition: nurbs_curve_on_surface_geometry.h:255
SizeType PointsNumberInDirection(IndexType LocalDirectionIndex) const override
Returns number of points of NurbsCurve.
Definition: nurbs_curve_on_surface_geometry.h:236
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: nurbs_curve_on_surface_geometry.h:615
NurbsCurveOnSurfaceGeometry()
Default constructor.
Definition: nurbs_curve_on_surface_geometry.h:84
Class for optimized use of intervals.
Definition: nurbs_interval.h:36
Definition: nurbs_surface_geometry.h:38
Definition: nurbs_surface_shape_functions.h:31
void ComputeNurbsShapeFunctionValues(const Vector &rKnotsU, const Vector &rKnotsV, const Vector &Weights, const double ParameterU, const double ParameterV)
Definition: nurbs_surface_shape_functions.h:379
std::vector< int > ControlPointIndices(SizeType NumberOfControlPointsU, SizeType NumberOfControlPointsV) const
Definition: nurbs_surface_shape_functions.h:175
static constexpr IndexType IndexOfShapeFunctionRow(const SizeType DerivativeOrderU, const SizeType DerivativeOrderV) noexcept
Definition: nurbs_surface_shape_functions.h:76
SizeType NumberOfNonzeroControlPoints() const
Definition: nurbs_surface_shape_functions.h:151
void ComputeBSplineShapeFunctionValues(const Vector &rKnotsU, const Vector &rKnotsV, const double ParameterU, const double ParameterV)
Definition: nurbs_surface_shape_functions.h:280
Point class.
Definition: point.h:59
PointerVector is a container like stl vector but using a vector to store pointers to its data.
Definition: pointer_vector.h:72
size_type size() const
Definition: pointer_vector.h:255
void resize(size_type dim)
Definition: pointer_vector.h:314
static bool NewtonRaphsonCurve(CoordinatesArrayType &rProjectedPointLocalCoordinates, const CoordinatesArrayType &rPointGlobalCoordinatesCoordinates, CoordinatesArrayType &rProjectedPointGlobalCoordinates, const Geometry< TPointType > &rGeometry, const int MaxIterations=20, const double Accuracy=1e-6)
Definition: projection_nurbs_geometry_utilities.h:51
The serialization consists in storing the state of an object into a storage format like data file or ...
Definition: serializer.h:123
void load(std::string const &rTag, TDataType &rObject)
Definition: serializer.h:207
void save(std::string const &rTag, std::array< TDataType, TDataSize > const &rObject)
Definition: serializer.h:545
Variable class contains all information needed to store and retrive data from a data container.
Definition: variable.h:63
Short class definition.
Definition: array_1d.h:61
#define KRATOS_SERIALIZE_SAVE_BASE_CLASS(Serializer, BaseType)
Definition: define.h:812
#define KRATOS_SERIALIZE_LOAD_BASE_CLASS(Serializer, BaseType)
Definition: define.h:815
#define KRATOS_ERROR
Definition: exception.h:161
static constexpr SizeType GetBinomCoefficient(const SizeType N, const SizeType K) noexcept
Definition: nurbs_utilities.h:117
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
TExpressionType::data_type norm_2(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression)
Definition: amatrix_interface.h:625
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
a
Definition: generate_stokes_twofluid_element.py:77
c
Definition: generate_weakly_compressible_navier_stokes_element.py:108
def Index()
Definition: hdf5_io_tools.py:38
def load(f)
Definition: ode_solve.py:307
int n
manufactured solution and derivatives (u=0 at z=0 dudz=0 at z=domain_height)
Definition: ode_solve.py:402
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
p
Definition: sensitivityMatrix.py:52
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31