Index
SuiteSplines.SUITESPLINES_PKGS
Base.Matrix
SuiteSplines.AbstractMappings.EvaluationSet
SuiteSplines.AbstractMappings.Field
SuiteSplines.AbstractMappings.GeometricMapping
SuiteSplines.AbstractMappings.ResizableArray
SuiteSplines.BezierBernsteinMethods.BezierSimplex
SuiteSplines.BezierBernsteinMethods.LinearIndex
SuiteSplines.BezierBernsteinMethods.LinearIndex
SuiteSplines.BezierBernsteinMethods.MultiIndices
SuiteSplines.BezierBernsteinMethods.Simplex
SuiteSplines.IgaBase.AbstractMapping
SuiteSplines.IgaBase.AbstractSpline
SuiteSplines.IgaBase.Boundary
SuiteSplines.IgaBase.Degree
SuiteSplines.IgaBase.Dimension
SuiteSplines.IgaBase.QuadratureRule
SuiteSplines.IgaBase.QuadratureRule
SuiteSplines.IgaBase.QuadratureRule
SuiteSplines.IgaBase.Regularity
SuiteSplines.IgaBase.ScalarMapping
SuiteSplines.IgaFormation.Element
SuiteSplines.IgaFormation.ElementAccessor
SuiteSplines.IgaFormation.Elements
SuiteSplines.IgaFormation.PatchAccessor
SuiteSplines.IgaFormation.UnivariatePatchData
SuiteSplines.ImmersedSplines.ClosestExtensionArray
SuiteSplines.ImmersedSplines.ClosestExtensionArray
SuiteSplines.ImmersedSplines.GeneratePerimeter
SuiteSplines.ImmersedSplines.IPerm
SuiteSplines.ImmersedSplines.ImmersedQuadRule
SuiteSplines.KroneckerProducts.BoxProduct
SuiteSplines.KroneckerProducts.KroneckerProduct
SuiteSplines.SortedSequences.IncreasingRange
SuiteSplines.SortedSequences.IncreasingSequence
SuiteSplines.SortedSequences.IncreasingVector
SuiteSplines.SortedSequences.Interval
SuiteSplines.SortedSequences.NonDecreasingSequence
SuiteSplines.SortedSequences.NonDecreasingVector
SuiteSplines.SortedSequences.SortedSequence
SuiteSplines.SortedSequences.Unique
SuiteSplines.SpecialSpaces.Domain
SuiteSplines.SpecialSpaces.FunctionSpace
SuiteSplines.SpecialSpaces.IterableMixedSplineSpace
SuiteSplines.SpecialSpaces.MixedFunctionSpace
SuiteSplines.SpecialSpaces.MixedSplineSpace
SuiteSplines.SpecialSpaces.MixedSplineSpaceConstraints
SuiteSplines.SpecialSpaces.MixedSplineSpaceConstraints
SuiteSplines.SpecialSpaces.MixedSplineSpaceConstraints
SuiteSplines.SpecialSpaces.Partition
SuiteSplines.SpecialSpaces.Partition
SuiteSplines.SpecialSpaces.Partition
SuiteSplines.SpecialSpaces.Partition
SuiteSplines.SpecialSpaces.Partition
SuiteSplines.SpecialSpaces.RaviartThomas
SuiteSplines.SpecialSpaces.RaviartThomas
SuiteSplines.SpecialSpaces.ScalarSplineSpace
SuiteSplines.SpecialSpaces.ScalarSplineSpace
SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints
SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints
SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints
SuiteSplines.SpecialSpaces.SplineSpaceConstraints
SuiteSplines.SpecialSpaces.TaylorHood
SuiteSplines.SpecialSpaces.TaylorHood
SuiteSplines.SpecialSpaces.UnivariateSplineSpaceConstraints
SuiteSplines.SpecialSpaces.UnivariateSplineSpaceConstraints
SuiteSplines.SpecialSpaces.VectorFunctionSpace
SuiteSplines.SpecialSpaces.VectorSplineSpace
SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints
SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints
SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints
SuiteSplines.TensorProductBsplines.TPEvaluationCache
SuiteSplines.TensorProductBsplines.TensorProductBspline
SuiteSplines.UnivariateSplines.Bspline
SuiteSplines.UnivariateSplines.BsplineBasis
SuiteSplines.UnivariateSplines.BsplineEvaluationCache
SuiteSplines.UnivariateSplines.BsplineSupport
SuiteSplines.UnivariateSplines.GeneralizedGaussrule
SuiteSplines.UnivariateSplines.KnotSpanIndices
SuiteSplines.UnivariateSplines.KnotVector
SuiteSplines.UnivariateSplines.SpanIndex
SuiteSplines.UnivariateSplines.SplineSpace
SuiteSplines.UnivariateSplines.Support
SuiteSplines.UnivariateSplines.WeightedQuadrule
Base.adjoint
Base.adjoint
Base.collect
Base.eltype
Base.eltype
Base.getindex
Base.getindex
Base.getindex
Base.insert!
Base.inv
Base.inv
Base.iterate
Base.iterate
Base.iterate
Base.kron
Base.length
Base.length
Base.length
Base.transpose
Base.transpose
LinearAlgebra.det
LinearAlgebra.det
LinearAlgebra.eigen
LinearAlgebra.isposdef
LinearAlgebra.issymmetric
LinearAlgebra.lmul!
LinearAlgebra.logdet
LinearAlgebra.nullspace
LinearAlgebra.nullspace
LinearAlgebra.rmul!
LinearAlgebra.tr
SuiteSplines.AbstractMappings.l2_error
SuiteSplines.BezierBernsteinMethods.Binomial
SuiteSplines.BezierBernsteinMethods.b2c
SuiteSplines.BezierBernsteinMethods.barycentriccoords
SuiteSplines.BezierBernsteinMethods.bernstein
SuiteSplines.BezierBernsteinMethods.bernsteinfuns
SuiteSplines.BezierBernsteinMethods.cartesiancoords
SuiteSplines.BezierBernsteinMethods.decasteljau!
SuiteSplines.BezierBernsteinMethods.degree_elevation_operator
SuiteSplines.BezierBernsteinMethods.grevillepoint
SuiteSplines.BezierBernsteinMethods.jacobian
SuiteSplines.BezierBernsteinMethods.kformbasisconv
SuiteSplines.BezierBernsteinMethods.linindex
SuiteSplines.BezierBernsteinMethods.mass_matrix
SuiteSplines.BezierBernsteinMethods.multiindex
SuiteSplines.BezierBernsteinMethods.step_decasteljau!
SuiteSplines.BezierBernsteinMethods.subsets
SuiteSplines.BezierBernsteinMethods.vol
SuiteSplines.IgaBase.boundary
SuiteSplines.IgaBase.custom_replace_ref_begin_end!
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimension
SuiteSplines.IgaBase.dimsplinespace
SuiteSplines.IgaBase.dimsplinespace
SuiteSplines.IgaBase.numbertype
SuiteSplines.IgaBase.numbertype
SuiteSplines.IgaBase.order
SuiteSplines.IgaBase.refine
SuiteSplines.IgaBase.refine
SuiteSplines.IgaFormation.QuadraturePoints
SuiteSplines.IgaFormation.QuadraturePoints
SuiteSplines.IgaFormation.QuadratureWeights
SuiteSplines.IgaFormation.QuadratureWeights
SuiteSplines.IgaFormation.TestFunctions
SuiteSplines.IgaFormation.TestFunctions
SuiteSplines.IgaFormation.TestIndices
SuiteSplines.IgaFormation.TestIndices
SuiteSplines.IgaFormation.TrialFunctions
SuiteSplines.IgaFormation.TrialFunctions
SuiteSplines.IgaFormation.TrialIndices
SuiteSplines.IgaFormation.TrialIndices
SuiteSplines.IgaFormation.coface
SuiteSplines.IgaFormation.pre_allocate_arrays
SuiteSplines.IgaFormation.pre_allocate_arrays
SuiteSplines.IgaFormation.pre_allocate_arrays
SuiteSplines.IgaFormation.pre_allocate_arrays
SuiteSplines.IgaFormation.sumfact!
SuiteSplines.IgaFormation.sumfact!
SuiteSplines.IgaFormation.sumfact!
SuiteSplines.IgaFormation.sumfact!
SuiteSplines.ImmersedSplines.active_splines
SuiteSplines.ImmersedSplines.active_splines
SuiteSplines.ImmersedSplines.active_splines
SuiteSplines.ImmersedSplines.compute_extension_coefficients
SuiteSplines.ImmersedSplines.element_is_inside
SuiteSplines.ImmersedSplines.find_extension_indices
SuiteSplines.ImmersedSplines.find_first_active_element
SuiteSplines.ImmersedSplines.point_is_inside
SuiteSplines.ImmersedSplines.spline_extension_operator
SuiteSplines.KroneckerProducts.box
SuiteSplines.KroneckerProducts.issquare
SuiteSplines.SortedSequences.construct_vector
SuiteSplines.SortedSequences.deconstruct_vector
SuiteSplines.SortedSequences.global_insert
SuiteSplines.SpecialSpaces.boundary_number
SuiteSplines.SpecialSpaces.boundary_symbol
SuiteSplines.SpecialSpaces.clamped_constraint!
SuiteSplines.SpecialSpaces.clamped_constraint!
SuiteSplines.SpecialSpaces.codimfunspace
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimensions
SuiteSplines.SpecialSpaces.dimfunspace
SuiteSplines.SpecialSpaces.extraction_operator
SuiteSplines.SpecialSpaces.extraction_operator
SuiteSplines.SpecialSpaces.extraction_operators
SuiteSplines.SpecialSpaces.extraction_operators
SuiteSplines.SpecialSpaces.getcoeffs
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.indices
SuiteSplines.SpecialSpaces.left_constraint!
SuiteSplines.SpecialSpaces.periodic_constraint!
SuiteSplines.SpecialSpaces.right_constraint!
SuiteSplines.SpecialSpaces.setcoeffs!
SuiteSplines.SpecialSpaces.setcoeffs!
SuiteSplines.SpecialSpaces.setcoeffs!
SuiteSplines.SpecialSpaces.setcoeffs!
SuiteSplines.UnivariateSplines.approximate_collocation_inverse
SuiteSplines.UnivariateSplines.approximate_l2_inverse
SuiteSplines.UnivariateSplines.bezier_extraction_operator
SuiteSplines.UnivariateSplines.bspline_integral_value
SuiteSplines.UnivariateSplines.bspline_interpolation_matrix
SuiteSplines.UnivariateSplines.bsplinebasisfuns
SuiteSplines.UnivariateSplines.ders_bspline_interpolation_matrix
SuiteSplines.UnivariateSplines.dersbsplinebasisfuns
SuiteSplines.UnivariateSplines.distribute_points
SuiteSplines.UnivariateSplines.extraction_operator
SuiteSplines.UnivariateSplines.findspan
SuiteSplines.UnivariateSplines.grevillepoints
SuiteSplines.UnivariateSplines.h_refinement_operator!
SuiteSplines.UnivariateSplines.normalization_weights
SuiteSplines.UnivariateSplines.nquadpoints
SuiteSplines.UnivariateSplines.num_elements
SuiteSplines.UnivariateSplines.onebasisfuneval
SuiteSplines.UnivariateSplines.refinement_operator
SuiteSplines.UnivariateSplines.solve_leastnorm_without_constraints
SuiteSplines.UnivariateSplines.table_required_points
SuiteSplines.UnivariateSplines.two_scale_operator
SuiteSplines.UnivariateSplines.unit_integral_rescaling
SuiteSplines.UnivariateSplines.wquadweights!
SuiteSplines.@suitesplines_reexport
SuiteSplines.AbstractMappings.@evaluate
SuiteSplines.AbstractMappings.@evaluate!
SuiteSplines.@suitesplines_reexport
— Macro@suitesplines_reexport(pkgs...)
Convenience macro to reexport submodules of SuiteSplines
.
- If no arguments are passed, it reexports all submodules in
SuiteSplines.SUITESPLINES_PKGS
. - If one or more
Symbol
s are passed (e.g.,UnivariateSplines
), only those specific submodules are reexported.
This macro expands to a block of @reexport using SuiteSplines.PkgName
statements.
SuiteSplines.SUITESPLINES_PKGS
— ConstantVector of package names included in the SuiteSplines.jl
bundle (without .jl
).
LinearAlgebra.nullspace
— Methodnullspace(A::AbstractMatrix{T<:Real})
Construct a left basis for the null space of matrix A.
LinearAlgebra.nullspace
— Methodnullspace(a::AbstractVector{T}) where {T<:Real}
Find a sparse basis for the null space of a vector. The entries are computed such that null space operator is maximally sparse and column sum of absolute values equals 1.0 for improved conditioning.
SuiteSplines.IgaBase.boundary
— Methodboundary(s; direction=1, component=1)
∂(s; direction=1, component=1)
Return boundary component
in direction
of the object s
.
SuiteSplines.IgaBase.custom_replace_ref_begin_end!
— Methodreplace_ref_begin_end!(ex)
Recursively replace occurrences of the symbols :begin
and :end
in a "ref" expression (i.e. A[...]
) ex
with the appropriate function calls (firstindex
or lastindex
). Replacement uses the closest enclosing ref, so A[B[end]] should transform to A[B[lastindex(B)]]
SuiteSplines.IgaBase.AbstractMapping
— TypeAbstractMapping{Dim,S1,S2}
Abstract type representing a mapping with an Dim
dimensional domain, taking values in an S1 x S2
codimensional space.
SuiteSplines.IgaBase.AbstractSpline
— TypeAbstractSpline{Dim} <: ScalarMapping{Dim}
Abstract subtype of ScalarMapping
that represents a AbstractSpline function.
SuiteSplines.IgaBase.Boundary
— TypeBoundary{S<:AbstractMapping}
Iterator over the boundary components of a mapping of type S
.
SuiteSplines.IgaBase.Degree
— TypeDegree
Polynomial degree (typeallias of Integer).
SuiteSplines.IgaBase.Dimension
— TypeDimension
Dimension (typeallias of Integer).
SuiteSplines.IgaBase.Regularity
— TypeRegularity
Regularity of the B-spline basis (typeallias of Integer).
SuiteSplines.IgaBase.ScalarMapping
— TypeScalarMapping{Dim} <: AbstractMapping{Dim,1,1}
Abstract subtype of AbstractMapping
` that represents scalar-valued mappings.
Base.insert!
— Methodinsert!(v, index, item)
The Base.Insert!
function is extended to operate on NonDecreasingVector
and IncreasingVector
. An argument-error will be thrown if the item
leads to an unsorted sequence.
Examples:
julia> v = NonDecreasingVector([1,2,3,4]);
julia> insert!(v, 3, 2)
5-element Vector{Int64}:
1
2
2
3
4
julia> v = IncreasingVector([1,2,4,5]);
julia> insert!(v, 3, 3)
5-element Vector{Int64}:
1
2
3
4
5
SuiteSplines.SortedSequences.construct_vector
— Methodconstruct_vector(u, m)
Construct a vector by repeating the elements in u
m
times.
Examples:
julia> u = [0.0,1.0,2.5,3.0]
4-element Vector{Float64}:
0.0
1.0
2.5
3.0
julia> m = [2,1,2,3]
4-element Vector{Int64}:
2
1
2
3
julia> construct_vector(u, m)
8-element Vector{Float64}:
0.0
0.0
1.0
2.5
2.5
3.0
3.0
3.0
SuiteSplines.SortedSequences.deconstruct_vector
— Methoddeconstruct_vector(v)
Decompose a sequence into a new sequence, a multiplicity vector, and vectors specifying indexing into the sequence.
Examples:
julia> v = [0.0,0.0,1.0,2.0,2.0,3.0,3.0,3.0];
julia> u, m, ia, ic = deconstruct_vector(v)
([0.0, 1.0, 2.0, 3.0], [2, 1, 2, 3], [1, 1, 2, 3, 3, 4, 4, 4], [2, 3, 5, 8])
julia> construct_vector(u,m)==v
true
julia> u[ia]==v
true
julia> v[ic]==u
true
SuiteSplines.SortedSequences.global_insert
— Methodglobal_insert(v, k)
Uniformly subdivide new values into an IncreasingVector
or NonDecreasingVector
.
Examples:
julia> v = IncreasingVector([0.0,1.0,2.0])
3-element IncreasingVector{Float64}:
0.0
1.0
2.0
julia> global_insert(v, 3)
9-element IncreasingVector{Float64}:
0.0
0.25
0.5
0.75
1.0
1.25
1.5
1.75
2.0
When applied to a NonDecreasingVector
only the non-zero length intervals are subdivided
julia> v = NonDecreasingVector([0.0,0.0,1.0,1.0,2.0])
5-element NonDecreasingVector{Float64}:
0.0
0.0
1.0
1.0
2.0
julia> global_insert(v, 3)
11-element NonDecreasingVector{Float64}:
0.0
0.0
0.25
0.5
0.75
1.0
1.0
1.25
1.5
1.75
2.0
SuiteSplines.SortedSequences.IncreasingRange
— TypeIncreasingRange{T<:Real}
Construct an increasing range of real numbers.
SuiteSplines.SortedSequences.IncreasingSequence
— TypeIncreasingSequence{T}
Abstract type for increasing sequences of real numbers.
SuiteSplines.SortedSequences.IncreasingVector
— TypeIncreasingVector{T<:Real}
Construct a vector with an increasing set of real numbers.
Examples:
The element type T
is a subtype of Real
. Hence it is possible to make IncreasingVector{Int64}
as well as IncreasingVector{Float64}
julia> IncreasingVector([0,1,2,3])
4-element IncreasingVector{Int64}:
0
1
2
3
julia> IncreasingVector([0.0,1.0,2.0,3.0])
4-element IncreasingVector{Float64}:
0.0
1.0
2.0
3.0
It is also possible to extract the unique values of a NonDecreasingVector into an IncreasingVector.
julia> v = NonDecreasingVector([0.0,0.0,1.0,2.0,2.0,3.0,3.0])
7-element NonDecreasingVector{Float64}:
0.0
0.0
1.0
2.0
2.0
3.0
3.0
julia> IncreasingVector(v)
4-element IncreasingVector{Float64}:
0.0
1.0
2.0
3.0
SuiteSplines.SortedSequences.Interval
— TypeInterval(a::T, b::T)
Create an interval from a point a to a point b.
SuiteSplines.SortedSequences.NonDecreasingSequence
— TypeNonDecreasingSequence{T}
Abstract type for non-decreasing sequences of real numbers.
SuiteSplines.SortedSequences.NonDecreasingVector
— TypeNonDecreasingVector{T}
Construct a vector with a non-decreasing set of real numbers.
Examples:
julia> v = NonDecreasingVector([0.0,0.0,1.0,2.0,2.0])
5-element NonDecreasingVector{Float64}:
0.0
0.0
1.0
2.0
2.0
julia> u, m = deconstruct_vector(v)
([0.0, 1.0, 2.0], [2, 1, 2], [1, 1, 2, 3, 3], [2, 3, 5])
julia> u
3-element IncreasingVector{Float64}:
0.0
1.0
2.0
julia> NonDecreasingVector(u, m) == v
true
It is also possible to extract the unique values of a NonDecreasingVector into an IncreasingVector.
julia> v = NonDecreasingVector([0.0,0.0,1.0,2.0,2.0,3.0,3.0])
7-element NonDecreasingVector{Float64}:
0.0
0.0
1.0
2.0
2.0
3.0
3.0
julia> IncreasingVector(v)
4-element IncreasingVector{Float64}:
0.0
1.0
2.0
3.0
SuiteSplines.SortedSequences.SortedSequence
— TypeSortedSequence{T}
Abstract type for sorted sequences of real numbers.
SuiteSplines.SortedSequences.Unique
— TypeUnique(v)
Convenience iterator that lazily returns a tuple with the unique consecutive values and their multiplicities.
Examples:
julia> v = [1,1,3,4,5,5,5,6,6,7];
julia> for item in Unique(v)
@show item
end
item = (1, 2)
item = (3, 1)
item = (4, 1)
item = (5, 3)
item = (6, 2)
item = (7, 1)
Base.collect
— Methodcollect(X)
Collect values of CartesianProduct{T,Dim}
in Dim
-dimensional arrays. Similar to ndgrid
in Matlab.
Examples:
julia> x, y = collect([1,2] ⨱ [2,3,4]);
julia> x
2×3 Matrix{Int64}:
1 1 1
2 2 2
julia> y
2×3 Matrix{Int64}:
2 3 4
2 3 4
Base.adjoint
— Methodadjoint(K::BoxProduct)
Compute the adjoint of a Box product.
Base.adjoint
— Methodadjoint(K::KroneckerProduct)
Compute the adjoint of a Kronecker product.
Base.inv
— Methodinv(K::BoxProduct)
Compute the inverse of a Box product.
Base.inv
— Methodinv(K::KroneckerProduct)
Compute the inverse of a Kronecker product.
Base.kron
— Methodcollect(K::KroneckerProduct)
Collects a lazy instance of the KroneckerProduct
type into a full, native matrix. Equivalent with Matrix(K::KroneckerProduct)
.
Base.transpose
— Methodtranspose(K::BoxProduct)
Compute the transpose of a Box product.
Base.transpose
— Methodtranspose(K::KroneckerProduct)
Compute the transpose of a Kronecker product.
LinearAlgebra.det
— Methoddet(K::BoxProduct)
Compute the determinant of a Box product.
LinearAlgebra.det
— Methoddet(K::KroneckerProduct)
Compute the determinant of a Kronecker product.
LinearAlgebra.eigen
— Methodeigen(K::KroneckerProduct)
If the matrices of a KroneckerProduct
instance are square, performs the eigenvalue decompositon on them and return an Eigen
type.
LinearAlgebra.isposdef
— Methodisposdef(K::KroneckerProduct)
Test whether a Kronecker product is positive definite (and Hermitian) by trying to perform a Cholesky factorization of K.
LinearAlgebra.issymmetric
— Methodissymmetric(K::KroneckerProduct)
Checks if a Kronecker product is symmetric.
LinearAlgebra.lmul!
— Methodlmul!(a::Number, K::KroneckerProduct)
Scale a KroneckerProduct
K
inplace by a factor a
by rescaling the left matrix.
LinearAlgebra.logdet
— Methodlogdet(K::KroneckerProduct)
Compute the logarithm of the determinant of a Kronecker product.
LinearAlgebra.rmul!
— Methodrmul!(K::KroneckerProduct, a::Number)
Scale a KroneckerProduct
K
inplace by a factor a
by rescaling the right matrix.
LinearAlgebra.tr
— Methodtr(K::KroneckerProduct)
Compute the trace of a Kronecker product.
SuiteSplines.IgaBase.order
— Methodorder(M::AbstractMatrix)
Returns the order of a matrix, i.e. how many matrices are involved in the Kronecker product (default to 1 for general matrices).
SuiteSplines.KroneckerProducts.box
— Functionbox(A, B)
box(A, B...)
Compute the box product, which is defined as a perfect shuffle of a kronecker product.
SuiteSplines.KroneckerProducts.issquare
— Methodissquare(A::AbstractMatrix)
Checks if an array is a square matrix.
Base.Matrix
— MethodMatrix(K::KroneckerProduct)
Converts a GeneralizedKroneckerProduct
instance to a Matrix type.
SuiteSplines.KroneckerProducts.BoxProduct
— TypeBoxProduct{M,T,N} <: AbstractKron{M,T,N}
The box product is defined in the following paper.
Olsen, Peder A., Steven J. Rennie, and Vaibhava Goel. "Efficient automatic differentiation of matrix functions." In Recent Advances in Algorithmic Differentiation, pp. 71-81. Springer, Berlin, Heidelberg, 2012.
SuiteSplines.KroneckerProducts.KroneckerProduct
— TypeKroneckerProduct{T,N,S} <: AbstractVecOrMat{T}
Matrix type that stores the matrices in a Kronecker product and lazily evaluates products, sums, etc.
SuiteSplines.AbstractMappings.l2_error
— Methodl2_error(f; to, relative=false, quadrule=standard_quadrature_rule(f,g))
Compute the (relative) L^2 error of f
with respect to g
. Any f
and g
will do as long as @cartesian
and standard_quadrature_rule(f,g)
are implemented.
SuiteSplines.AbstractMappings.EvaluationSet
— TypeEvaluationSet{S1,S2, S}
Set of evaluation points that are used as input and output of functions, mappings and fields.
SuiteSplines.AbstractMappings.ResizableArray
— TypeResizableArray{T,Dim} <: AbstractArray{T, Dim}
Array-type that may be resized. New resources will be allocated if the new array-length exceeds maxlen.
SuiteSplines.AbstractMappings.@evaluate!
— Macro@evaluate! Y = f(x)
@evaluate! Y += f(x)
@evaluate! Y -= f(x)
@evaluate! Y *= f(x)
@evaluate! Y /= f(x)
Fast update routine for evaluating a mapping on a grid $x ...$. array Y
needs to be preallocated.
SuiteSplines.AbstractMappings.@evaluate
— Macro@evaluate Y = f(x)
Fast evaluation routine for evaluating a mapping on a grid $x ...$. The result is stored in array $Y$. Allocation is done automatically and EvaluationSet's of the correct size and type are cached for each mapping using an LRUCache.
SuiteSplines.BezierBernsteinMethods.Binomial
— MethodBinomial(Val(n), Val(k)) = binomial(n,k)
@generated
function for optimized computation of binomials.
SuiteSplines.BezierBernsteinMethods.b2c
— Methodb2c(simplex)
Return the mapping
(matrix) that maps barycentric coordinates to Cartesian coordinates.
SuiteSplines.BezierBernsteinMethods.barycentriccoords
— Methodbarycentriccoords(S::AbstractSimplex, x)
Compute the barycentric coordinates of a point, or matrix of points x
.
SuiteSplines.BezierBernsteinMethods.bernstein
— Methodbernstein(p::Degree, control::AbstractVector{T}, λ::BPoint{D,T})
Compute Bezier polynomial at barycentric point λ
with the degrees of freedom in control
.
SuiteSplines.BezierBernsteinMethods.bernsteinfuns
— Methodbernstein(X::MultiIndex{D}, λ::BPoint{D,T})
Compute single Bernstein basis function corresponding to multi-index X
at barycentric point λ
.
SuiteSplines.BezierBernsteinMethods.cartesiancoords
— Methodcartesiancoords(S::AbstractSimplex, λ)
Compute the Cartesian coordinates of a barycentric point or vector of barycentric points λ
.
SuiteSplines.BezierBernsteinMethods.decasteljau!
— Methoddecasteljau!(control::Vector{T}, λ::BPoint{D,T}, MultiIndices)
Classic DeCasteljau algorithm (can compute derivatives too!) on a (D-1)
-dimensional simplex.
SuiteSplines.BezierBernsteinMethods.degree_elevation_operator
— Functiondegree_elevation_operator(p::Degree, d::Dimension)
Return a matrix that maps degrees of freedom of a Bezier polynomial of degree p
to the degrees of freedom corresponding to its order elevated Bezier polynomial.
SuiteSplines.BezierBernsteinMethods.grevillepoint
— Methodgrevillepoint(X::MultiIndex)
Compute Greville point associated with multi-index label X
.
SuiteSplines.BezierBernsteinMethods.jacobian
— Methodjacobian(simplex)
Return the Jacobian mapping of a simplex.
SuiteSplines.BezierBernsteinMethods.kformbasisconv
— Methodkformbasisconv(n::Dimension, k::Form, r::Degree)
Compute the linear mapping from Bernstein polynomials to the space of k
-forms Pᵣ⁻Λᵏ(T)
. This linear mapping is encoded in Pattern{T}
. We refer to the paper. For more information, check out the periodic table of finite elements
SuiteSplines.BezierBernsteinMethods.linindex
— Methodlinindex(i, j, k...)
Return the linear index of a multi-index label.
SuiteSplines.BezierBernsteinMethods.mass_matrix
— Methodmass_matrix(S::AbstractSimplex{D}, p::Degree, q::Degree, T::Type{<:Real} = Type{Float64})
Compute Bernstein mass matrix for degree (p,q)
and dimension d
.
SuiteSplines.BezierBernsteinMethods.multiindex
— MethodMultiIndex(::LinearIndex{P<:Degree, D<:Dimension, I<:Integer})
Return the multi-index associated with linear index I
and simplicial domain of degree P
and dimension D
.
SuiteSplines.BezierBernsteinMethods.step_decasteljau!
— Methodstep_decasteljau!(control::Vector{T}, λ::BPoint{D,T}, MultiIndices)
Computes a single step of the recursive DeCasteljau algorithm on a (D-1)
-dimensional simplex.
SuiteSplines.BezierBernsteinMethods.subsets
— Methodsubsets(v::NTuple{n,Int}, k::Int)
Generate the binomial(n,k)
unique subsets of length k
from set v
and its complement.
Examples:
julia> α, β = subsets((1,2,3), 1);
julia> α
3-element Array{Tuple{Int64},1}:
(1,)
(2,)
(3,)
julia> β
3-element Array{Tuple{Int64,Int64},1}:
(2, 3)
(1, 3)
(1, 2)
SuiteSplines.BezierBernsteinMethods.vol
— Methodvol(simplex)
Compute the volume of an affine simplex.
SuiteSplines.IgaBase.dimension
— Methoddimension(simplex)
Return the dimension of a simplex.
SuiteSplines.IgaBase.dimsplinespace
— Methoddimsplinespace(p::Degree, d::Dimension)
Compute the dimension of the Bezier spline space on a simplex of degree p
and numer of vertices d
.
SuiteSplines.BezierBernsteinMethods.BezierSimplex
— Type BezierSimplex{D,T<:Real} <: AbstractSimplex{D}
Simplex of dimension D
with Vertices in real number type T
.
SuiteSplines.BezierBernsteinMethods.LinearIndex
— TypeLinearIndex(P::Degree, D::Dimension, I::Integer)
A linear index I
of a simplicial discretization with Degree P
and dimension D
.
SuiteSplines.BezierBernsteinMethods.LinearIndex
— MethodLinearIndex(::MultiIndex{X})
Compute the LinearIndex
associated with a MultiIndex
.
SuiteSplines.BezierBernsteinMethods.MultiIndices
— TypeMultiIndices(P::Degree, D::Dimension)
MultiIndices(D::Dimension)
MultiIndices(s::Simplex)
MultiIndices(s::BezierSimplex)
Returns an iterator corresponding to a Bezier simplex of polynomial degree P
and dimension D
.
SuiteSplines.BezierBernsteinMethods.Simplex
— Type Simplex{D,T<:Real} <: AbstractSimplex{D}
Simplex of dimension D
with Vertices in real number type T
.
SuiteSplines.IgaBase.dimsplinespace
— Methoddimsplinespace(p, U)
Compute the dimension of the spline space defined by degree $p$ and knotsvector $U$.
SuiteSplines.IgaBase.refine
— Methodrefine(p::Degree, R::AbstractRefinement)
Change in polynomial degree based on the refinement type.
SuiteSplines.IgaBase.refine
— Methodrefine(p::KnotVector, R::AbstractRefinement)
Change in knot vector based on the refinement type.
SuiteSplines.UnivariateSplines.approximate_collocation_inverse
— Methodapproximate_collocation_inverse(p, U)
approximate_collocation_inverse(p, U, k1)
Compute an approximate inverse $\mathsf{A} ≈ \mathsf{B}^{-1}$, where $\mathsf{B}$ is the consistent B-spline interpolation matrix. The approximation is of order $k_1 \leq p+1$. The quasi-interpolant is designed to reproduce polynomials
\[ \sum_{i=1}^n \mu_i(x^k) B_{i,p}(x) = x^k \quad \text{for } k=0,1,...,k_1-1\]
and is based on the following paper
T. Lyche and L. L. Schumaker. Local spline approximation methods. Journal of Approximation Theory, 15(4):294-325, Dec. 1975.
Examples:
julia> p = Degree(3);
julia> U = KnotVector([0.0,1.0,1.5,2.5,3.0], [p+1,1,1,2,p+1]);
julia> y = grevillepoints(p, U);
The approximate collocation inverse, using full approximation order $k_1=p+1$ and the consistent collocation matrix are computed as follows
julia> A = approximate_collocation_inverse(p, U, p+1);
julia> B = bspline_interpolation_matrix(p, U, y, 1)[1];
It can be verified that the quasi-interpolant reproduces constants, linears, quadratic and cubic polynomials
julia> B * A * (y.^0) ≈ y.^0
true
julia> B * A * (y.^1) ≈ y.^1
true
julia> B * A * (y.^2) ≈ y.^2
true
julia> B * A * (y.^3) ≈ y.^3
true
SuiteSplines.UnivariateSplines.approximate_l2_inverse
— Methodapproximate_l2_inverse(p, U, k1)
Compute an approximate inverse $\mathsf{S} ≈ \mathsf{M}^{-1}$, where $\mathsf{M}$ is the consisten B-spline mass matrix. The approximation is of order $k_1 \leq p+1$. The $L^2$ quasi-interpolant is designed to reproduce polynomials
\[ \sum_{i=1}^n \mu_i(x^k) B_{i,p}(x) = x^k \quad \text{for } k=0,1,...,k_1-1\]
and is based on the following paper
Chui, Charles K., Wenjie He, and Joachim Stöckler. "Nonstationary tight wavelet frames, I: Bounded intervals." Applied and Computational Harmonic Analysis 17.2 (2004): 141-197.
SuiteSplines.UnivariateSplines.bezier_extraction_operator
— Methodbezier_extraction_operator(p, U)
Compute the Bézier extraction operators corresponding to a B-spline basis of polynomial degree $p$ and knot vector $U$. The output is a 3-dimensional array $\mathsf{C} \in \mathbb{R}^{(p+1) \times (p+1) \times n_{el}}$.
The implementation is based on the following paper
Borden, Michael J., et al. "Isogeometric finite element data structures based on Bézier extraction of NURBS." International Journal for Numerical Methods in Engineering 87.1‐5 (2011): 15-47.
Examples:
julia> p = Degree(2); U = KnotVector([0.0,0.0,0.0,1.0,3.0,3.0,4.0,4.0,4.0]);
julia> bezier_extraction_operator(p, U)
3×3×3 Array{Float64, 3}:
[:, :, 1] =
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.666667 0.333333
[:, :, 2] =
0.666667 0.333333 0.0
0.0 1.0 0.0
0.0 0.0 1.0
[:, :, 3] =
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
SuiteSplines.UnivariateSplines.bspline_integral_value
— Methodbspline_integral_value(p, U, i::Int)
bspline_integral_value(p, U)
Compute the integral of a b-spline function defined by degree p
and knotvector U
.
SuiteSplines.UnivariateSplines.bspline_interpolation_matrix
— Functionbspline_interpolation_matrix(p, U, i, x, nout=1)
Given the polynomial degree $p$ and knot-vector $U$ compute the collocation matrices of the B-spline basis functions sampled at a set of points $x$. The output is a set of sparse matrices whose rows correspond to the evaluation points and whose columns are associated with the B-spline degrees of freedom.
Examples:
julia> p = Degree(2);
julia> U = KnotVector([0.0,1.0,1.5,2.5,3.0], [3,1,1,2,3]);
julia> x = IncreasingVector([0.5,1.5,2.75]);
julia> B = bspline_interpolation_matrix(p, U, x, p+1);
The interpolation matrix for quadratic B-splines is
julia> B[1]
3×7 SparseArrays.SparseMatrixCSC{Float64, Int64} with 9 stored entries:
0.25 0.583333 0.166667 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 0.666667 0.333333 0.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 0.25 0.5 0.25
The interpolation matrix for linear and constant B-splines is given by
julia> B[2]
3×6 SparseArrays.SparseMatrixCSC{Float64, Int64} with 6 stored entries:
0.5 0.5 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 1.0 0.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 0.5 0.5
julia> B[3]
3×5 SparseArrays.SparseMatrixCSC{Float64, Int64} with 3 stored entries:
1.0 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 1.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 1.0
It can be easily verified that the B-splines satisfy a partition of unity
julia> sum(B[1],dims=2)
3×1 Matrix{Float64}:
1.0
1.0
1.0
julia> sum(B[2],dims=2)
3×1 Matrix{Float64}:
1.0
1.0
1.0
julia> sum(B[3],dims=2)
3×1 Matrix{Float64}:
1.0
1.0
1.0
The collocation matrices can be used to solve an interpolation problem or a PDE using the collocation method. For example, the interpolation matrix evaluated at the Greville points can be computed as follows
julia> x = grevillepoints(p, U);
julia> B = bspline_interpolation_matrix(p, U, x, p+1)[1]
7×7 SparseArrays.SparseMatrixCSC{Float64, Int64} with 21 stored entries:
1.0 0.0 0.0 ⋅ ⋅ ⋅ ⋅
0.25 0.583333 0.166667 ⋅ ⋅ ⋅ ⋅
⋅ 0.0833333 0.833333 0.0833333 ⋅ ⋅ ⋅
⋅ ⋅ 0.166667 0.583333 0.25 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 1.0 0.0 0.0
⋅ ⋅ ⋅ ⋅ 0.25 0.5 0.25
⋅ ⋅ ⋅ ⋅ 0.0 0.0 1.0
The matrix $\mathsf{B}$ can then be used to interpolate a univariate function. For example, up to quadratic polynomials are exactly reproduced
# sample grid to test polynomial reproduction
julia> y = global_insert(x, 4);
julia> C = bspline_interpolation_matrix(p, U, y, 1)[1];
julia> C * (B \ x.^0) ≈ y.^0
true
julia> C * (B \ x.^1) ≈ y.^1
true
julia> C * (B \ x.^2) ≈ y.^2
true
Here matrix $\mathsf{C}$ evaluates the B-spline at a refined partition $y$.
SuiteSplines.UnivariateSplines.bsplinebasisfuns
— Functionbsplinebasisfuns(p, U, i::Integer, x::T, nout=1)
bsplinebasisfuns(p, U, x::T, nout=1)
Compute the $p+1$ non-zero B-spline basis-functions at site $x \in [U_{i},U_{i+1})$. The output is a matrix where column $j$ (rows $1:p+2-j$), for $j=1,...,n_{out}$ correspond to the $p+2-j$ non-zero B-spline basis functions of degree $p+1-j$. The remaining entries correspond to supports. If the active knot-span is not provided then it will be computed.
Examples:
julia> p = Degree(2);
julia> U = KnotVector([0.0,0.0,0.0,1.0,2.0,2.0,2.0]);
julia> x = 1.5
1.5
julia> span = findspan(p, U, x)
4
julia> B = bsplinebasisfuns(p, U, span, x, p+1)
3×3 Matrix{Float64}:
0.125 0.5 1.0
0.625 0.5 1.0
0.25 1.0 2.0
The knot span index can be omited, in which case it is computed on the fly.
julia> bsplinebasisfuns(p, U, x, p+1)
3×3 Matrix{Float64}:
0.125 0.5 1.0
0.625 0.5 1.0
0.25 1.0 2.0
By prescribing a vector of $m$ sites $x \in \mathbb{R}^m$ we can compute the B-splines at more than one point. The function can be called with or without prescribing the knot-span index
bsplinebasisfuns(p, U, span::Vector{Integer}, u::Vector{T}, nout=1)
bsplinebasisfuns(p, U, u::SortedSequence{T}, nout=1)
The output is a 3-dimensional array $B \in \mathbb{R}^{(p+1) \times m \times n_{out}}$.
Examples:
julia> x = IncreasingVector([0.5, 1.5]);
julia> span = findspan(p, U, x)
2-element NonDecreasingVector{Int64}:
3
4
julia> bsplinebasisfuns(p, U, span, x, p+1)
3×2×3 Array{Float64, 3}:
[:, :, 1] =
0.25 0.125
0.625 0.625
0.125 0.25
[:, :, 2] =
0.5 0.5
0.5 0.5
2.0 1.0
[:, :, 3] =
1.0 1.0
1.0 1.0
1.0 2.0
Alternatively, the non-vanishing B-splines up to and including degree $p$ can be computed at $n_{el}$ non-zero knot-spans (elements) with $m$ sites each, that is, $x \in \mathbb{R}^{m \times n_{el}}$. Again, the function can be called with or without prescribing the knot-span index
bsplinebasisfuns(p, U, span::Vector{Int64}, u::Matrix{T}, nout=1)
bsplinebasisfuns(p, U, u::Matrix{T}, nout=1)
The output is a 4-dimensional array $B \in \mathbb{R}^{(p+1) \times m \times n_{el} \times n_{out}}$.
Examples:
julia> x = [0.25 1.25;
0.75 1.75];
julia> bsplinebasisfuns(p, U, x, p+1)
3×2×2×3 Array{Float64, 4}:
[:, :, 1, 1] =
0.5625 0.0625
0.40625 0.65625
0.03125 0.28125
[:, :, 2, 1] =
0.28125 0.03125
0.65625 0.40625
0.0625 0.5625
[:, :, 1, 2] =
0.75 0.25
0.25 0.75
2.0 2.0
[:, :, 2, 2] =
0.75 0.25
0.25 0.75
1.0 1.0
[:, :, 1, 3] =
1.0 1.0
1.0 1.0
1.0 1.0
[:, :, 2, 3] =
1.0 1.0
1.0 1.0
2.0 2.0
SuiteSplines.UnivariateSplines.ders_bspline_interpolation_matrix
— Functionders_bspline_interpolation_matrix(p, U, i, x, nout=1)
Given the polynomial degree $p$ and knot-vector $U$ compute the collocation matrices of the first $n_{out}$ derivatives of the B-spline basis functions sampled at a set of points $x$. The output is a set of sparse matrices whose rows correspond to the evaluation points and whose columns are associated with the B-spline degrees of freedom.
Examples:
julia> p = Degree(2);
julia> U = KnotVector([0.0,1.0,1.5,2.5,3.0], [3,1,1,2,3]);
julia> x = IncreasingVector([0.5,1.5,2.75]);
julia> B = ders_bspline_interpolation_matrix(p, U, x, p+1);
The output is a set of SparseMatrixCSC
matrices. For example the B-splines evaluate at points $x$ are
julia> B[1]
3×7 SparseArrays.SparseMatrixCSC{Float64, Int64} with 9 stored entries:
0.25 0.583333 0.166667 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 0.666667 0.333333 0.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 0.25 0.5 0.25
Derivatives of quadratic B-splines evaluated at $x$
julia> B[2]
3×7 SparseArrays.SparseMatrixCSC{Float64, Int64} with 9 stored entries:
-1.0 0.333333 0.666667 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ -1.33333 1.33333 0.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ -2.0 0.0 2.0
Second derivatives of quadratic B-splines evaluated at $x$
julia> B[3]
3×7 SparseArrays.SparseMatrixCSC{Float64, Int64} with 9 stored entries:
2.0 -3.33333 1.33333 ⋅ ⋅ ⋅ ⋅
⋅ ⋅ 1.33333 -3.33333 2.0 ⋅ ⋅
⋅ ⋅ ⋅ ⋅ 8.0 -16.0 8.0
SuiteSplines.UnivariateSplines.dersbsplinebasisfuns
— Functiondersbsplinebasisfuns(p, U, span::Int, u::T, nout=1)
dersbsplinebasisfuns(p, U, u::T, nout=1)
Compute the non-vanishing B-spline basis-functions of degree $p$ and their $n_{out}-1$'th order derivatives at the site $x$. The output is a matrix $B \in \mathbb{R}^{(p+1) \times n_{out}}$ where the $i$'th row corresponds to the $i$'th non-vanishing B-spline at $x$ and the $j$'th column corresponds to the $j-1$'th derivative.
The implementation of this function is based on
Piegl, Les, and Wayne Tiller. The NURBS book. Springer Science & Business Media, 2012.
Examples:
julia> p = Degree(2);
julia> U = KnotVector([0.0,0.0,0.0,1.0,2.0,2.0,2.0]);
julia> x = 1.5;
julia> span = findspan(p, U, x)
4
julia> dersbsplinebasisfuns(p, U, span, x, p+1)
3×3 Matrix{Float64}:
0.125 -0.5 1.0
0.625 -0.5 -3.0
0.25 1.0 2.0
dersbsplinebasisfuns
can also be called without providing the span-indices, in which case they will be calculated on the fly.
julia> dersbsplinebasisfuns(p, U, x, p+1)
3×3 Matrix{Float64}:
0.125 -0.5 1.0
0.625 -0.5 -3.0
0.25 1.0 2.0
By prescribing a vector of $m$ sites $x \in \mathbb{R}^m$ we can compute the B-splines and their derivatives at more than one point. The function can be called with or without prescribing the knot-span index
dersbsplinebasisfuns(p, U, span::Vector{Integer}, u::Vector{T}, nout=1)
dersbsplinebasisfuns(p, U, u::SortedSequence{T}, nout=1)
The output is a 3-dimensional array $B \in \mathbb{R}^{(p+1) \times m \times n_{out}}$.
Examples:
julia> x = IncreasingVector([0.5, 1.5]);
julia> span = findspan(p, U, x)
2-element NonDecreasingVector{Int64}:
3
4
julia> dersbsplinebasisfuns(p, U, span, x, p+1)
3×2×3 Array{Float64, 3}:
[:, :, 1] =
0.25 0.125
0.625 0.625
0.125 0.25
[:, :, 2] =
-1.0 -0.5
0.5 -0.5
0.5 1.0
[:, :, 3] =
2.0 1.0
-3.0 -3.0
1.0 2.0
Alternatively, the non-vanishing derivatives of the B-splines can be computed at $n_{el}$ non-zero knot-spans (elements) with $m$ sites each, that is, $x \in \mathbb{R}^{m \times n_{el}}$. Again, the function can be called with or without prescribing the knot-span index
dersbsplinebasisfuns(p, U, span::Vector{Int64}, u::Matrix{T}, nout=1)
dersbsplinebasisfuns(p, U, u::Matrix{T}, nout=1)
The output is a 4-dimensional array $B \in \mathbb{R}^{(p+1) \times m \times n_{el} \times n_{out}}$.
Examples:
julia> x = [0.25 1.25;
0.75 1.75];
julia> dersbsplinebasisfuns(p, U, x, p+1)
3×2×2×3 Array{Float64, 4}:
[:, :, 1, 1] =
0.5625 0.0625
0.40625 0.65625
0.03125 0.28125
[:, :, 2, 1] =
0.28125 0.03125
0.65625 0.40625
0.0625 0.5625
[:, :, 1, 2] =
-1.5 -0.5
1.25 -0.25
0.25 0.75
[:, :, 2, 2] =
-0.75 -0.25
0.25 -1.25
0.5 1.5
[:, :, 1, 3] =
2.0 2.0
-3.0 -3.0
1.0 1.0
[:, :, 2, 3] =
1.0 1.0
-3.0 -3.0
2.0 2.0
SuiteSplines.UnivariateSplines.distribute_points
— Methoddistribute_points(S::SplineSpace, V::SplineSpace; add_boundary_points::Bool=false)
Compute distribution of quadrature points in weigthed quadrature with a test-space $V$ and target space for quadrature $S$. The nodes are distribute in such a way that all conditions for exact quadrature are satisfied with a minimum number of points.
The distribution of quadrature points in weighted quadrature is based on the following paper.
Hiemstra, René R., et al. "Fast formation and assembly of finite element matrices with application to isogeometric linear elasticity." Computer Methods in Applied Mechanics and Engineering 355 (2019): 234-260.
Examples:
julia> S = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,2,2,3]);
julia> V = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,1,1,3]);
julia> UnivariateSplines.distribute_points(S, V)
8-element IncreasingVector{Float64}:
0.16666666666666666
0.5
0.8333333333333334
1.25
1.75
2.1666666666666665
2.5
2.8333333333333335
SuiteSplines.UnivariateSplines.extraction_operator
— Methodextraction_operator(p::Degree, U::KnotVector; [cperiodic, cleft, cright])
Compute an extraction operator that creates a subspace of the SplineSpace
with for example peroidicity built-in.
SuiteSplines.UnivariateSplines.findspan
— Methodfindspan(p, U, u)
Given polynomial degree $p$ and knotvector $U$ determine the knot span index $i$ of a point $x$ such that $u \in [U_i, U_{i+1})$.
Examples:
julia> p = Degree(2)
2
julia> U = KnotVector([0.0,1.0,1.5,2.5,3.0],[3,1,1,2,3])
10-element NonDecreasingVector{Float64}:
0.0
0.0
0.0
1.0
1.5
2.5
2.5
3.0
3.0
3.0
julia> x = 2.0
2.0
julia> span = findspan(p, U, x)
5
julia> U[span] ≤ x < U[span+1]
true
It is also possible to compute the knot-spans of all values in an 'IncreasingVector{T}'
julia> x = IncreasingVector([0.25, 0.75, 1.0, 1.25, 2.5, 2.75]);
julia> span = findspan(p, U, x)
6-element NonDecreasingVector{Int64}:
3
3
4
4
7
7
SuiteSplines.UnivariateSplines.grevillepoints
— Methodgrevillepoints(p, U, i)
grevillepoints(p, U)
Compute the $i$'th Greville Absissa corresponding to the $i$'th B-spline defined by degree 'p' and knotvector 'U' of spline space.
Examples:
julia> p = Degree(2);
julia> U = KnotVector([0.0,1.0,2.5,3.0], [3,1,2,1])
7-element NonDecreasingVector{Float64}:
0.0
0.0
0.0
1.0
2.5
2.5
3.0
julia> grevillepoints(p, U, 2)
0.5
julia> grevillepoints(p, U)
4-element IncreasingVector{Float64}:
0.0
0.5
1.75
2.5
SuiteSplines.UnivariateSplines.h_refinement_operator!
— Methodh_refinement_operator!(p::Degree, U::KnotVector{T}, u::AbstractVector{T}) where {T<:Real}
h_refinement_operator!(p::Degree, U::KnotVector{T}, u::T) where {T<:Real}
h_refinement_operator!(p::Degree, U::KnotVector{T}, span::Integer, u::T) where {T<:Real}
Insert one or more knots $u$ into knotvector $U$ and output the transformation operator from the coarse to the refined space. The knotvector is updated in-place. The output is represented as a SparseMatrixCSC
matrix.
Examples:
julia> p = Degree(2)
2
julia> U = KnotVector([0.0,1.0,2.0,3.0,4], [3,1,1,2,3])
10-element NonDecreasingVector{Float64}:
0.0
0.0
0.0
1.0
2.0
3.0
3.0
4.0
4.0
4.0
julia> C = h_refinement_operator!(p, U, [0.5, 1.5, 2.5, 3.5]); # sparse matrix
julia> Matrix(C)
11×7 Matrix{Float64}:
1.0 0.0 0.0 0.0 0.0 0.0 0.0
0.5 0.5 0.0 0.0 0.0 0.0 0.0
0.0 0.75 0.25 0.0 0.0 0.0 0.0
0.0 0.25 0.75 0.0 0.0 0.0 0.0
0.0 0.0 0.75 0.25 0.0 0.0 0.0
0.0 0.0 0.25 0.75 0.0 0.0 0.0
0.0 0.0 0.0 0.5 0.5 0.0 0.0
0.0 0.0 0.0 0.0 1.0 0.0 0.0
0.0 0.0 0.0 0.0 0.5 0.5 0.0
0.0 0.0 0.0 0.0 0.0 0.5 0.5
0.0 0.0 0.0 0.0 0.0 0.0 1.0
julia> @show U;
U = [0.0, 0.0, 0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.0, 3.5, 4.0, 4.0, 4.0]
SuiteSplines.UnivariateSplines.normalization_weights
— Methodnormalization_weights(X)
Determine a set of normalization weights that result in a more uniform set oftype( weighted quadrature weights when solving for the least norm solution. )
SuiteSplines.UnivariateSplines.nquadpoints
— Methodnquadpoints(S::SplineSpace, V::SplineSpace; add_boundary_points=false, add_additional_points=0, min_points=1)
Determine the minimum number of quadrature points corresponding to a weighted quadrature rule with test-space $V$ and target-space $S$.
Examples:
julia> S = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,2,2,3]);
julia> V = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,1,1,3]);
julia> A = UnivariateSplines.nquadpoints(S, V; add_boundary_points=false)
3-element Vector{Int64}:
3
2
3
SuiteSplines.UnivariateSplines.num_elements
— Methodnum_elements(U::KnotVector)
Count the number of non-zero knot spans or elements in the knotvector.
SuiteSplines.UnivariateSplines.onebasisfuneval
— Methodonebasisfuneval(U, u)
Compute value of a single B-spline basis-function defined by local knotvector 'U' evaluated at point 'x'.
The implementation of this function is taken from
Piegl, Les, and Wayne Tiller. The NURBS book. Springer Science & Business Media, 2012.
SuiteSplines.UnivariateSplines.refinement_operator
— Methodrefinement_operator(p::Degree, U::KnotVector, method::AbstractRefinement)
Compute the two_scale_operator
given p
and U
and the applicable refinement strategy: IgaBase.hRefinement()
, IgaBase.pRefinement()
, IgaBase.kRefinement()
. See IgaBase
package for definition of refinement methods.
SuiteSplines.UnivariateSplines.solve_leastnorm_without_constraints
— Methodsolve_leastnorm_without_constraints(A, b, S=BigFloat)
Solve underdetermined system of equation $A x = b$ using QR factorization with arbitrary precision.
SuiteSplines.UnivariateSplines.table_required_points
— Methodtable_required_points(S, V)
Determine the number of exactness conditions in subsets of elements. The output is a matrix $\mathsf{A}$ where $\mathsf{A}_{ij}$ denotes the minimum number of points required in interval $i:j$ to perform exact weighted quadrature.
Examples:
julia> S = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,2,2,3]);
julia> V = SplineSpace(2, IncreasingVector([0.0,1.0,2.0,3.0]), [3,1,1,3]);
julia> A = UnivariateSplines.table_required_points(S, V)
3×3×1 Array{Int64, 3}:
[:, :, 1] =
3 5 7
2 5 0
3 0 0
SuiteSplines.UnivariateSplines.two_scale_operator
— Methodtwo_scale_operator(p::Degree, U::KnotVector{T}, q::Degree, V::KnotVector{T}) where {T<:Real}
The two_scale_operator
encodes the main logic for all spline refinemement operations.
The arguments p
and U
correspond to the current spline space and q
and V
are the "target" degree knot vector.
SuiteSplines.UnivariateSplines.unit_integral_rescaling
— Methodunit_integral_rescaling(p, U, i::Int)
unit_integral_rescaling(p, U)
Compute the scaling factors that normalize the B-spline basis functions to have unit integral.
SuiteSplines.UnivariateSplines.wquadweights!
— Methodwquadweights!(M, B, W, C)
Compute the quadrature weights in weighted quadrature such that M ≈ W' * B
.
SuiteSplines.UnivariateSplines.Bspline
— TypeBspline{T} <: ScalarMapping{1}
A univariate B-spline function of field T
.
SuiteSplines.UnivariateSplines.BsplineBasis
— TypeBsplineBasis{T<:Real} <: Basis{T,3}
Special array type for storing evaluating B-spline and their derivatives.
SuiteSplines.UnivariateSplines.BsplineEvaluationCache
— TypeBsplineEvaluationCache <: EvaluationCache{1}
Cache that caches basis function evaluation at a set of evaluation points.
SuiteSplines.UnivariateSplines.BsplineSupport
— TypeBsplineSupport(S::SplineSpace)
Iterator that outputs the supporting elements of each B-spline basis-function as a UnitRange{Int64}
.
Example:
julia> S = SplineSpace(2, [0.0,2.0,3.0], [3,1,3]);
julia> for α in BsplineSupport(S)
@show α
end
α = 1:1
α = 1:2
α = 1:2
α = 2:2
SuiteSplines.UnivariateSplines.GeneralizedGaussrule
— TypeGeneralizedGaussrule(p, r, nel, a, b)
Compute a generalized Gaussian quadrature rule for a target spline-space $\mathbb{S}^p_{r}(a,b)$ defined in a uniform partition with $n_{el}$ elements.
These rules are made available in the following paper
Hiemstra, René R., et al. "Optimal and reduced quadrature rules for tensor product and hierarchically refined splines in isogeometric analysis." Computer Methods in Applied Mechanics and Engineering 316 (2017): 966-1004.
SuiteSplines.UnivariateSplines.KnotSpanIndices
— TypeKnotSpanIndices
A sorted sequence of integers that refer to the corresponding non-zero knot span of a KnotVector
.
SuiteSplines.UnivariateSplines.KnotVector
— TypeKnotVector{T<:Real}
A knot-vector is a non-decreasing sequence of real numbers. (typeallias of NonDecreasingVector{T})
SuiteSplines.UnivariateSplines.SpanIndex
— TypeSpanIndex(S::SplineSpace)
Iterator that outputs the span index corresponding to each element in the partition
Example:
julia> S = SplineSpace(2, [0.0,1.0,2.0,3.0,4.0], [3,1,2,1,3]);
julia> for s in SpanIndex(S)
@show s
end
s = 3
s = 4
s = 6
s = 7
SuiteSplines.UnivariateSplines.SplineSpace
— TypeSplineSpace(p, U)
SplineSpace(p, x, m)
SplineSpace(p, Interval(a, b), num_elements)
Definition of a spline space by means of the polynomial degree $p$, a sequence of break-points $x$ and the knot-multiplicity $m$ or by prescribing the knot-vector $U$.
Examples:
julia> S = SplineSpace(2, [0.0,2.0,3.0], [3,1,3])
SplineSpace(degree = 2, interval = [0.0, 3.0], dimension = 4)
julia> dimsplinespace(S)
4
julia> Degree(S)
2
julia> KnotVector(S)
7-element NonDecreasingVector{Float64}:
0.0
0.0
0.0
2.0
3.0
3.0
3.0
SuiteSplines.UnivariateSplines.Support
— TypeBsplineSupport(S::SplineSpace)
Iterator that outputs the supporting elements of each B-spline basis-function as a UnitRange{Int64}
.
SuiteSplines.UnivariateSplines.WeightedQuadrule
— TypeWeightedQuadrule{T<:Real} <: AbstractQuadrule{1}
Weighted quadrature rules are test function specific quadrature rules that exactly integrate all functions in a targetspace. The rules are computed in high precision and are accurate up to 16 digits.
SuiteSplines.IgaBase.QuadratureRule
— MethodQuadratureRule(Q::TensorProduct{Dim,<:AbstractQuadrule{1}})
Generate a tensor product quadrature rule where the quadrature points are stored as a CartesianProduct and the weights as a KroneckerProduct vector allowing for easy evaluation and numerical integration based on Kronecker products.
SuiteSplines.TensorProductBsplines.TPEvaluationCache
— TypeTPEvaluationCache{Dim}
Type that caches spline basis functions as a KroneckerProduct{Dim}
and a grid of points as a CartesianProduct{Dim}
. The type is mutable such that the cached variables can be updated at runtime.
SuiteSplines.TensorProductBsplines.TensorProductBspline
— TypeTensorProductBspline{Dim,Ders,T}(space, coeffs)
TensorProductBspline{Dim,Ders,T}(space; codim=1)
Construct a Dim
dimensional TensorProductBspline
patch that is mapped to Codim
dimensional Euclidean space.
SuiteSplines.IgaFormation.QuadraturePoints
— MethodQuadraturePoints(acc::ElementAccessor{Dim}, element::Element{Dim}) where Dim
Get the quadrature points on this element.
SuiteSplines.IgaFormation.QuadraturePoints
— MethodQuadraturePoints(acc::PatchAccessor{Dim}) where Dim
Get the quadrature points on this element.
SuiteSplines.IgaFormation.QuadratureWeights
— MethodQuadratureWeights(acc::ElementAccessor{Dim}, element::Element{Dim}) where Dim
Get the quadrature weights on this element.
SuiteSplines.IgaFormation.QuadratureWeights
— MethodQuadratureWeights(acc::PatchAccessor{Dim}) where Dim
Get the quadrature weights on this element.
SuiteSplines.IgaFormation.TestFunctions
— MethodTestFunctions(acc::ElementAccessor{Dim}, element::Element{Dim}) where Dim
Get the test functions on an element as a KroneckerProduct matrix.
SuiteSplines.IgaFormation.TestFunctions
— MethodTestFunctions(acc::PatchAccessor{Dim}) where Dim
Get the test functions on the patch as a KroneckerProduct matrix.
SuiteSplines.IgaFormation.TestIndices
— MethodTestIndices(acc::PatchtAccessor)
Get global indices of the test functions.
SuiteSplines.IgaFormation.TestIndices
— MethodTestIndices(acc::ElementAccessor{Dim}, element::Element{Dim})
Get global indices of the test functions on an element.
SuiteSplines.IgaFormation.TrialFunctions
— MethodTrialFunctions(acc::ElementAccessor{Dim}, element::Element{Dim})
Get the trial functions on an element as a KroneckerProduct matrix.
SuiteSplines.IgaFormation.TrialFunctions
— MethodTrialFunctions(acc::PatchAccessor)
Get the trial functions on the patch as a KroneckerProduct matrix.
SuiteSplines.IgaFormation.TrialIndices
— MethodTrialIndices(acc::PatchAccessor)
Get global indices of the trial functions.
SuiteSplines.IgaFormation.TrialIndices
— MethodTrialIndices(acc::ElementAccessor{Dim}, element::Element{Dim})
Get global indices of the trial functions on an element.
SuiteSplines.IgaFormation.coface
— Methodcoface(element::Element)
If element
is on the boundary then element.parent
is a view and this function returns its single co-face.
SuiteSplines.IgaFormation.pre_allocate_arrays
— Methodpre_allocate_arrays(T, nquad::NTuple{3,Int}, m::NTuple{3,Int}, n::NTuple{3,Int})
Preallocate arrays of element type==T for use in sum factorization of matrices.
SuiteSplines.IgaFormation.pre_allocate_arrays
— Methodpre_allocate_arrays(T, nquad::NTuple{3,Int}, m::NTuple{3,Int})
Preallocate arrays of element type==T for use in sum factorization of vectors.
SuiteSplines.IgaFormation.pre_allocate_arrays
— Methodpre_allocate_arrays(T, nquad::NTuple{2,Int}, m::NTuple{2,Int}, n::NTuple{2,Int})
Preallocate arrays of element type==T for use in sum factorization of matrices.
SuiteSplines.IgaFormation.pre_allocate_arrays
— Methodpre_allocate_arrays(T, nquad::NTuple{2,Int}, m::NTuple{2,Int})
Preallocate arrays of element type==T for use in sum factorization of vectors.
SuiteSplines.IgaFormation.sumfact!
— Methodsumfact!(A::Tuple{<:Array,<:Array,<:Array}, C, testfuns)
Apply sum factorization. A
and B
are allocated using pre_allocate_arrays(...)
. testfuns
and trialfuns
are tuples of arrays that represent the test and trial functions evaluated at the quadrature nodes. It is assumed that the quadrature weights have been incorporated into the test functions.
SuiteSplines.IgaFormation.sumfact!
— Methodsumfact!(A::Tuple{<:Array,<:Array,<:Array}, B, C, testfuns, trialfuns)
Apply sum factorization. A
and B
are allocated using pre_allocate_arrays(...)
. testfuns
and trialfuns
are tuples of arrays that represent the test and trial functions evaluated at the quadrature nodes. It is assumed that the quadrature weights have been incorporated into the test functions
SuiteSplines.IgaFormation.sumfact!
— Methodsumfact!(A::Tuple{<:Array,<:Array}, C, testfuns)
Apply sum factorization. A
is pre-allocated using pre_allocate_rhs_arrays(...)
. testfuns
is a tuple of matrices that represent the test functions evaluated at the quadrature nodes. It is assumed that the quadrature weights have been incorporated into the test functions.
SuiteSplines.IgaFormation.sumfact!
— Methodsumfact!(A::Tuple{<:Array,<:Array}, B, C, testfuns, trialfuns)
Apply sum factorization. A
and B
are allocated using pre_allocate_arrays(...)
. testfuns
and trialfuns
are tuples of arays that represent the test and trial functions evaluated at the quadrature nodes. It is assumed that the quadrature weights have been incorporated into the test functions.
SuiteSplines.IgaBase.QuadratureRule
— MethodQuadratureRule(acc::ElementAccessor{Dim}, element::Element{Dim}) where Dim
Get the quadrature rule on this element.
SuiteSplines.IgaBase.QuadratureRule
— MethodQuadratureRule(acc::PatchAccessor{Dim}) where Dim
Get the quadrature rule on the patch.
SuiteSplines.IgaFormation.Element
— TypeElement{Dim, T}
Dim-dimensional element storing its domain of definition as a Cartesian{Dim, Interval{T}}
and its element number as a CartesianIndex{Dim}
SuiteSplines.IgaFormation.ElementAccessor
— TypeElementAccessor{Dim, X<:IncreasingSequence, Data}
Datastructure that provides access to element data such as the element domain, element trialfunctions, element testfunctions and element quadrature rule.
SuiteSplines.IgaFormation.Elements
— TypeElements(partition::CartesianProduct{Dim, <:IncreasingSequence{<:Real}})
Return an iterator over all elements in a partition.
SuiteSplines.IgaFormation.PatchAccessor
— TypePatchAccessor{Dim, X, ..., Data}
Datastructure that provides access to element data such as the element domain, element trialfunctions, element testfunctions and element quadrature rule.
SuiteSplines.IgaFormation.UnivariatePatchData
— TypeUnivariatePatchData{T<:Real, Q<:AbstractQuadrule{1}}
Datastructure that stores all the univariate patch data. This data is conveniently accessed by an element accessor.
SuiteSplines.ImmersedSplines.active_splines
— Methodactive_splines(U::TensorProduct{2, <:SplineSpace}, E::Array)
Determine the active B-splines and boundary B-splines given a distance function ϕ.
A[k] == 0 => no physical elements in support of the function A[k] == 1 => boundary function with a physical cut element in its support A[k] == 2 => at least one physical element is fully inside support A[k] == 3 => all physical elements are fully inside support
SuiteSplines.ImmersedSplines.active_splines
— Methodactive_splines(U::TensorProduct{Dim, <:SplineSpace}, E::Array)
Determine the active B-splines and boundary B-splines given a distance function ϕ.
A[k] == 0 => no physical elements in support of the function A[k] == 1 => boundary function with a physical cut element in its support A[k] == 2 => at least one physical element is fully inside support A[k] == 3 => all physical elements are fully inside support
SuiteSplines.ImmersedSplines.active_splines
— Methodactive_splines(U::TensorProduct{2, <:SplineSpace}, E::Array)
Determine the active B-splines and boundary B-splines given a distance function ϕ.
A[k] == 0 => no physical elements in support of the function A[k] == 1 => boundary function with a physical cut element in its support A[k] == 2 => at least one physical element is fully inside support A[k] == 3 => all physical elements are fully inside support
SuiteSplines.ImmersedSplines.compute_extension_coefficients
— Methodcompute_extension_coefficients(p, kts, span, k)
Compute the extension coefficients using dual functionals. This works for general non-uniform knot vectors and is based on the paper [Höllig, Klaus, and Ulrich Reif. "Nonuniform web-splines." Computer Aided Geometric Design 20, no. 5 (2003): 277-294.]
SuiteSplines.ImmersedSplines.element_is_inside
— Methodelementisinside(Y::Matrix{Bool})
Return a boolean array that specifies whether an element is inside or outside, respectively
SuiteSplines.ImmersedSplines.find_extension_indices
— Methodfind_extension_indices(active_functions, gperm, mi)
Find the extension indices that are closest
to the boundary function with CartesianIndex mi.
SuiteSplines.ImmersedSplines.find_first_active_element
— Methodfind_extension_indices(active_functions, gperm, mi)
Find the extension indices that are closest
to the boundary function with CartesianIndex mi.
SuiteSplines.ImmersedSplines.point_is_inside
— Methodpointisinside(phi, partition::CartesianProduct)
Return a boolean array that specifies whether a point is inside or outside, respectively
SuiteSplines.ImmersedSplines.spline_extension_operator
— Methodspline_extension_operator(U::TensorProduct{2, <:SplineSpace}, F)
Compute an extension operator that stabilizes the splinespace according to the definition of [Höllig, Klaus, Ulrich Reif, and Joachim Wipper. "Weighted extended B-spline approximation of Dirichlet problems." SIAM Journal on Numerical Analysis 39, no. 2 (2001): 442-462.]
SuiteSplines.ImmersedSplines.ClosestExtensionArray
— TypeClosestExtensionArray(F, U::TensorProduct{Dim,<:SplineSpace})
Defines a closest
index array, according to the definition of [Höllig, Klaus, Ulrich Reif, and Joachim Wipper. "Weighted extended B-spline approximation of Dirichlet problems." SIAM Journal on Numerical Analysis 39, no. 2 (2001): 442-462.]
SuiteSplines.ImmersedSplines.ClosestExtensionArray
— MethodClosestExtensionArray(F, U::TensorProduct{Dim,<:SplineSpace})
Computes a closest
index array, according to the definition of [Höllig, Klaus, Ulrich Reif, and Joachim Wipper. "Weighted extended B-spline approximation of Dirichlet problems." SIAM Journal on Numerical Analysis 39, no. 2 (2001): 442-462.]
SuiteSplines.ImmersedSplines.GeneratePerimeter
— TypeGeneratePerimeter{Dim,Indices}
Datastructure that allows iteration over active neighborhoods of boundary functions
SuiteSplines.ImmersedSplines.IPerm
— TypeIPerm{Dim,Indices}
Iterator that returns active neighborhoods around a B-spline.
SuiteSplines.ImmersedSplines.ImmersedQuadRule
— TypeImmersedQuadRule(map::AlgoimMapping, xa::Real, ya::Real, xb::Real, yb::Real, qo::Int64)
Compute a algoim quadrature rule in bounding box [xa, ya] × [xb, yb] based on a Gauss-Legendre rule of qo
points.