15 #if !defined(KRATOS_NURBS_CURVE_SHAPE_FUNCTIONS_H_INCLUDED )
16 #define KRATOS_NURBS_CURVE_SHAPE_FUNCTIONS_H_INCLUDED
83 mDerivativeOrder = DerivativeOrder;
100 return mPolynomialDegree;
119 return mDerivativeOrder + 1;
132 ControlPointIndex, DerivativeRow);
134 return mValues[index];
143 return mFirstNonzeroControlPoint;
191 const double ParameterT)
194 using Int = std::ptrdiff_t;
199 const Int number_of_nonzero_control_points =
201 const Int number_of_shape_function_rows =
204 mFirstNonzeroControlPoint = Span - polynominal_degree + 1;
209 for (Int
j = 0;
j < polynominal_degree;
j++) {
210 mLeft[
j] = ParameterT - rKnots[Span -
j];
211 mRight[
j] = rKnots[Span +
j + 1] - ParameterT;
215 for (Int r = 0; r <=
j; r++) {
216 Ndu(
j + 1, r) = mRight[r] + mLeft[
j - r];
218 double temp = Ndu(r,
j) / Ndu(
j + 1, r);
220 Ndu(r,
j + 1) = saved + mRight[r] *
temp;
222 saved = mLeft[
j - r] *
temp;
224 Ndu(
j + 1,
j + 1) = saved;
227 for (Int
j = 0;
j < number_of_nonzero_control_points;
j++) {
234 for (Int r = 0; r < number_of_nonzero_control_points; r++) {
237 for (Int
k = 1;
k < number_of_shape_function_rows;
k++) {
241 Int pk = polynominal_degree -
k;
244 b[0] =
a[0] / Ndu(pk + 1, rk);
245 value =
b[0] * Ndu(rk, pk);
248 Int j1 = r >=
k - 1 ? 1 :
k - r;
249 Int j2 = r <= pk + 1 ?
k : number_of_nonzero_control_points - r;
251 for (Int
j = j1;
j < j2;
j++) {
252 b[
j] = (
a[
j] -
a[
j - 1]) / Ndu(pk + 1, rk +
j);
253 value +=
b[
j] * Ndu(rk +
j, pk);
257 b[
k] = -
a[
k - 1] / Ndu(pk + 1, r);
258 value +=
b[
k] * Ndu(r, pk);
265 Int s = polynominal_degree;
267 for (Int
k = 1;
k < number_of_shape_function_rows;
k++) {
268 for (Int
j = 0;
j < number_of_nonzero_control_points;
j++) {
271 s *= polynominal_degree -
k;
287 const double ParameterT)
307 const double ParameterT)
358 NonzeroControlPointIndex, DerivativeRow);
360 return mValues[index];
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
NurbsCurveShapeFunction.
Definition: nurbs_curve_shape_functions.h:34
void ComputeNurbsShapeFunctionValuesAtSpan(const Vector &rKnots, const IndexType Span, const Vector &rWeights, const double ParameterT)
Definition: nurbs_curve_shape_functions.h:303
IndexType GetFirstNonzeroControlPoint() const
Definition: nurbs_curve_shape_functions.h:141
std::size_t SizeType
Definition: nurbs_curve_shape_functions.h:40
void ResizeDataContainers(const SizeType PolynomialDegree, const SizeType DerivativeOrder)
Definition: nurbs_curve_shape_functions.h:79
void ComputeBSplineShapeFunctionValuesAtSpan(const Vector &rKnots, const IndexType Span, const double ParameterT)
Definition: nurbs_curve_shape_functions.h:188
SizeType NumberOfNonzeroControlPoints() const
Definition: nurbs_curve_shape_functions.h:108
SizeType NumberOfShapeFunctionRows() const
Definition: nurbs_curve_shape_functions.h:117
NurbsCurveShapeFunction()
Default constructor.
Definition: nurbs_curve_shape_functions.h:47
SizeType PolynomialDegree() const
Definition: nurbs_curve_shape_functions.h:98
double ShapeFunctionValue(const IndexType ControlPointIndex, const IndexType DerivativeRow) const
Definition: nurbs_curve_shape_functions.h:126
void ComputeNurbsShapeFunctionValues(const Vector &rKnots, const Vector &rWeights, const double ParameterT)
Definition: nurbs_curve_shape_functions.h:284
std::size_t IndexType
Definition: nurbs_curve_shape_functions.h:39
void ComputeBSplineShapeFunctionValues(const Vector &rKnots, const double ParameterT)
Definition: nurbs_curve_shape_functions.h:172
std::vector< IndexType > GetNonzeroControlPointIndices() const
Definition: nurbs_curve_shape_functions.h:149
NurbsCurveShapeFunction(const SizeType PolynomialDegree, const SizeType DerivativeOrder)
Definition: nurbs_curve_shape_functions.h:55
double operator()(const IndexType NonzeroControlPointIndex, const IndexType DerivativeRow) const
Definition: nurbs_curve_shape_functions.h:66
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
static constexpr SizeType GetBinomCoefficient(const SizeType N, const SizeType K) noexcept
Definition: nurbs_utilities.h:117
IndexType GetUpperSpan(const SizeType PolynomialDegree, const Vector &rKnots, const double ParameterT)
Definition: nurbs_utilities.h:50
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
float span
Definition: angle_finder.py:9
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
float temp
Definition: rotating_cone.py:85
p
Definition: sensitivityMatrix.py:52
integer i
Definition: TensorModule.f:17