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_volume_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: Manuel Messmer
11 //
12 
13 #if !defined(KRATOS_NURBS_VOLUME_GEOMETRY_H_INCLUDED )
14 #define KRATOS_NURBS_VOLUME_GEOMETRY_H_INCLUDED
15 
16 // System includes
17 
18 // External includes
19 
20 // Project includes
21 #include "geometries/geometry.h"
22 
26 
28 
30 
31 namespace Kratos {
32 
35 
44 template <class TContainerPointType>
45 class NurbsVolumeGeometry : public Geometry<typename TContainerPointType::value_type>
46 {
47 public:
50 
51  typedef typename TContainerPointType::value_type NodeType;
52 
54 
55  typedef typename BaseType::IndexType IndexType;
56  typedef typename BaseType::SizeType SizeType;
57 
62 
66 
67  // Using base class functionalities.
68  using BaseType::pGetPoint;
69  using BaseType::GetPoint;
70 
73 
77 
80  const PointsArrayType& rThisPoints,
84  const Vector& rKnotsU,
85  const Vector& rKnotsV,
86  const Vector& rKnotsW)
87  : BaseType(rThisPoints, &msGeometryData)
88  , mPolynomialDegreeU(PolynomialDegreeU)
89  , mPolynomialDegreeV(PolynomialDegreeV)
90  , mPolynomialDegreeW(PolynomialDegreeW)
91  , mKnotsU(rKnotsU)
92  , mKnotsV(rKnotsV)
93  , mKnotsW(rKnotsW)
94  {
95  CheckAndFitKnotVectors();
96  }
97 
100  // NurbsVolumeGeometry(
101  // const PointsArrayType& rThisPoints,
102  // const SizeType PolynomialDegreeU,
103  // const SizeType PolynomialDegreeV,
104  // const SizeType PolynomialDegreeW,
105  // const Vector& rKnotsU,
106  // const Vector& rKnotsV,
107  // const Vector& rKnotsW,
108  // const Vector& rWeights)
109  // : BaseType(rThisPoints, &msGeometryData)
110  // , mPolynomialDegreeU(PolynomialDegreeU)
111  // , mPolynomialDegreeV(PolynomialDegreeV)
112  // , mPolynomialDegreeW(PolynomialDegreeW)
113  // , mKnotsU(rKnotsU)
114  // , mKnotsV(rKnotsV)
115  // , mKnotsW(rKnotsW)
116  // , mWeights(rWeights)
117  // {
118  // CheckAndFitKnotVectors();
119 
120  // KRATOS_ERROR_IF(rWeights.size() != rThisPoints.size())
121  // << "Number of control points and weights do not match!" << std::endl;
122  // }
123 
124  explicit NurbsVolumeGeometry(const PointsArrayType& ThisPoints)
125  : BaseType(ThisPoints, &msGeometryData)
126  {
127  }
128 
131  : BaseType(rOther)
132  , mPolynomialDegreeU(rOther.mPolynomialDegreeU)
133  , mPolynomialDegreeV(rOther.mPolynomialDegreeV)
134  , mPolynomialDegreeW(rOther.mPolynomialDegreeW)
135  , mKnotsU(rOther.mKnotsU)
136  , mKnotsV(rOther.mKnotsV)
137  , mKnotsW(rOther.mKnotsW)
138  {
139  }
140 
142  template<class TOtherContainerPointType> NurbsVolumeGeometry(
144  : BaseType(rOther, &msGeometryData)
145  , mPolynomialDegreeU(rOther.mPolynomialDegreeU)
146  , mPolynomialDegreeV(rOther.mPolynomialDegreeV)
147  , mPolynomialDegreeW(rOther.mPolynomialDegreeW)
148  , mKnotsU(rOther.mKnotsU)
149  , mKnotsV(rOther.mKnotsV)
150  , mKnotsW(rOther.mKnotsW)
151  {
152  }
153 
155  ~NurbsVolumeGeometry() override = default;
156 
160 
163  {
164  BaseType::operator=(rOther);
165  mPolynomialDegreeU = rOther.mPolynomialDegreeU;
166  mPolynomialDegreeV = rOther.mPolynomialDegreeV;
167  mPolynomialDegreeW = rOther.mPolynomialDegreeW;
168  mKnotsU = rOther.mKnotsU;
169  mKnotsV = rOther.mKnotsV;
170  mKnotsW = rOther.mKnotsW;
171  return *this;
172  }
173 
175  template<class TOtherContainerPointType>
178  {
179  BaseType::operator=(rOther);
180  mPolynomialDegreeU = rOther.mPolynomialDegreeU;
181  mPolynomialDegreeV = rOther.mPolynomialDegreeV;
182  mPolynomialDegreeW = rOther.mPolynomialDegreeW;
183  mKnotsU = rOther.mKnotsU;
184  mKnotsV = rOther.mKnotsV;
185  mKnotsW = rOther.mKnotsW;
186  return *this;
187  }
188 
192 
193  typename BaseType::Pointer Create(
194  PointsArrayType const& ThisPoints) const override
195  {
196  return Kratos::make_shared<NurbsVolumeGeometry>(ThisPoints);
197  }
198 
202 
204  SizeType PointsNumberInDirection(IndexType LocalDirectionIndex) const override
205  {
206  if (LocalDirectionIndex == 0) {
207  return this->NumberOfControlPointsU();
208  }
209  else if (LocalDirectionIndex == 1) {
210  return this->NumberOfControlPointsV();
211  }
212  else if (LocalDirectionIndex == 2) {
213  return this->NumberOfControlPointsW();
214  }
215  KRATOS_ERROR << "Possible direction index in NurbsVolumeGeometry reaches from 0-2. Given direction index: "
216  << LocalDirectionIndex << std::endl;
217  }
218 
222 
224  SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
225  {
226  KRATOS_DEBUG_ERROR_IF(LocalDirectionIndex > 2)
227  << "Trying to access polynomial degree in direction " << LocalDirectionIndex
228  << " from NurbsVolumeGeometry #" << this->Id() << ". Nurbs volume have only three directions."
229  << std::endl;
230 
231  if (LocalDirectionIndex == 0) {
232  return mPolynomialDegreeU;
233  }
234  else if(LocalDirectionIndex == 1){
235  return mPolynomialDegreeV;
236  }
237  else {
238  return mPolynomialDegreeW;
239  }
240  }
241 
245 
247  const PointsArrayType& rThisPoints,
251  const Vector& rKnotsU,
252  const Vector& rKnotsV,
253  const Vector& rKnotsW)
254  {
255  this->Points() = rThisPoints;
256  mPolynomialDegreeU = PolynomialDegreeU;
257  mPolynomialDegreeV = PolynomialDegreeV;
258  mPolynomialDegreeW = PolynomialDegreeW;
259  mKnotsU = rKnotsU;
260  mKnotsV = rKnotsV;
261  mKnotsW = rKnotsW;
262 
263  CheckAndFitKnotVectors();
264  }
265 
270  {
271  return mPolynomialDegreeU;
272  }
273 
278  {
279  return mPolynomialDegreeV;
280  }
281 
286  {
287  return mPolynomialDegreeW;
288  }
289 
295  const Vector& KnotsU() const
296  {
297  return mKnotsU;
298  }
299 
305  const Vector& KnotsV() const
306  {
307  return mKnotsV;
308  }
309 
315  const Vector& KnotsW() const
316  {
317  return mKnotsW;
318  }
319 
324  {
325  return mKnotsU.size();
326  }
327 
332  {
333  return mKnotsV.size();
334  }
335 
340  {
341  return mKnotsW.size();
342  }
343 
348  bool IsRational() const
349  {
350  return false;
351  }
352 
354  /* Get Weights vector. All values are 1.0 for B-Splines, for NURBS those can be unequal 1.0.
355  @return weights vector.
356  */
357  // const Vector& Weights() const
358  // {
359  // return mWeights;
360  // }
361 
366  {
367  return NumberOfKnotsU() - PolynomialDegreeU() + 1;
368  }
369 
374  {
375  return NumberOfKnotsV() - PolynomialDegreeV() + 1;
376  }
377 
382  {
383  return NumberOfKnotsW() - PolynomialDegreeW() + 1;
384  }
385 
390  SizeType NumberOfKnotSpans(IndexType DirectionIndex) const
391  {
392  SizeType knot_span_counter = 0;
393  if (DirectionIndex == 0) {
394  for (IndexType i = 0; i < mKnotsU.size() - 1; ++i) {
395  if (std::abs(mKnotsU[i] - mKnotsU[i + 1]) > 1e-6) {
396  knot_span_counter++;
397  }
398  }
399  }
400  else if (DirectionIndex == 1) {
401  for (IndexType i = 0; i < mKnotsV.size() - 1; ++i) {
402  if (std::abs(mKnotsV[i] - mKnotsV[i + 1]) > 1e-6) {
403  knot_span_counter++;
404  }
405  }
406  }
407  else if (DirectionIndex == 2){
408  for( IndexType i = 0; i < mKnotsW.size() - 1; ++i){
409  if( std::abs(mKnotsW[i] - mKnotsW[i+1]) > 1e-6) {
410  knot_span_counter++;
411  }
412  }
413 
414  } else {
415  KRATOS_ERROR << "NurbsVolumeGeometry::NumberOfKnotSpans: Direction index: "
416  << DirectionIndex << " not available. Options are: 0, 1 and 2." << std::endl;
417  }
418  return knot_span_counter;
419  }
420 
426  void Spans(std::vector<double>& rSpans, IndexType DirectionIndex) const
427  {
428  rSpans.resize(this->NumberOfKnotSpans(DirectionIndex) + 1);
429 
430  if (DirectionIndex == 0) {
431  rSpans[0] = mKnotsU[0];
432 
433  IndexType counter = 1;
434  for (IndexType i = 0; i < mKnotsU.size() - 1; ++i) {
435  if (std::abs(mKnotsU[i] - mKnotsU[i + 1]) > 1e-6) {
436  rSpans[counter] = mKnotsU[i + 1];
437  counter++;
438  }
439  }
440  }
441  else if (DirectionIndex == 1) {
442  rSpans[0] = mKnotsV[0];
443 
444  IndexType counter = 1;
445  for (IndexType i = 0; i < mKnotsV.size() - 1; ++i) {
446  if (std::abs(mKnotsV[i] - mKnotsV[i + 1]) > 1e-6) {
447  rSpans[counter] = mKnotsV[i + 1];
448  counter++;
449  }
450  }
451  }
452  else if (DirectionIndex == 2) {
453  rSpans[0] = mKnotsW[0];
454 
455  IndexType counter = 1;
456  for (IndexType i = 0; i < mKnotsW.size() - 1; ++i) {
457  if (std::abs(mKnotsW[i] - mKnotsW[i + 1]) > 1e-6) {
458  rSpans[counter] = mKnotsW[i + 1];
459  counter++;
460  }
461  }
462  } else {
463  KRATOS_ERROR << "NurbsVolumeGeometry::Spans: Direction index: "
464  << DirectionIndex << " not available. Options are: 0, 1 and 2." << std::endl;
465  }
466  }
467 
473  {
474  return NurbsInterval(
475  mKnotsU[mPolynomialDegreeU - 1],
476  mKnotsU[NumberOfKnotsU() - mPolynomialDegreeU]);
477  }
478 
484  {
485  return NurbsInterval(
486  mKnotsV[mPolynomialDegreeV - 1],
487  mKnotsV[NumberOfKnotsV() - mPolynomialDegreeV]);
488  }
489 
495  {
496  return NurbsInterval(
497  mKnotsW[mPolynomialDegreeW - 1],
498  mKnotsW[NumberOfKnotsW() - mPolynomialDegreeW]);
499  }
500 
505  std::vector<NurbsInterval> KnotSpanIntervalsU() const
506  {
507  const SizeType first_span = mPolynomialDegreeU - 1;
508  const SizeType last_span = NumberOfKnotsU() - mPolynomialDegreeU - 1;
509 
510  const SizeType number_of_spans = last_span - first_span + 1;
511 
512  std::vector<NurbsInterval> result(number_of_spans);
513 
514  for (IndexType i = 0; i < number_of_spans; i++) {
515  const double t0 = mKnotsU[first_span + i];
516  const double t1 = mKnotsU[first_span + i + 1];
517 
518  result[i] = NurbsInterval(t0, t1);
519  }
520 
521  return result;
522  }
523 
528  std::vector<NurbsInterval> KnotSpanIntervalsV() const
529  {
530  const SizeType first_span = mPolynomialDegreeV - 1;
531  const SizeType last_span = NumberOfKnotsV() - mPolynomialDegreeV - 1;
532 
533  const SizeType number_of_spans = last_span - first_span + 1;
534 
535  std::vector<NurbsInterval> result(number_of_spans);
536 
537  for (IndexType i = 0; i < number_of_spans; i++) {
538  const double t0 = mKnotsV[first_span + i];
539  const double t1 = mKnotsV[first_span + i + 1];
540 
541  result[i] = NurbsInterval(t0, t1);
542  }
543 
544  return result;
545  }
546 
551  std::vector<NurbsInterval> KnotSpanIntervalsW() const
552  {
553  const SizeType first_span = mPolynomialDegreeW - 1;
554  const SizeType last_span = NumberOfKnotsW() - mPolynomialDegreeW - 1;
555 
556  const SizeType number_of_spans = last_span - first_span + 1;
557 
558  std::vector<NurbsInterval> result(number_of_spans);
559 
560  for (IndexType i = 0; i < number_of_spans; i++) {
561  const double t0 = mKnotsW[first_span + i];
562  const double t1 = mKnotsW[first_span + i + 1];
563 
564  result[i] = NurbsInterval(t0, t1);
565  }
566 
567  return result;
568  }
569 
573 
576  {
577  return IntegrationInfo(
578  { PolynomialDegreeU() + 1, PolynomialDegreeV() + 1, PolynomialDegreeW() + 1 },
580  }
581 
585 
591  IntegrationPointsArrayType& rIntegrationPoints,
592  IntegrationInfo& rIntegrationInfo) const override
593  {
594  const SizeType points_in_u = PolynomialDegreeU() + 1;
595  const SizeType points_in_v = PolynomialDegreeV() + 1;
596  const SizeType points_in_w = PolynomialDegreeW() + 1;
597 
599  rIntegrationPoints, points_in_u, points_in_v, points_in_w);
600  }
601 
610  IntegrationPointsArrayType& rIntegrationPoints,
611  SizeType NumPointsPerSpanU,
612  SizeType NumPointsPerSpanV,
613  SizeType NumPointsPerSpanW) const
614  {
615  auto knot_span_intervals_u = KnotSpanIntervalsU();
616  auto knot_span_intervals_v = KnotSpanIntervalsV();
617  auto knot_span_intervals_w = KnotSpanIntervalsW();
618 
619  const SizeType number_of_integration_points =
620  knot_span_intervals_u.size() * knot_span_intervals_v.size() * knot_span_intervals_w.size()
621  * NumPointsPerSpanU * NumPointsPerSpanV * NumPointsPerSpanW;
622 
623  if (rIntegrationPoints.size() != number_of_integration_points) {
624  rIntegrationPoints.resize(number_of_integration_points);
625  }
626 
627  typename IntegrationPointsArrayType::iterator integration_point_iterator = rIntegrationPoints.begin();
628 
629  for (IndexType i = 0; i < knot_span_intervals_u.size(); ++i) {
630  for (IndexType j = 0; j < knot_span_intervals_v.size(); ++j) {
631  for (IndexType k = 0; k < knot_span_intervals_w.size(); ++k) {
633  integration_point_iterator,
634  NumPointsPerSpanU, NumPointsPerSpanV, NumPointsPerSpanW,
635  knot_span_intervals_u[i].GetT0(), knot_span_intervals_u[i].GetT1(),
636  knot_span_intervals_v[j].GetT0(), knot_span_intervals_v[j].GetT1(),
637  knot_span_intervals_w[k].GetT0(), knot_span_intervals_w[k].GetT1());
638  }
639  }
640  }
641  }
642 
652  Matrix& Jacobian( Matrix& rResult, const CoordinatesArrayType& rCoordinates ) const override
653  {
654  const SizeType working_space_dimension = this->WorkingSpaceDimension();
655  const SizeType local_space_dimension = this->LocalSpaceDimension();
656  const SizeType points_number = this->PointsNumber();
657 
658  rResult = ZeroMatrix(working_space_dimension,local_space_dimension);
659 
660  Matrix shape_functions_gradients(points_number, local_space_dimension);
661  ShapeFunctionsLocalGradients( shape_functions_gradients, rCoordinates );
662 
663  // Get control point indices
664  NurbsVolumeShapeFunction shape_function_container(mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, 0);
665  shape_function_container.ComputeBSplineShapeFunctionValues(mKnotsU,mKnotsV,mKnotsW,
666  rCoordinates[0], rCoordinates[1], rCoordinates[2]);
667 
668  SizeType number_cp_u = NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeU, mKnotsU.size());
669  SizeType number_cp_v = NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeV, mKnotsV.size());
670  SizeType number_cp_w = NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeW, mKnotsW.size());
671 
672  std::vector<int> cp_indices = shape_function_container.ControlPointIndices(number_cp_u, number_cp_v, number_cp_w);
673  SizeType number_of_cp = shape_function_container.NumberOfNonzeroControlPoints();
674 
675  for (IndexType i = 0; i < number_of_cp; ++i ) {
676  const array_1d<double, 3>& r_coordinates = (*this)[cp_indices[i]].Coordinates();
677  for(IndexType k = 0; k< working_space_dimension; ++k) {
678  const double value = r_coordinates[k];
679  for(IndexType m = 0; m < local_space_dimension; ++m) {
680  rResult(k,m) += value * shape_functions_gradients(i,m);
681  }
682  }
683  }
684 
685  return rResult;
686  }
687 
691 
702  GeometriesArrayType& rResultGeometries,
703  IndexType NumberOfShapeFunctionDerivatives,
704  IntegrationInfo& rIntegrationInfo) override
705  {
707  CreateIntegrationPoints(IntegrationPoints, rIntegrationInfo);
708 
709  // Makes sure we use assembly Option 2 in CreateQuadraturePointGeometries().
710  IntegrationInfo integration_info(
711  { PolynomialDegreeU() + 1, PolynomialDegreeV() + 1, PolynomialDegreeW() + 1 },
713 
715  rResultGeometries,
716  NumberOfShapeFunctionDerivatives,
718  integration_info);
719  }
720 
732  GeometriesArrayType& rResultGeometries,
733  IndexType NumberOfShapeFunctionDerivatives,
734  const IntegrationPointsArrayType& rIntegrationPoints,
735  IntegrationInfo& rIntegrationInfo) override
736  {
737  // Option 1: One QuadraturePointGeometry is created containing all integration points. This should be used
738  // when all rIntegrationPoints are located inside the same element.
740  KRATOS_ERROR_IF(NumberOfShapeFunctionDerivatives != 2) << "NumberOfShapeFunctionDerivatives must be 2.\n";
741  // Shape function container.
742  NurbsVolumeShapeFunction shape_function_container(
743  mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, NumberOfShapeFunctionDerivatives);
744 
745  // Resize containers.
746  if (rResultGeometries.size() != 1){
747  rResultGeometries.resize(1);
748  }
749 
750  const auto default_method = this->GetDefaultIntegrationMethod();
751 
752  const SizeType num_nonzero_cps = shape_function_container.NumberOfNonzeroControlPoints();
753  const SizeType num_points = rIntegrationPoints.size();
754  KRATOS_ERROR_IF(num_points < 1) << "List of integration points is empty.\n";
755 
756  // Initialize containers.
757  IntegrationPointsContainerType integration_points;
758  ShapeFunctionsValuesContainerType shape_function_values;
759  ShapeFunctionsLocalGradientsContainerType shape_function_gradients;
760 
761  integration_points[0] = rIntegrationPoints;
762  shape_function_gradients[0].resize(rIntegrationPoints.size());
763  shape_function_values[0].resize(rIntegrationPoints.size(), num_nonzero_cps);
764 
765  for( IndexType i_point = 0; i_point < num_points; ++i_point){
766  shape_function_gradients[0][i_point].resize(num_nonzero_cps, 3);
767  }
768 
769  // Centroid of points. This will be used to identify knot span.
770  // Single point might be located on the boundary of two knot spans.
771  array_1d<double, 3> centroid(3, 0.0);
772 
773  // Fill containers
774  for (IndexType i_point = 0; i_point < num_points; ++i_point)
775  {
776  // Compute centroid.
777  centroid += rIntegrationPoints[i_point].Coordinates();
778 
779  shape_function_container.ComputeBSplineShapeFunctionValues(
780  mKnotsU, mKnotsV, mKnotsW,
781  rIntegrationPoints[i_point][0], rIntegrationPoints[i_point][1], rIntegrationPoints[i_point][2]);
782 
784  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
785  shape_function_values[0](i_point, j) = shape_function_container(j, 0);
786  }
787 
788  // Get Shape Function Derivatives DN_De, ...
789  for (IndexType k = 0; k < 3; ++k) {
790  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
791  shape_function_gradients[0][i_point](j, k) = shape_function_container(j, 1 + k);
792  }
793  }
794  }
795 
797  PointsArrayType nonzero_control_points(num_nonzero_cps);
798  centroid /= num_points;
799  shape_function_container.ComputeBSplineShapeFunctionValues(
800  mKnotsU, mKnotsV, mKnotsW,
801  centroid[0], centroid[1], centroid[2]);
802 
803  auto cp_indices = shape_function_container.ControlPointIndices(
805 
806  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
807  nonzero_control_points(j) = pGetPoint(cp_indices[j]);
808  }
809 
810  // Instantiate shape function container.
812  default_method, integration_points,
813  shape_function_values, shape_function_gradients);
814 
815  // Create quadrature point geometry.
817  this->WorkingSpaceDimension(), 3, data_container, nonzero_control_points, this);
818  }
819  // Option 2: A list of QuadraturePointGeometry is created, one for each integration points.
821  // Shape function container.
822  NurbsVolumeShapeFunction shape_function_container(
823  mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, NumberOfShapeFunctionDerivatives);
824 
825  // Resize containers.
826  if (rResultGeometries.size() != rIntegrationPoints.size())
827  rResultGeometries.resize(rIntegrationPoints.size());
828 
829  auto default_method = this->GetDefaultIntegrationMethod();
830  SizeType num_nonzero_cps = shape_function_container.NumberOfNonzeroControlPoints();
831 
832  Matrix N(1, num_nonzero_cps);
833  DenseVector<Matrix> shape_function_derivatives(NumberOfShapeFunctionDerivatives - 1);
834 
835  for (IndexType i = 0; i < NumberOfShapeFunctionDerivatives - 1; ++i) {
836  const IndexType num_derivatives = (2 + i) * (3 + i) / 2;
837  shape_function_derivatives[i].resize(num_nonzero_cps, num_derivatives);
838  }
839 
840  for (IndexType i = 0; i < rIntegrationPoints.size(); ++i)
841  {
842  shape_function_container.ComputeBSplineShapeFunctionValues(
843  mKnotsU, mKnotsV, mKnotsW, rIntegrationPoints[i][0], rIntegrationPoints[i][1], rIntegrationPoints[i][2]);
844 
845 
847  PointsArrayType nonzero_control_points(num_nonzero_cps);
848  auto cp_indices = shape_function_container.ControlPointIndices(
850  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
851  nonzero_control_points(j) = pGetPoint(cp_indices[j]);
852  }
854  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
855  N(0, j) = shape_function_container(j, 0);
856  }
857 
859  if (NumberOfShapeFunctionDerivatives > 0) {
860  IndexType shape_derivative_index = 1;
861  for (IndexType n = 0; n < NumberOfShapeFunctionDerivatives - 1; ++n) {
862  const IndexType num_derivatives = (2 + n) * (3 + n) / 2;
863  for (IndexType k = 0; k < num_derivatives; ++k) {
864  for (IndexType j = 0; j < num_nonzero_cps; ++j) {
865  shape_function_derivatives[n](j, k) = shape_function_container(j, shape_derivative_index + k);
866  }
867  }
868  shape_derivative_index += num_derivatives;
869  }
870  }
871 
873  default_method, rIntegrationPoints[i],
874  N, shape_function_derivatives);
875 
877  this->WorkingSpaceDimension(), 3, data_container, nonzero_control_points, this);
878  }
879  } else {
880  KRATOS_ERROR << "Integration method not available.\n";
881  }
882  }
883 
887 
901  const CoordinatesArrayType& rPointGlobalCoordinates,
902  CoordinatesArrayType& rProjectedPointLocalCoordinates,
903  const double Tolerance = std::numeric_limits<double>::epsilon()
904  ) const override
905  {
906  const CoordinatesArrayType& lower_point = this->begin()->GetInitialPosition();
907  const CoordinatesArrayType& upper_point = (this->end()-1)->GetInitialPosition();
908 
909  const Vector& knots_u = this->KnotsU();
910  const SizeType nb_knots_u = this->NumberOfKnotsU();
911  const Vector& knots_v = this->KnotsV();
912  const SizeType nb_knots_v = this->NumberOfKnotsV();
913  const Vector& knots_w = this->KnotsW();
914  const SizeType nb_knots_w = this->NumberOfKnotsW();
915 
916  rProjectedPointLocalCoordinates[0] = ((rPointGlobalCoordinates[0] - lower_point[0]) / std::abs( lower_point[0] - upper_point[0])
917  * std::abs(knots_u[nb_knots_u-1] - knots_u[0])) + knots_u[0];
918  rProjectedPointLocalCoordinates[1] = ((rPointGlobalCoordinates[1] - lower_point[1]) / std::abs( lower_point[1] - upper_point[1])
919  * std::abs(knots_v[nb_knots_v-1] - knots_v[0])) + knots_v[0];
920  rProjectedPointLocalCoordinates[2] = ((rPointGlobalCoordinates[2] - lower_point[2]) / std::abs( lower_point[2] - upper_point[2])
921  * std::abs(knots_w[nb_knots_w-1] - knots_w[0])) + knots_w[0];
922  return 1;
923  }
924 
931  CoordinatesArrayType& rResult,
932  const CoordinatesArrayType& rLocalCoordinates
933  ) const override
934  {
935  NurbsVolumeShapeFunction shape_function_container(mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, 0);
936 
937  // Attention: Weights are not yet implemented.
938  // if (IsRational()) {
939  // shape_function_container.ComputeNurbsShapeFunctionValues(
940  // mKnotsU, mKnotsV, mKnotsW, mWeights, rLocalCoordinates[0], rLocalCoordinates[1], rLocalCoordinates[2]);
941  // }
942 
943  shape_function_container.ComputeBSplineShapeFunctionValues(
944  mKnotsU, mKnotsV, mKnotsW, rLocalCoordinates[0], rLocalCoordinates[1], rLocalCoordinates[2]);
945 
946 
947  noalias(rResult) = ZeroVector(3);
948  for (IndexType u = 0; u <= PolynomialDegreeU(); ++u) {
949  for (IndexType v = 0; v <= PolynomialDegreeV(); ++v) {
950  for(IndexType w = 0; w <= PolynomialDegreeW(); ++w) {
951  IndexType cp_index_u = shape_function_container.GetFirstNonzeroControlPointU() + u;
952  IndexType cp_index_v = shape_function_container.GetFirstNonzeroControlPointV() + v;
953  IndexType cp_index_w = shape_function_container.GetFirstNonzeroControlPointW() + w;
956  cp_index_u, cp_index_v, cp_index_w);
957  rResult += (*this)[index] * shape_function_container(u, v, w, 0);
958  }
959  }
960  }
961 
962  return rResult;
963  }
964 
973  std::vector<CoordinatesArrayType>& rGlobalSpaceDerivatives,
974  const CoordinatesArrayType& rLocalCoordinates,
975  const SizeType DerivativeOrder) const override
976  {
977  NurbsVolumeShapeFunction shape_function_container(mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, DerivativeOrder);
978 
979  // Attention: Weights are not yet implemented.
980  // if (IsRational()) {
981  // shape_function_container.ComputeNurbsShapeFunctionValues(
982  // mKnotsU, mKnotsV, mKnotsW, mWeights, rLocalCoordinates[0], rLocalCoordinates[1], rLocalCoordinates[2]);
983  // }
984 
985  shape_function_container.ComputeBSplineShapeFunctionValues(
986  mKnotsU, mKnotsV, mKnotsW, rLocalCoordinates[0], rLocalCoordinates[1], rLocalCoordinates[2]);
987 
988 
989  if (rGlobalSpaceDerivatives.size() != shape_function_container.NumberOfShapeFunctionRows()) {
990  rGlobalSpaceDerivatives.resize(shape_function_container.NumberOfShapeFunctionRows());
991  }
992 
993  for (IndexType shape_function_row_i = 0;
994  shape_function_row_i < shape_function_container.NumberOfShapeFunctionRows();
995  ++shape_function_row_i) {
996  for (IndexType u = 0; u <= PolynomialDegreeU(); ++u) {
997  for (IndexType v = 0; v <= PolynomialDegreeV(); ++v) {
998  for (IndexType w = 0; w <= PolynomialDegreeW(); ++w) {
999  IndexType cp_index_u = shape_function_container.GetFirstNonzeroControlPointU() + u;
1000  IndexType cp_index_v = shape_function_container.GetFirstNonzeroControlPointV() + v;
1001  IndexType cp_index_w = shape_function_container.GetFirstNonzeroControlPointW() + w;
1002 
1005  cp_index_u, cp_index_v, cp_index_w);
1006 
1007  if (u == 0 && v==0 && w==0)
1008  rGlobalSpaceDerivatives[shape_function_row_i] =
1009  (*this)[index] * shape_function_container(u, v, w, shape_function_row_i);
1010  else
1011  rGlobalSpaceDerivatives[shape_function_row_i] +=
1012  (*this)[index] * shape_function_container(u, v, w, shape_function_row_i);
1013  }
1014  }
1015  }
1016  }
1017  }
1018 
1022 
1030  Vector &rResult,
1031  const CoordinatesArrayType& rCoordinates) const override
1032  {
1033  NurbsVolumeShapeFunction shape_function_container(mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, 0);
1034 
1035  // Attention: Weights are not yet implemented.
1036  // if (IsRational()) {
1037  // shape_function_container.ComputeNurbsShapeFunctionValues(mKnotsU, mKnotsV, mKnotsW, mWeights,
1038  // rCoordinates[0], rCoordinates[1], rCoordinates[2]);
1039  // }
1040 
1041  shape_function_container.ComputeBSplineShapeFunctionValues(mKnotsU, mKnotsV, mKnotsW,
1042  rCoordinates[0], rCoordinates[1], rCoordinates[2]);
1043 
1044 
1045  if (rResult.size() != shape_function_container.NumberOfNonzeroControlPoints())
1046  rResult.resize(shape_function_container.NumberOfNonzeroControlPoints());
1047 
1048  for (IndexType i = 0; i < shape_function_container.NumberOfNonzeroControlPoints(); ++i) {
1049  rResult[i] = shape_function_container(i, 0);
1050  }
1051 
1052  return rResult;
1053  }
1054 
1062  Matrix& rResult,
1063  const CoordinatesArrayType& rCoordinates) const override
1064  {
1065  NurbsVolumeShapeFunction shape_function_container(mPolynomialDegreeU, mPolynomialDegreeV, mPolynomialDegreeW, 1);
1066 
1067  // Attention: Weights are not yet implemented.
1068  // if (IsRational()) {
1069  // shape_function_container.ComputeNurbsShapeFunctionValues(mKnotsU, mKnotsV, mKnotsW, mWeights,
1070  // rCoordinates[0], rCoordinates[1], rCoordinates[2]);
1071  // }
1072 
1073  shape_function_container.ComputeBSplineShapeFunctionValues(mKnotsU, mKnotsV, mKnotsW,
1074  rCoordinates[0], rCoordinates[1], rCoordinates[2]);
1075 
1076 
1077  if (rResult.size1() != shape_function_container.NumberOfNonzeroControlPoints()
1078  && rResult.size2() != 3)
1079  rResult.resize(shape_function_container.NumberOfNonzeroControlPoints(), 3);
1080 
1081  for (IndexType i = 0; i < shape_function_container.NumberOfNonzeroControlPoints(); ++i) {
1082  rResult(i, 0) = shape_function_container(i, 1);
1083  rResult(i, 1) = shape_function_container(i, 2);
1084  rResult(i, 2) = shape_function_container(i, 3);
1085  }
1086 
1087  return rResult;
1088  }
1089 
1093 
1095  {
1097  }
1098 
1100  {
1102  }
1103 
1107 
1114  std::string Info() const override
1115  {
1116  return "3 dimensional nurbs geometry.";
1117  }
1118 
1125  void PrintInfo(std::ostream& rOStream) const override
1126  {
1127  rOStream << "3 dimensional nurbs geometry.";
1128  }
1129 
1137  void PrintData(std::ostream& rOStream) const override
1138  {
1139  rOStream << "PolynomialDegreeU: " << mPolynomialDegreeU << "." << std::endl;
1140  rOStream << "PolynomialDegreeV: " << mPolynomialDegreeV << "." << std::endl;
1141  rOStream << "PolynomialDegreeW: " << mPolynomialDegreeW << "." << std::endl;
1142  rOStream << "Number of Knots in u-direction: " << mKnotsU.size() << "." << std::endl;
1143  rOStream << "Number of Knots in v-direction: " << mKnotsV.size() << "." << std::endl;
1144  rOStream << "Number of Knots in w-direction: " << mKnotsW.size() << "." << std::endl;
1145  }
1147 
1148 private:
1151 
1152  static const GeometryData msGeometryData;
1153 
1154  static const GeometryDimension msGeometryDimension;
1155 
1159 
1160  SizeType mPolynomialDegreeU;
1161  SizeType mPolynomialDegreeV;
1162  SizeType mPolynomialDegreeW;
1163  Vector mKnotsU;
1164  Vector mKnotsV;
1165  Vector mKnotsW;
1166  // Vector mWeights;
1167 
1171 
1178  void CheckAndFitKnotVectors()
1179  {
1180  SizeType num_control_points = this->size();
1181 
1182  if (num_control_points !=
1183  (NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeU, mKnotsU.size())
1184  * NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeV, mKnotsV.size())
1185  * NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeW, mKnotsW.size()))) {
1186  if (num_control_points ==
1187  (NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeU, mKnotsU.size() - 2)
1188  * NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeV, mKnotsV.size() - 2)
1189  * NurbsUtilities::GetNumberOfControlPoints(mPolynomialDegreeW, mKnotsW.size() - 2))) {
1190  Vector KnotsU = ZeroVector(mKnotsU.size() - 2);
1191  for (SizeType i = 0; i < mKnotsU.size() - 2; ++i) {
1192  KnotsU[i] = mKnotsU[i + 1];
1193  }
1194  mKnotsU = KnotsU;
1195 
1196  Vector KnotsV = ZeroVector(mKnotsV.size() - 2);
1197  for (SizeType i = 0; i < mKnotsV.size() - 2; ++i) {
1198  KnotsV[i] = mKnotsV[i + 1];
1199  }
1200  mKnotsV = KnotsV;
1201 
1202  Vector KnotsW = ZeroVector(mKnotsW.size() - 2);
1203  for (SizeType i = 0; i < mKnotsW.size() - 2; ++i) {
1204  KnotsW[i] = mKnotsW[i + 1];
1205  }
1206  mKnotsW = KnotsW;
1207 
1208  } else {
1209  KRATOS_ERROR
1210  << "Number of controls points and polynomial degrees and number of knots do not match! " << std::endl
1211  << " P: " << mPolynomialDegreeU << ", Q: " << mPolynomialDegreeV << ", D: " << mPolynomialDegreeW
1212  << ", number of knots u: " << mKnotsU.size() << ", number of knots v: " << mKnotsV.size() << ", number of knots w: " << mKnotsW.size()
1213  << ", number of control points: " << num_control_points << std::endl
1214  << "Following condition must be achieved: ControlPoints.size() = (KnotsU.size() - P + 1) * (KnotsV.size() - Q + 1) * (KnotsW.size() - D + 1)"
1215  << std::endl;
1216  }
1217  }
1218  }
1219 
1223 
1224  friend class Serializer;
1225 
1226  void save(Serializer& rSerializer) const override
1227  {
1229  rSerializer.save("PolynomialDegreeU", mPolynomialDegreeU);
1230  rSerializer.save("PolynomialDegreeV", mPolynomialDegreeV);
1231  rSerializer.save("PolynomialDegreeW", mPolynomialDegreeW);
1232  rSerializer.save("KnotsU", mKnotsU);
1233  rSerializer.save("KnotsV", mKnotsV);
1234  rSerializer.save("KnotsW", mKnotsW);
1235  // rSerializer.save("Weights", mWeights);
1236  }
1237 
1238  void load(Serializer& rSerializer) override
1239  {
1241  rSerializer.load("PolynomialDegreeU", mPolynomialDegreeU);
1242  rSerializer.load("PolynomialDegreeV", mPolynomialDegreeV);
1243  rSerializer.load("PolynomialDegreeW", mPolynomialDegreeW);
1244  rSerializer.load("KnotsU", mKnotsU);
1245  rSerializer.load("KnotsV", mKnotsV);
1246  rSerializer.load("KnotsW", mKnotsW);
1247  // rSerializer.load("Weights", mWeights);
1248  }
1249 
1250  NurbsVolumeGeometry() : BaseType(PointsArrayType(), &msGeometryData) {};
1251 
1253 
1254 }; // class NurbsVolumeGeometry
1255 
1259 
1261 template<class TPointType>
1262 inline std::istream& operator >> ( std::istream& rIStream,
1264 
1266 template<class TPointType>
1267 inline std::ostream& operator << ( std::ostream& rOStream,
1268  const NurbsVolumeGeometry<TPointType>& rThis )
1269 {
1270  rThis.PrintInfo( rOStream );
1271  rOStream << std::endl;
1272  rThis.PrintData( rOStream );
1273 
1274  return rOStream;
1275 }
1277 
1278 template<class TPointType>
1279 const GeometryData NurbsVolumeGeometry<TPointType>::msGeometryData(
1282  {}, {}, {});
1283 
1284 template<class TPointType>
1285 const GeometryDimension NurbsVolumeGeometry<TPointType>::msGeometryDimension(3, 3);
1286 
1287 } // namespace Kratos
1288 
1289 #endif // KRATOS_NURBS_VOLUME_GEOMETRY_H_INCLUDED defined
static GeometryPointerType CreateQuadraturePoint(SizeType WorkingSpaceDimension, SizeType LocalSpaceDimension, GeometryShapeFunctionContainer< GeometryData::IntegrationMethod > &rShapeFunctionContainer, PointsArrayType rPoints, GeometryType *pGeometryParent)
Definition: quadrature_points_utility.h:159
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
SizeType PointsNumber() const
Definition: geometry.h:528
SizeType size() const
Definition: geometry.h:518
Geometry & operator=(const Geometry &rOther)
Definition: geometry.h:400
std::vector< IntegrationPointType > IntegrationPointsArrayType
Definition: geometry.h:161
SizeType LocalSpaceDimension() const
Definition: geometry.h:1300
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
iterator begin()
Definition: geometry.h:465
const PointsArrayType & Points() const
Definition: geometry.h:1768
IntegrationMethod GetDefaultIntegrationMethod() const
Definition: geometry.h:2004
iterator end()
Definition: geometry.h:473
const IntegrationPointsArrayType & IntegrationPoints() const
Definition: geometry.h:2284
const ShapeFunctionsGradientsType & ShapeFunctionsLocalGradients() const
Definition: geometry.h:3539
SizeType WorkingSpaceDimension() const
Definition: geometry.h:1287
TPointType const & GetPoint(const int Index) const
Definition: geometry.h:1816
Definition: geometry_shape_function_container.h:60
std::array< Matrix, static_cast< int >IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsValuesContainerType
Shape functions.
Definition: geometry_shape_function_container.h:82
std::array< IntegrationPointsArrayType, static_cast< int >IntegrationMethod::NumberOfIntegrationMethods)> IntegrationPointsContainerType
Definition: geometry_shape_function_container.h:79
std::array< DenseVector< Matrix >, static_cast< int >IntegrationMethod::NumberOfIntegrationMethods)> ShapeFunctionsLocalGradientsContainerType
Definition: geometry_shape_function_container.h:86
Integration information for the creation of integration points.
Definition: integration_info.h:35
QuadratureMethod GetQuadratureMethod(IndexType DimensionIndex) const
Definition: integration_info.h:104
static void IntegrationPoints3D(typename IntegrationPointsArrayType::iterator &rIntegrationPointsBegin, SizeType PointsInU, SizeType PointsInV, SizeType PointsInW, double U0, double U1, double V0, double V1, double W0, double W1)
Definition: integration_point_utilities.cpp:157
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
Class for optimized use of intervals.
Definition: nurbs_interval.h:36
A volume geometry based on a full 3-dimensional BSpline tensor product.
Definition: nurbs_volume_geometry.h:46
const Vector & KnotsV() const
Get Knot vector in v-direction.
Definition: nurbs_volume_geometry.h:305
NurbsVolumeGeometry(const PointsArrayType &ThisPoints)
Definition: nurbs_volume_geometry.h:124
CoordinatesArrayType & GlobalCoordinates(CoordinatesArrayType &rResult, const CoordinatesArrayType &rLocalCoordinates) const override
This method maps from local space to working space.
Definition: nurbs_volume_geometry.h:930
BaseType::PointsArrayType PointsArrayType
Definition: nurbs_volume_geometry.h:59
std::vector< NurbsInterval > KnotSpanIntervalsW() const
Provides all knot span intervals of the volume in w-direction.
Definition: nurbs_volume_geometry.h:551
KRATOS_CLASS_POINTER_DEFINITION(NurbsVolumeGeometry)
Pointer of NurbsVolumeGeometry.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: nurbs_volume_geometry.h:1125
BaseType::Pointer Create(PointsArrayType const &ThisPoints) const override
Definition: nurbs_volume_geometry.h:193
NurbsVolumeGeometry(NurbsVolumeGeometry< TContainerPointType > const &rOther)
Copy constructor.
Definition: nurbs_volume_geometry.h:130
SizeType PolynomialDegreeV() const
Definition: nurbs_volume_geometry.h:277
Geometry< NodeType > BaseType
Definition: nurbs_volume_geometry.h:53
GeometryData::KratosGeometryType GetGeometryType() const override
Definition: nurbs_volume_geometry.h:1099
void SetInternals(const PointsArrayType &rThisPoints, const SizeType PolynomialDegreeU, const SizeType PolynomialDegreeV, const SizeType PolynomialDegreeW, const Vector &rKnotsU, const Vector &rKnotsV, const Vector &rKnotsW)
Definition: nurbs_volume_geometry.h:246
void GlobalSpaceDerivatives(std::vector< CoordinatesArrayType > &rGlobalSpaceDerivatives, const CoordinatesArrayType &rLocalCoordinates, const SizeType DerivativeOrder) const override
This method maps from local space to working space and computes the derivatives at the local space pa...
Definition: nurbs_volume_geometry.h:972
SizeType NumberOfControlPointsW() const
Definition: nurbs_volume_geometry.h:381
Matrix & ShapeFunctionsLocalGradients(Matrix &rResult, const CoordinatesArrayType &rCoordinates) const override
Computes the first derivatives in the local parameter space.
Definition: nurbs_volume_geometry.h:1061
std::vector< NurbsInterval > KnotSpanIntervalsU() const
Provides all knot span intervals of the volume in u-direction.
Definition: nurbs_volume_geometry.h:505
SizeType NumberOfControlPointsV() const
Definition: nurbs_volume_geometry.h:373
std::string Info() const override
Turn back information as a string.
Definition: nurbs_volume_geometry.h:1114
NurbsInterval DomainIntervalU() const
Provides the natural boundaries of the NURBS/B-Spline volume.
Definition: nurbs_volume_geometry.h:472
GeometryData::KratosGeometryFamily GetGeometryFamily() const override
Definition: nurbs_volume_geometry.h:1094
const TPointType::Pointer pGetPoint(const int Index) const
Definition: geometry.h:1790
NurbsVolumeGeometry & operator=(const NurbsVolumeGeometry &rOther)
Assignment operator.
Definition: nurbs_volume_geometry.h:162
const Vector & KnotsU() const
Get Knot vector in u-direction.
Definition: nurbs_volume_geometry.h:295
Matrix & Jacobian(Matrix &rResult, const CoordinatesArrayType &rCoordinates) const override
Computes jacobian matrix at the given coordinates.
Definition: nurbs_volume_geometry.h:652
NurbsVolumeGeometry(const PointsArrayType &rThisPoints, const SizeType PolynomialDegreeU, const SizeType PolynomialDegreeV, const SizeType PolynomialDegreeW, const Vector &rKnotsU, const Vector &rKnotsV, const Vector &rKnotsW)
Conctructor for B-Spline volumes.
Definition: nurbs_volume_geometry.h:79
IntegrationInfo GetDefaultIntegrationInfo() const override
Provides the default integration dependent on the polynomial degree of the underlying surface.
Definition: nurbs_volume_geometry.h:575
NurbsVolumeGeometry(NurbsVolumeGeometry< TOtherContainerPointType > const &rOther)
Copy constructor from a geometry with different point type.
Definition: nurbs_volume_geometry.h:142
SizeType NumberOfControlPointsU() const
Attention weights are not yet implemented.
Definition: nurbs_volume_geometry.h:365
TContainerPointType::value_type NodeType
Definition: nurbs_volume_geometry.h:51
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, SizeType NumPointsPerSpanU, SizeType NumPointsPerSpanV, SizeType NumPointsPerSpanW) const
Creates integration points according to the input parameter.
Definition: nurbs_volume_geometry.h:609
NurbsVolumeGeometry & operator=(NurbsVolumeGeometry< TOtherContainerPointType > const &rOther)
Assignment operator for geometries with different point type.
Definition: nurbs_volume_geometry.h:176
SizeType PolynomialDegreeW() const
Definition: nurbs_volume_geometry.h:285
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, const IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) override
Creates a list of quadrature point geometries. from a list of integration points.
Definition: nurbs_volume_geometry.h:731
SizeType NumberOfKnotsV() const
Definition: nurbs_volume_geometry.h:331
SizeType PointsNumberInDirection(IndexType LocalDirectionIndex) const override
Returns number of points per direction.
Definition: nurbs_volume_geometry.h:204
BaseType::GeometriesArrayType GeometriesArrayType
Definition: nurbs_volume_geometry.h:60
SizeType NumberOfKnotSpans(IndexType DirectionIndex) const
Returns the number of spans in DirectionIndex=0:U, DirectionIndex=1:V and DirectionIndex=2 (which are...
Definition: nurbs_volume_geometry.h:390
std::vector< NurbsInterval > KnotSpanIntervalsV() const
Provides all knot span intervals of the volume in v-direction.
Definition: nurbs_volume_geometry.h:528
bool IsRational() const
Checks if shape functions are rational or not.
Definition: nurbs_volume_geometry.h:348
GeometryShapeFunctionContainer< GeometryData::IntegrationMethod >::ShapeFunctionsLocalGradientsContainerType ShapeFunctionsLocalGradientsContainerType
Definition: nurbs_volume_geometry.h:65
SizeType PolynomialDegreeU() const
Definition: nurbs_volume_geometry.h:269
SizeType NumberOfKnotsU() const
Definition: nurbs_volume_geometry.h:323
BaseType::SizeType SizeType
Definition: nurbs_volume_geometry.h:56
BaseType::CoordinatesArrayType CoordinatesArrayType
Definition: nurbs_volume_geometry.h:58
void CreateIntegrationPoints(IntegrationPointsArrayType &rIntegrationPoints, IntegrationInfo &rIntegrationInfo) const override
Creates integration points according to the polynomial degrees.
Definition: nurbs_volume_geometry.h:590
void PrintData(std::ostream &rOStream) const override
Print geometry's data into given stream.
Definition: nurbs_volume_geometry.h:1137
const Vector & KnotsW() const
Get Knot vector in w-direction.
Definition: nurbs_volume_geometry.h:315
void CreateQuadraturePointGeometries(GeometriesArrayType &rResultGeometries, IndexType NumberOfShapeFunctionDerivatives, IntegrationInfo &rIntegrationInfo) override
Creates a list of quadrature point geometries from a list of integration points.
Definition: nurbs_volume_geometry.h:701
BaseType::IntegrationPointsArrayType IntegrationPointsArrayType
Definition: nurbs_volume_geometry.h:61
BaseType::IndexType IndexType
Definition: nurbs_volume_geometry.h:55
Vector & ShapeFunctionsValues(Vector &rResult, const CoordinatesArrayType &rCoordinates) const override
Computes the shape function values in the local parameter space.
Definition: nurbs_volume_geometry.h:1029
NurbsInterval DomainIntervalW() const
Provides the natural boundaries of the NURBS/B-Spline volume.
Definition: nurbs_volume_geometry.h:494
NurbsInterval DomainIntervalV() const
Provides the natural boundaries of the NURBS/B-Spline volume.
Definition: nurbs_volume_geometry.h:483
GeometryShapeFunctionContainer< GeometryData::IntegrationMethod >::ShapeFunctionsValuesContainerType ShapeFunctionsValuesContainerType
Definition: nurbs_volume_geometry.h:64
void Spans(std::vector< double > &rSpans, IndexType DirectionIndex) const
Provides all knot spans along the given direction.
Definition: nurbs_volume_geometry.h:426
SizeType PolynomialDegree(IndexType LocalDirectionIndex) const override
Return polynomial degree of the volume in direction 0, 1, 2.
Definition: nurbs_volume_geometry.h:224
SizeType NumberOfKnotsW() const
Definition: nurbs_volume_geometry.h:339
~NurbsVolumeGeometry() override=default
Destructor.
GeometryShapeFunctionContainer< GeometryData::IntegrationMethod >::IntegrationPointsContainerType IntegrationPointsContainerType
Definition: nurbs_volume_geometry.h:63
int ProjectionPointGlobalToLocalSpace(const CoordinatesArrayType &rPointGlobalCoordinates, CoordinatesArrayType &rProjectedPointLocalCoordinates, const double Tolerance=std::numeric_limits< double >::epsilon()) const override
Returns local coordinates in return for a point in physical coordinates. This function assumes the in...
Definition: nurbs_volume_geometry.h:900
Definition: nurbs_volume_shape_functions.h:32
void ComputeBSplineShapeFunctionValues(const Vector &rKnotsU, const Vector &rKnotsV, const Vector &rKnotsW, const double ParameterU, const double ParameterV, const double ParameterW)
Computes the shape function values at the given parameter.
Definition: nurbs_volume_shape_functions.h:383
IndexType GetFirstNonzeroControlPointU() const
Definition: nurbs_volume_shape_functions.h:305
IndexType GetFirstNonzeroControlPointW() const
Definition: nurbs_volume_shape_functions.h:325
std::vector< int > ControlPointIndices(SizeType NumberOfControlPointsU, SizeType NumberOfControlPointsV, SizeType NumberOfControlPointsW) const
Definition: nurbs_volume_shape_functions.h:240
static SizeType NumberOfShapeFunctionRows(const SizeType DerivativeOrder)
Returns the number of shape function rows for a given order.
Definition: nurbs_volume_shape_functions.h:72
SizeType NumberOfNonzeroControlPoints() const
Definition: nurbs_volume_shape_functions.h:201
IndexType GetFirstNonzeroControlPointV() const
Definition: nurbs_volume_shape_functions.h:315
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
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
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
#define KRATOS_ERROR_IF(conditional)
Definition: exception.h:162
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
SizeType GetNumberOfControlPoints(const SizeType PolynomialDegree, const SizeType NumberOfKnots)
Definition: nurbs_utilities.h:99
static constexpr IndexType GetVectorIndexFromMatrixIndices(const SizeType NumberPerRow, const SizeType NumberPerColumn, const IndexType RowIndex, const IndexType ColumnIndex) noexcept
Definition: nurbs_utilities.h:133
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
KratosZeroVector< double > ZeroVector
Definition: amatrix_interface.h:561
Internals::Matrix< double, AMatrix::dynamic, 1 > Vector
Definition: amatrix_interface.h:472
KratosZeroMatrix< double > ZeroMatrix
Definition: amatrix_interface.h:559
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
const GeometryData BrepCurve< TContainerPointType, TContainerPointEmbeddedType >::msGeometryData & msGeometryDimension
Definition: brep_curve.h:483
T & noalias(T &TheMatrix)
Definition: amatrix_interface.h:484
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
v
Definition: generate_convection_diffusion_explicit_element.py:114
w
Definition: generate_convection_diffusion_explicit_element.py:108
u
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:30
string t0
Definition: kernel_approximation_error.py:61
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
int m
Definition: run_marine_rain_substepping.py:8
int counter
Definition: script_THERMAL_CORRECT.py:218
N
Definition: sensitivityMatrix.py:29
integer i
Definition: TensorModule.f:17
e
Definition: run_cpp_mpi_tests.py:31