15 #if !defined(KRATOS_NURBS_UTILITY_H_INCLUDED )
16 #define KRATOS_NURBS_UTILITY_H_INCLUDED
35 namespace NurbsUtilities
53 const double ParameterT)
55 const auto span = std::upper_bound(std::begin(rKnots) + PolynomialDegree,
56 std::end(rKnots) - PolynomialDegree, ParameterT) - std::begin(rKnots) - 1;
67 const double ParameterT)
69 const auto span = std::lower_bound(std::begin(rKnots) + PolynomialDegree,
70 std::end(rKnots) - PolynomialDegree, ParameterT) - std::begin(rKnots) - 1;
81 return NumberOfKnots - NumberOfControlPoints + 1;
91 return NumberOfControlPoints + PolynomialDegree - 1;
101 return NumberOfKnots - PolynomialDegree + 1;
111 return NumberOfKnots - 2 * PolynomialDegree + 1;
121 (
K == 0 ||
K ==
N) ? 1 :
122 (
K == 1 ||
K ==
N - 1) ?
N :
137 return ColumnIndex * NumberPerRow + RowIndex;
149 return DepthIndex * (NumberPerColumn*NumberPerRow) + ColumnIndex * NumberPerRow + RowIndex;
164 return std::make_pair(
row, col);
179 const IndexType index_in_row_column_plane =
Index % (NumberPerRow*NumberPerColumn);
180 result[0] = index_in_row_column_plane % NumberPerRow;
181 result[1] = index_in_row_column_plane / NumberPerRow;
182 result[2] =
Index / (NumberPerRow*NumberPerColumn);
Short class definition.
Definition: array_1d.h:61
end
Definition: DEM_benchmarks.py:180
std::size_t IndexType
Definition: nurbs_utilities.h:40
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
SizeType GetNumberOfSpans(const SizeType PolynomialDegree, const SizeType NumberOfKnots)
Definition: nurbs_utilities.h:109
std::size_t SizeType
Definition: nurbs_utilities.h:41
static constexpr SizeType GetBinomCoefficient(const SizeType N, const SizeType K) noexcept
Definition: nurbs_utilities.h:117
SizeType GetNumberOfKnots(const SizeType PolynomialDegree, const SizeType NumberOfControlPoints)
Definition: nurbs_utilities.h:89
IndexType GetUpperSpan(const SizeType PolynomialDegree, const Vector &rKnots, const double ParameterT)
Definition: nurbs_utilities.h:50
static std::pair< IndexType, IndexType > GetMatrixIndicesFromVectorIndex(const SizeType NumberPerRow, const SizeType NumberPerColumn, const IndexType Index) noexcept
Definition: nurbs_utilities.h:156
static constexpr IndexType GetVectorIndexFromMatrixIndices(const SizeType NumberPerRow, const SizeType NumberPerColumn, const IndexType RowIndex, const IndexType ColumnIndex) noexcept
Definition: nurbs_utilities.h:133
SizeType GetPolynomialDegree(const SizeType NumberOfKnots, const SizeType NumberOfControlPoints)
Definition: nurbs_utilities.h:79
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
AMatrix::MatrixRow< const TExpressionType > row(AMatrix::MatrixExpression< TExpressionType, TCategory > const &TheExpression, std::size_t RowIndex)
Definition: amatrix_interface.h:649
float span
Definition: angle_finder.py:9
N
Definition: sensitivityMatrix.py:29
K
Definition: sensitivityMatrix.py:73