15 #if !defined(KRATOS_NURBS_SURFACE_SHAPE_FUNCTIONS_H_INCLUDED )
16 #define KRATOS_NURBS_SURFACE_SHAPE_FUNCTIONS_H_INCLUDED
78 const SizeType DerivativeOrderV) noexcept
80 return DerivativeOrderV + (DerivativeOrderU + DerivativeOrderV) *
81 (1 + DerivativeOrderU + DerivativeOrderV) / 2;
115 mShapeFunctionValues.
resize(number_of_nonzero_control_points * number_of_shape_function_rows);
116 mWeightedSums.
resize(number_of_shape_function_rows);
133 return mDerivativeOrder;
168 indices[poleIndex] = { poleU, poleV };
189 NumberOfControlPointsU, NumberOfControlPointsV, cp_index_u, cp_index_v);
206 KRATOS_DEBUG_ERROR_IF(index >= mShapeFunctionValues.size()) <<
"Index exceeds size of shape function values. Index: "
207 << index <<
", mShapeFunctionValues.size(): " << mShapeFunctionValues.size()
208 <<
", ControlPointIndexU: " << ControlPointIndexU <<
", ControlPointIndexV: " << ControlPointIndexV
209 <<
", DerivativeRow: " << DerivativeRow << std::endl;
211 return mShapeFunctionValues[index];
222 KRATOS_DEBUG_ERROR_IF(index >= mShapeFunctionValues.size()) <<
"Index exceeds size of shape function values. Index: "
223 << index <<
", mShapeFunctionValues.size(): " << mShapeFunctionValues.size()
224 <<
", ControlPointIndex: " << ControlPointIndex <<
", DerivativeOrder: " <<
DerivativeOrder << std::endl;
226 return mShapeFunctionValues[index];
231 return mFirstNonzeroControlPointU;
241 return mFirstNonzeroControlPointV;
254 const double ParameterU,
255 const double ParameterV)
257 mShapeFunctionValues =
ZeroVector(mShapeFunctionValues.size());
283 const double ParameterU,
284 const double ParameterV)
304 const double ParameterU,
305 const double ParameterV)
311 <<
"Number of controls points and polynomial degrees and number of knots do not match!" << std::endl;
315 rKnotsU, rKnotsV, SpanU, SpanV, ParameterU, ParameterV);
319 GetWeightedSum(shape_row_index) =
double(0);
326 const double weight = Weights(GetControlPointIndex(rKnotsU.size(), rKnotsV.size(), ControlPointIndexU, ControlPointIndexV));
364 GetWeightedSum(
i,
j);
383 const double ParameterU,
384 const double ParameterV)
390 rKnotsU, rKnotsV, SpanU, SpanV, Weights, ParameterU, ParameterV);
398 return mWeightedSums[
Index];
401 double& GetWeightedSum(
const SizeType DerivativeOrderU,
const SizeType DerivativeOrderV)
405 return GetWeightedSum(index);
408 inline int GetControlPointIndex(
418 ControlPointIndexU, ControlPointIndexV);
421 inline int GetNonzeroControlPointIndex(
428 ControlPointIndexU, ControlPointIndexV);
437 const IndexType control_point_index = GetNonzeroControlPointIndex(
438 ControlPointIndexU, ControlPointIndexV);
441 DerivativeRow, control_point_index);
452 DerivativeRow, ControlPointIndex);
454 return mShapeFunctionValues[index];
462 const IndexType index = this->GetIndex(ControlPointIndexU, ControlPointIndexV, DerivativeRow);
464 return mShapeFunctionValues[index];
470 int mDerivativeOrder;
471 NurbsCurveShapeFunction mShapeFunctionsU;
472 NurbsCurveShapeFunction mShapeFunctionsV;
474 Vector mShapeFunctionValues;
void resize(std::size_t NewSize1, std::size_t NewSize2, bool preserve=0)
Definition: amatrix_interface.h:224
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 PolynomialDegree() const
Definition: nurbs_curve_shape_functions.h:98
Definition: nurbs_surface_shape_functions.h:31
double ShapeFunctionValue(const IndexType ControlPointIndexU, const IndexType ControlPointIndexV, const SizeType DerivativeRow) const
Definition: nurbs_surface_shape_functions.h:196
void ComputeBSplineShapeFunctionValuesAtSpan(const Vector &rKnotsU, const Vector &rKnotsV, const int SpanU, const int SpanV, const double ParameterU, const double ParameterV)
Definition: nurbs_surface_shape_functions.h:249
void ResizeDataContainers(const SizeType PolynomialDegreeU, const SizeType PolynomialDegreeV, const SizeType DerivativeOrder)
Definition: nurbs_surface_shape_functions.h:105
IndexType GetLastNonzeroControlPointV() const
Definition: nurbs_surface_shape_functions.h:244
NurbsSurfaceShapeFunction(const SizeType PolynomialDegreeU, const SizeType PolynomialDegreeV, const SizeType DerivativeOrder)
Definition: nurbs_surface_shape_functions.h:50
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
std::vector< std::pair< int, int > > NonzeroControlPointIndices() const
Definition: nurbs_surface_shape_functions.h:156
double operator()(const IndexType ControlPointIndex, const IndexType DerivativeRow) const
Definition: nurbs_surface_shape_functions.h:87
static constexpr SizeType NumberOfShapeFunctionRows(const SizeType DerivativeOrder) noexcept
Definition: nurbs_surface_shape_functions.h:66
double operator()(const IndexType ControlPointIndexU, const IndexType ControlPointIndexV, const IndexType DerivativeRow) const
Definition: nurbs_surface_shape_functions.h:94
SizeType NumberOfNonzeroControlPointsV() const
Definition: nurbs_surface_shape_functions.h:146
NurbsSurfaceShapeFunction()
Default constructor.
Definition: nurbs_surface_shape_functions.h:44
void ComputeNurbsShapeFunctionValuesAtSpan(const Vector &rKnotsU, const Vector &rKnotsV, const IndexType SpanU, const IndexType SpanV, const Vector &Weights, const double ParameterU, const double ParameterV)
Definition: nurbs_surface_shape_functions.h:298
std::size_t IndexType
Definition: nurbs_surface_shape_functions.h:36
SizeType NumberOfNonzeroControlPointsU() const
Definition: nurbs_surface_shape_functions.h:141
IndexType GetFirstNonzeroControlPointU() const
Definition: nurbs_surface_shape_functions.h:229
static constexpr IndexType IndexOfShapeFunctionRow(const SizeType DerivativeOrderU, const SizeType DerivativeOrderV) noexcept
Definition: nurbs_surface_shape_functions.h:76
SizeType PolynomialDegreeV() const
Definition: nurbs_surface_shape_functions.h:126
std::size_t SizeType
Definition: nurbs_surface_shape_functions.h:37
SizeType PolynomialDegreeU() const
Definition: nurbs_surface_shape_functions.h:121
IndexType GetLastNonzeroControlPointU() const
Definition: nurbs_surface_shape_functions.h:234
IndexType GetFirstNonzeroControlPointV() const
Definition: nurbs_surface_shape_functions.h:239
SizeType NumberOfNonzeroControlPoints() const
Definition: nurbs_surface_shape_functions.h:151
SizeType DerivativeOrder() const
Definition: nurbs_surface_shape_functions.h:131
double ShapeFunctionValue(const IndexType ControlPointIndex, const SizeType DerivativeOrder) const
Definition: nurbs_surface_shape_functions.h:214
SizeType NumberOfShapeFunctionRows() const
Definition: nurbs_surface_shape_functions.h:136
void ComputeBSplineShapeFunctionValues(const Vector &rKnotsU, const Vector &rKnotsV, const double ParameterU, const double ParameterV)
Definition: nurbs_surface_shape_functions.h:280
std::size_t IndexType
The definition of the index type.
Definition: key_hash.h:35
#define KRATOS_DEBUG_ERROR_IF(conditional)
Definition: exception.h:171
IndexType GetLowerSpan(const SizeType PolynomialDegree, const Vector &rKnots, const double ParameterT)
Definition: nurbs_utilities.h:64
SizeType GetNumberOfControlPoints(const SizeType PolynomialDegree, const SizeType NumberOfKnots)
Definition: nurbs_utilities.h:99
static constexpr SizeType GetBinomCoefficient(const SizeType N, const SizeType K) noexcept
Definition: nurbs_utilities.h:117
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
TABLE_NUMBER_ANGULAR_VELOCITY TABLE_NUMBER_MOMENT I33 BEAM_INERTIA_ROT_UNIT_LENGHT_Y KRATOS_DEFINE_APPLICATION_VARIABLE(DEM_APPLICATION, double, BEAM_INERTIA_ROT_UNIT_LENGHT_Z) typedef std double
Definition: DEM_application_variables.h:182
v
Definition: generate_convection_diffusion_explicit_element.py:114
a
Definition: generate_stokes_twofluid_element.py:77
b
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:31
u
Definition: generate_total_lagrangian_mixed_volumetric_strain_element.py:30
int k
Definition: quadrature.py:595
int j
Definition: quadrature.py:648
p
Definition: sensitivityMatrix.py:52
integer i
Definition: TensorModule.f:17
integer l
Definition: TensorModule.f:17