Experimental interface

This package implements interfaces that may eventually be integrated into the IgaBase.jl package.

SpecialSpaces.jl

The core function spaces in SuiteSplines are SplineSpace and tensor-products thereof.

SpecialSpaces.jl introduces convenient interfaces for handling spaces used to represent scalar-, vector- and mixed-valued fields and geometric mappings.

Note on higher dimensions

Almost everything described on this page generalizes to higher dimensions, e.g.

julia> Ω = Interval(0.0, 2.0) ⨱ Interval(0.0, 4.0) ⨱ Interval(-1.0, 1.0)2×2×2 SuiteSplines.CartesianProducts.CartesianProduct{3, Tuple{Float64, Float64, Float64}, Tuple{SuiteSplines.SortedSequences.Interval{Float64}, SuiteSplines.SortedSequences.Interval{Float64}, SuiteSplines.SortedSequences.Interval{Float64}}}:
[:, :, 1] =
 (0.0, 0.0, -1.0)  (0.0, 4.0, -1.0)
 (2.0, 0.0, -1.0)  (2.0, 4.0, -1.0)

[:, :, 2] =
 (0.0, 0.0, 1.0)  (0.0, 4.0, 1.0)
 (2.0, 0.0, 1.0)  (2.0, 4.0, 1.0)
julia> Δ = Partition(Ω, (3, 5, 7));
julia> S = ScalarSplineSpace(4, Δ)SuiteSplines.CartesianProducts.TensorProduct{3, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 4, interval = [0.0, 2.0], dimension = 6), SplineSpace(degree = 4, interval = [0.0, 4.0], dimension = 8), SplineSpace(degree = 4, interval = [-1.0, 1.0], dimension = 10)))

The only exception are the Raviart-Thomas and Taylor-Hood spaces, which are implemented only in two and three dimensions.

Domains and partitions

All spline spaces are defined on a Partition of some Domain. A Cartesian product domain in two dimensions may be defined as a Cartesian product of intervals,

julia> Ω = Interval(0.0, 2.0) ⨱ Interval(0.0, 4.0)2×2 SuiteSplines.CartesianProducts.CartesianProduct{2, Tuple{Float64, Float64}, Tuple{SuiteSplines.SortedSequences.Interval{Float64}, SuiteSplines.SortedSequences.Interval{Float64}}}:
 (0.0, 0.0)  (0.0, 4.0)
 (2.0, 0.0)  (2.0, 4.0)

A partition of the domain Ω is just another Cartesian product of a strictly increasing real numbers on the intervals defining each domain dimension. To generate an uniform partition we can use IncreasingRange,

julia> Δ = IncreasingRange(Ω.data[1]..., 3) ⨱ IncreasingRange(Ω.data[2], 5)3×5 SuiteSplines.CartesianProducts.CartesianProduct{2, Tuple{Float64, Float64}, Tuple{SuiteSplines.SortedSequences.IncreasingRange{Float64}, SuiteSplines.SortedSequences.IncreasingRange{Float64}}}:
 (0.0, 0.0)  (0.0, 1.0)  (0.0, 2.0)  (0.0, 3.0)  (0.0, 4.0)
 (1.0, 0.0)  (1.0, 1.0)  (1.0, 2.0)  (1.0, 3.0)  (1.0, 4.0)
 (2.0, 0.0)  (2.0, 1.0)  (2.0, 2.0)  (2.0, 3.0)  (2.0, 4.0)

Less explicitly, we can also call

julia> Δ = Partition(Ω, (3, 5))3×5 SuiteSplines.CartesianProducts.CartesianProduct{2, Tuple{Float64, Float64}, Tuple{SuiteSplines.SortedSequences.IncreasingRange{Float64}, SuiteSplines.SortedSequences.IncreasingRange{Float64}}}:
 (0.0, 0.0)  (0.0, 1.0)  (0.0, 2.0)  (0.0, 3.0)  (0.0, 4.0)
 (1.0, 0.0)  (1.0, 1.0)  (1.0, 2.0)  (1.0, 3.0)  (1.0, 4.0)
 (2.0, 0.0)  (2.0, 1.0)  (2.0, 2.0)  (2.0, 3.0)  (2.0, 4.0)

which gives us a Cartesian product partition with 3 breakpoints in the first and 5 breakpoints the second dimension.

Scalar spline spaces

Given a partition, a tensor-product ScalarSplineSpace of degree 2 can be constructed by calling

julia> S = ScalarSplineSpace(2, Δ)SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 4), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))

This is equivalent to

julia> SplineSpace(2, Δ.data[1]) ⨷ SplineSpace(2, Δ.data[2])SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 4), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))

In fact, ScalarSplineSpace is just a type alias for a tensor-product of univariate spline spaces. The dimension of the tensor-product was inferred from the dimension of the provided partition. SpecialSpaces.jl implements a few more handy constructors for tensor-product spline spaces, e.g. with different degrees in each dimension.

Conveniently, we can obtain the dimension and linear indices of the tensor-product space by

julia> linds = indices(S)1:24
julia> dim = dimension(S)24

Linear indices are useful when handling solution vectors, fields and geometric mappings on more complex spaces. These spaces follow next.

Vector spline spaces

A tensor-product VectorSplineSpace can be constructed from multiple scalar spline spaces,

julia> V = VectorSplineSpace(S, S, S)SuiteSplines.SpecialSpaces.VectorSplineSpace{2, 3, Float64} with 3 components

The requirement here is that the scalar spaces are defined on the same partition.

To access the scalar space corresponding to the kth component of a vector space, we can index into the collection,

julia> V[1]SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 4), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))
julia> V[1] == V[2] == V[3]true

Note that in this example the domain dimension is two and the codomain dimension is three. More commonly, the dimension and codimension coincide and a vector space of degree 2 can be defined directly as

julia> V = VectorSplineSpace(2, Δ)SuiteSplines.SpecialSpaces.VectorSplineSpace{2, 2, Float64} with 2 components

The linear indices for each component are

julia> for k in 1:2
           @show indices(V, k)
       endindices(V, k) = 1:24
indices(V, k) = 25:48

Note here the subtlety of calling indices(V, k) instead of indices(V[k]). The element type of V is

julia> eltype(V)SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}

Thus an expression like the one below will call the indices method for a scalar spline space,

julia> indices.(V)2-element Vector{UnitRange{Int64}}:
 1:24
 1:24

This does not give the desired result. The following expression on the other hand does,

julia> indices.(Ref(V), 1:2)2-element Vector{UnitRange{Int64}}:
 1:24
 25:48

As expected, the complete range of linear indices for a vector space is

julia> indices(V)1:48

Mixed spline spaces

Mixed spline function spaces are defined as custom structs subtyping MixedSplineSpace, where each struct field corresponds to a scalar or vector spline space.

A basic definition of a custom mixed spline space might look like the following:

struct TaylorHood{Dim,T} <: MixedSplineSpace{Dim,T}
    V::VectorSplineSpace{Dim,Dim,T}
    Q::ScalarSplineSpace{Dim,T}
    
    function TaylorHood(p::Degree, Δ::Partition{Dim,T}) where {Dim,T<:Real}
        @assert p ≥ 2
        p = ntuple(i -> p, Dim)
        V = VectorSplineSpace(ntuple(i -> ScalarSplineSpace(p, Δ), Dim)...)
        Q = ScalarSplineSpace(p .- 1, Δ)
        new{Dim,T}(V, Q)
    end
end

SpecialSpaces.jl implements interfaces that allow us to operate on such spaces.

Taylor–Hood

One implemented example of a mixed spline space is the TaylorHood space, which defines an inf-sub stable pair of spaces for velocities and pressure.

julia> th = TaylorHood(2, Δ)SuiteSplines.SpecialSpaces.TaylorHood{2, 3, Float64} with fields (:V, :Q)
julia> dimension(th)63
julia> dimension(th, :Q)15
julia> dimension(th, :V)48
julia> dimension(th, :V, 1)24
julia> dimension(th, :V, 2)24
julia> indices(th, :Q)49:63
julia> indices(th, :V)1:48
julia> indices(th, :V, 1)1:24
julia> indices(th, :V, 2)25:48

Raviart–Thomas

Another implemented example of a mixed spline space is the RaviartThomas space, which constructs a structure preserving (divergence conforming) pair of spline spaces for velocities and pressure.

julia> rt = RaviartThomas(2, Δ)SuiteSplines.SpecialSpaces.RaviartThomas{2, 3, Float64} with fields (:V, :Q)
julia> dimension(rt)53
julia> dimension(rt, :Q)15
julia> dimension(rt, :V)38
julia> dimension(rt, :V, 1)20
julia> dimension(rt, :V, 2)18
julia> indices(rt, :Q)39:53
julia> indices(rt, :V)1:38
julia> indices(rt, :V, 1)1:20
julia> indices(rt, :V, 2)21:38

Both examples are implemented for dimensions two and three and arbitrary degrees.

Iterable mixed spline space

If a custom struct defining a mixed spline space is not desired, SpecialSpaces.jl implements an iterable mixed spline space for general use. IterableMixedSplineSpace can be constructed from a named tuple of scalar and vector spline spaces.

julia> V = VectorSplineSpace(2, Δ)SuiteSplines.SpecialSpaces.VectorSplineSpace{2, 2, Float64} with 2 components
julia> Q = ScalarSplineSpace(1, Δ)SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 1, interval = [0.0, 2.0], dimension = 3), SplineSpace(degree = 1, interval = [0.0, 4.0], dimension = 5)))
julia> ith = IterableMixedSplineSpace((V=V, Q=Q))SuiteSplines.SpecialSpaces.IterableMixedSplineSpace{2, 3, Float64} with fields (:V, :Q)
julia> dimension(ith, :Q)15
julia> dimension(ith, :V)48

The example above reproduces the Taylor–Hood mixed spline space.

In addition to the usual interface for mixed spaces, it is also possible to iterate over the spaces collected in the iterable mixed spline space,

julia> map(dimension, ith)2-element Vector{Int64}:
 48
 15

Mappings

SpecialSpaces.jl implements convenient constructors for fields and geometric mappings defined on special spaces introduced above. For example,

julia> ϕʰ = GeometricMapping(Ω, S);
julia> t = Field(V);
julia> uʰ = GeometricMapping(Ω, rt, :V);
julia> pʰ = GeometricMapping(Ω, rt, :Q);

Now, given a solution vector x from some computation with the Raviart–Thomas space, we can set the coefficients of the geometric mappings and as follows

julia> x = rand(dimension(rt));
julia> setcoeffs!(uʰ, rt, :V, x);
julia> setcoeffs!(pʰ, rt, :Q, x);

We can also obtain vertically concatenated coefficients of fields and geometric mappings,

julia> getcoeffs(uʰ) == x[indices(rt, :V)]true
julia> getcoeffs(pʰ) == x[indices(rt, :Q)]true

The interface for scalar and vector spaces is identical but without the field symbol.

Constraints

Recall that space constraints on univariate SplineSpace are enforced by extraction operators,

julia> space = SplineSpace(4, IncreasingRange(0.0, π, 5); cleft=[1,2])SplineSpace(degree = 4, interval = [0.0, 3.141592653589793], dimension = 6)
julia> space.C # extraction operator8×6 SparseArrays.SparseMatrixCSC{Float64, Int64} with 6 stored entries: ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ ⋅ ⋅ 1.0

Naturally, space constraints on tensor-product spaces can be enforced by Kronecker product extraction operators. To avoid tedious work on the level of univariate spline spaces, i.e. defining univariate spline spaces with the arguments cleft, cright, cperiodic, SpecialSpaces.jl implements containers for collecting constraints on scalar, vector and mixed spline spaces. Upon passing these collections to respective space constructors, the contraints are distributed down to the univariate spaces.

Scalar spline space constraints

On the lowest abstraction level, there are three rather self-explanatory methods:

These methods operate on scalar constraint containers and push constraint conditions for a univariate spline space in dimension dim to the container.

The following is equivalent to setting cleft=[1] argument on the spline space in the first dimension of the tensor-product space.

julia> C = ScalarSplineSpaceConstraints{2}()SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints{2, Int8}
julia> left_constraint!(C; dim=1) # or left_constraint!(S; c=[1,], dim=1)SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints{2, Int8}

This constraint container with dimension two can be then applied while constructing a tensor-product space of dimension two. Let us reuse the existing scalar spline space S and construct a scalar spline space with constraint conditions defined in C

julia> SSuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 4), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))
julia> S[1].C4×4 SparseArrays.SparseMatrixCSC{Float64, Int64} with 4 stored entries: 1.0 ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ ⋅ 1.0
julia> S = ScalarSplineSpace(S, C)SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 3), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))
julia> S[1].C4×3 SparseArrays.SparseMatrixCSC{Float64, Int64} with 3 stored entries: ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ 1.0 ⋅ ⋅ ⋅ 1.0

Vector spline space constraints

Existing spaces can be used to construct suitable (empty) constraint containers. For example, to construct a constraints container for the vector spline space V we can write

julia> C = VectorSplineSpaceConstraints(V)SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints{2, 2, Int8}

VectorSplineSpaceConstraints is just a collection of ScalarSplineSpaceConstraints so that left_constraint!, right_constraint! and periodic_constraint! can be applied to each element of this container.

julia> left_constraint!(C[1]; dim=1)SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints{2, Int8}
julia> V[1]SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 4), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))
julia> V = VectorSplineSpace(V, C);
julia> V[1]SuiteSplines.CartesianProducts.TensorProduct{2, SuiteSplines.UnivariateSplines.SplineSpace{Float64}}((SplineSpace(degree = 2, interval = [0.0, 2.0], dimension = 3), SplineSpace(degree = 2, interval = [0.0, 4.0], dimension = 6)))

Mixed spline space constraints

MixedSplineSpaceConstraints is just a type alias for a named tuple.

julia> C = MixedSplineSpaceConstraints((V=VectorSplineSpaceConstraints(rt.V), Q=ScalarSplineSpaceConstraints(rt.Q)))(V = SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints{2, 2, Int8}, Q = SuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints{2, Int8})
julia> C.VSuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints{2, 2, Int8}
julia> C.QSuiteSplines.SpecialSpaces.ScalarSplineSpaceConstraints{2, Int8}

Clamped constraints

For convenience, SuiteSplines.jl provides clamped_constraint! for scalar and vector spline spaces which can be set on edges/faces of the domain. For example,

julia> C = VectorSplineSpaceConstraints(V)SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints{2, 2, Int8}
julia> clamped_constraint!(C, :top)

This is equivalent to setting left_constraint! with the arguments (c=[1], dim=2) in each dimension of the vector space. It is also possible to clamp multiple edges in a subset of dimensions,

julia> C = VectorSplineSpaceConstraints{3}()SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraints{3, 3, Int8}
julia> clamped_constraint!(C, :left, :right, :bottom, :top, :back, :front; dim=[1,3])

In this case, the scalar spline spaces in dimensions 1 and 3 are clamped on the whole boundary of the domain. No constraints are applied in dimension 2.

Clamping for scalar spline spaces works the same way. Valid boundary labels are: :left, :right, :bottom, :top, :back, :front, where the last two are only valid in three dimensions.

Numbering and labeling boundaries on Cartesian grids

SuiteSplines follows a simple convention for numbering boundaries of Cartesian product domains: boundaries are numbered dimension by dimension by assigning ever increasing integers first to the beginning then to the end of the interval in a particular dimension. The labels :left → :right, :bottom → :top, :back → :front are directed always in the direction of the axes. See boundary_number for more details.

Extraction operators

To obtain the Kronecker product extraction operator of a scalar spline space use

julia> extraction_operator(S)24×18 SuiteSplines.KroneckerProducts.KroneckerProduct{Float64, 2, 2, Tuple{SparseArrays.SparseMatrixCSC{Float64, Int64}, SparseArrays.SparseMatrixCSC{Float64, Int64}}}:
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0  …  0.0  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.0     0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0     0.0  0.0  0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0     0.0  0.0  0.0  0.0  0.0  0.0  0.0
 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.0  0.0
 ⋮                        ⋮              ⋱                      ⋮
 0.0  0.0  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.0  0.0  0.0  0.0  0.0  0.0  0.0  0.0     0.0  0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0  0.0  0.0  …  0.0  0.0  0.0  0.0  0.0  0.0  0.0
 0.0  0.0  0.0  0.0  0.0  0.0  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.0  0.0  0.0  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.0  0.0  0.0     0.0  0.0  0.0  0.0  0.0  0.0  1.0
julia> extraction_operator(S; sparse=true)24×18 SparseArrays.SparseMatrixCSC{Float64, Int64} with 18 stored entries: ⎡⠢⡀⠀⠀⠀⠀⠀⠀⠀⎤ ⎢⠀⠐⢄⠀⠀⠀⠀⠀⠀⎥ ⎢⠀⠀⠀⠢⡀⠀⠀⠀⠀⎥ ⎢⠀⠀⠀⠀⠐⢄⠀⠀⠀⎥ ⎢⠀⠀⠀⠀⠀⠀⠢⡀⠀⎥ ⎣⠀⠀⠀⠀⠀⠀⠀⠐⢄⎦

The parameter sparse can be used if we wish to obtain the Kronecker product extraction operator as a sparse matrix.

To obtain the Kronecker product extraction operator of a vector spline space use

julia> extraction_operator.(V)2-element Vector{SuiteSplines.KroneckerProducts.KroneckerProduct{Float64, 2, 2, Tuple{SparseArrays.SparseMatrixCSC{Float64, Int64}, SparseArrays.SparseMatrixCSC{Float64, Int64}}}}:
 [0.0 0.0 … 0.0 0.0; 1.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 1.0 0.0; 0.0 0.0 … 0.0 1.0]
 [1.0 0.0 … 0.0 0.0; 0.0 1.0 … 0.0 0.0; … ; 0.0 0.0 … 1.0 0.0; 0.0 0.0 … 0.0 1.0]
julia> extraction_operator.(V; sparse=true)2-element Vector{SparseArrays.SparseMatrixCSC{Float64, Int64}}: sparse([2, 3, 4, 6, 7, 8, 10, 11, 12, 14, 15, 16, 18, 19, 20, 22, 23, 24], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 24, 18) sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 … 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 24, 24)

or

julia> extraction_operators(V)([0.0 0.0 … 0.0 0.0; 1.0 0.0 … 0.0 0.0; … ; 0.0 0.0 … 1.0 0.0; 0.0 0.0 … 0.0 1.0], [1.0 0.0 … 0.0 0.0; 0.0 1.0 … 0.0 0.0; … ; 0.0 0.0 … 1.0 0.0; 0.0 0.0 … 0.0 1.0])
julia> extraction_operators(V; sparse=true)(sparse([2, 3, 4, 6, 7, 8, 10, 11, 12, 14, 15, 16, 18, 19, 20, 22, 23, 24], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 24, 18), sparse([1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [1, 2, 3, 4, 5, 6, 7, 8, 9, 10 … 15, 16, 17, 18, 19, 20, 21, 22, 23, 24], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 … 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0], 24, 24))

Note, that the extraction operator is not stored in the constraints containers!

API

Base.getindexMethod
Base.getindex(V::S, i::Int64) where {S<:VectorFunctionSpace}

Return ith vector function space component.

source
Base.iterateMethod
Base.iterate(V::S) where {S<:VectorFunctionSpace} = iterate(parent(V))
Base.iterate(V::S, i::Int) where {S<:VectorFunctionSpace} = iterate(parent(V), i)

Iterate over vector function space components.

source
Base.lengthMethod
Base.length(V::S) where {S<:VectorFunctionSpace}

Return the number of vector function space components.

source
Base.lengthMethod
Base.length(C::ScalarSplineSpaceConstraints{Dim}) where {Dim}

Return number of dimensions Dim.

source
Base.lengthMethod
Base.length(C::VectorSplineSpaceConstraints{<:Any,Codim}) where {Codim}

Return number of dimensions Dim.

source
SuiteSplines.IgaBase.dimensionMethod
IgaBase.dimension(V::T, field::Symbol, i::Int64) where {T<:MixedFunctionSpace}

Return the dimension of the ith component of a vector function space field in a mixed space V.

source
SuiteSplines.IgaBase.dimensionMethod
IgaBase.dimension(V::T, field::Symbol) where {T<:MixedFunctionSpace}

Return the dimension of a scalar function space field in a mixed space V.

source
SuiteSplines.SpecialSpaces.boundary_numberMethod
boundary_number(s::Symbol)

Return the boundary number corresponding to boundary s.

                                               5
                            4                 back
                           top                  . . . . . . .
                     . . . . . . . .            . .         . .
η                    .             .            .   .       .   .
.                    .             .            .     . . . . . . .
.             left   .             .  right     .     .     .     .
.               1    .             .    2       .     .     .     .
· · · ·  ξ           .             .            . . . . . . .     .
  ·                  . . . . . . . .              .   .       .   .
    ·                    bottom                     . .         . .
      ζ                     3                         . . . . . . .
                                                                 front
                                                                   6
source
SuiteSplines.SpecialSpaces.clamped_constraint!Method
clamped_constraint!(C::ScalarSplineSpaceConstraints, side::Vararg{Symbol,N}) where {N}

Clamp a scalar spline space at side, where side is one of the boundary labels:

  • :left
  • :right
  • :bottom
  • :top
  • :back
  • :front
source
SuiteSplines.SpecialSpaces.clamped_constraint!Method
clamped_constraint!(C::VectorSplineSpaceConstraints{Dim}, side::Vararg{Symbol,N}; dim=1:Dim) where {Dim,N}

Clamp a vector spline space in dimensions dim at side, where side is one of the boundary labels:

  • :left
  • :right
  • :bottom
  • :top
  • :back
  • :front
source
SuiteSplines.SpecialSpaces.dimensionsMethod
dimensions(V::T, i::Int64) where {T<:VectorFunctionSpace}

Return the dimension in each tensor-product direction of the ith component of a vector function space as a tuple.

source
SuiteSplines.SpecialSpaces.dimensionsMethod
dimensions(V::T, field::Symbol, i::Int64) where {T<:MixedFunctionSpace}

Return the dimension in each tensor-product direction of the ith component of a vector function space field in the mixed space V as a tuple.

source
SuiteSplines.SpecialSpaces.dimensionsMethod
dimensions(V::T, field::Symbol, i::Int64) where {T<:MixedFunctionSpace}

Return the dimension in each tensor-product direction of the vector function space field in the mixed space V as a tuple.

source
SuiteSplines.SpecialSpaces.extraction_operatorMethod
extraction_operator(S::T, field::Symbol; sparse::Bool=false) where {T<:MixedFunctionSpace}

Return the extraction operator for a scalar function space field in mixed function space S.

If sparse is true, return a sparse matrix.

source
SuiteSplines.SpecialSpaces.extraction_operatorsMethod
extraction_operators(S::T, field::Symbol; sparse::Bool=false) where {T<:MixedFunctionSpace}

Return the extraction operators for a vector function space field in mixed function space S in a tuple.

If sparse is true, return a tuple of sparse matrices.

source
SuiteSplines.SpecialSpaces.indicesMethod
indices(space::S, field::Symbol, i::Int) where {S<:MixedFunctionSpace}

Return linear indices for ith component of a vector function space field in mixed function space space.

source
SuiteSplines.SpecialSpaces.setcoeffs!Method
setcoeffs!(f::M, v::Vector{T}, k::Int=1, slice::Base.UnitRange{Int}=Base.UnitRange(1,length(v))) where {M<:AbstractMapping,T<:Real}

Set coefficients of a mapping component to a slice of coefficients in a vector.

Arguments:

  • f: mapping in question
  • v: vector with coeffs
  • slice: range of indices of vector v
  • k: component of field f
source
SuiteSplines.SpecialSpaces.setcoeffs!Method
setcoeffs!(f::M, mixedspace::S, field::Symbol, v::Vector{T}) where {M<:AbstractMapping,S<:MixedSplineSpace,T<:Real}

Set coefficients of a mapping defined on a mixedspace.

Arguments:

  • f: mapping in question
  • mixedspace: space
  • field: space field
  • v: vector with coeffs with length dim(mixedspace)
source
SuiteSplines.SpecialSpaces.setcoeffs!Method
setcoeffs!(f::M, scalarspace::S, v::Vector{T}) where {M<:AbstractMapping,S<:ScalarSplineSpace,T<:Real}

Set coefficients of a mapping defined on a scalar space.

Arguments:

  • f: mapping in question
  • scalarspace: space
  • v: vector with coeffs with length dim(scalarspace)
source
SuiteSplines.SpecialSpaces.setcoeffs!Method
setcoeffs!(f::M, vectorspace::S, v::Vector{T}) where {M<:AbstractMapping,S<:VectorSplineSpace,T<:Real}

Set coefficients of a mapping defined on a vector space.

Arguments:

  • f: mapping in question
  • vectorspace: space
  • v: vector with coeffs with length dim(vectorspace)
source
SuiteSplines.AbstractMappings.FieldMethod
Field(space::S) where {S<:ScalarSplineSpace}
Field(space::S) where {S<:VectorSplineSpace}
Field(space::S, s::Symbol) where {S<:MixedSplineSpace}

Construct field on some spline spaces.

source
SuiteSplines.AbstractMappings.GeometricMappingMethod
AbstractMappings.GeometricMapping(domain, args::ScalarScalarSpace; orientation::Int=1)
AbstractMappings.GeometricMapping(domain, args::VectorSplineSpace; orientation::Int=1)
AbstractMappings.GeometricMapping(domain, args::MixedSplineSpace, field::Symbol; orientation::Int=1)

Construct geometric mapping on some spline spaces.

source
SuiteSplines.SpecialSpaces.FunctionSpaceType
abstract type FunctionSpace{Dim,Codim,T}

Concrete function spaces subtype this.

Parameters

  • Dim: dimension of the domain
  • Codim: dimension of the codomain
  • T: data type used for numbers (returned by IgaBase.numbertype)
source
SuiteSplines.SpecialSpaces.IterableMixedSplineSpaceType
struct IterableMixedSplineSpace{Dim,Codim,T} <: MixedSplineSpace{Dim,Codim,T}

A general purpose mixed spline space, which can be constructed from a named tuple consisting of scalar and vector spline spaces. Besides the usual interface to mixed function spaces, it additionally supports iteration over the collection of spaces.

The supplied spaces must have the same domain dimension, partition and number type.

source
SuiteSplines.SpecialSpaces.RaviartThomasMethod
RaviartThomas(p::Degree, Δ::Partition{Dim,T}) where {Dim,T<:Real}
RaviartThomas(p::Degree, Δ::Partition{2,T}, C::MixedSplineSpaceConstraints{(:V,:Q)})
RaviartThomas(p::Degree, Δ::Partition{3,T}, C::MixedSplineSpaceConstraints{(:V,:Q)}) where {T<:Real}

Construct a RaviartThomas mixed spline space.

source
SuiteSplines.SpecialSpaces.ScalarSplineSpaceMethod
ScalarSplineSpace(S::ScalarSplineSpace{Dim,T}) where {Dim,T<:Real}
ScalarSplineSpace(p::Degree, partition::Partition{Dim,T}) where {Dim,T<:Real}
ScalarSplineSpace(degrees::NTuple{Dim,Degree}, partition::Partition{Dim,T}) where {Dim,T<:Real}
ScalarSplineSpace(degrees::NTuple{Dim,Degree}, partition::Partition{Dim,T}, C::ScalarSplineSpaceConstraints{Dim}) where {Dim,T<:Real}
ScalarSplineSpace(S::ScalarSplineSpace{Dim,T}, C::ScalarSplineSpaceConstraints{Dim}) where {Dim,T<:Real}

Construct a ScalarSplineSpace.

If constructed from another ScalarSplineSpace, discard constraint conditions.

source
SuiteSplines.SpecialSpaces.VectorSplineSpaceMethod
VectorSplineSpace(degree::Degree, partition::Partition{Dim,T}) where {Dim,T<:Real}
VectorSplineSpace(degrees::NTuple{Dim,Degree}, partition::Partition{Dim,T}) where {Dim,T<:Real}
VectorSplineSpace(V::VectorSplineSpace{Dim,Codim,T}, C::VectorSplineSpaceConstraints{Dim,Codim}) where {Dim,Codim,T<:Real}
VectorSplineSpace(S::ScalarSplineSpace{Dim,T}) where {Dim,T<:Real}
VectorSplineSpace(V::NTuple{Codim,ScalarSplineSpace{Dim,T}}) where {Dim,Codim,T}
VectorSplineSpace(V::Vararg{ScalarSplineSpace{Dim,T},Codim}) where {Dim,Codim,T}

Construct a VectorSplineSpace.

Constraints on scalar spline space arguments are preserved.

source
SuiteSplines.SpecialSpaces.VectorSplineSpaceConstraintsMethod
VectorSplineSpaceConstraints{Dim}() where {Dim}
VectorSplineSpaceConstraints{Dim,Codim}() where {Dim,Codim}
VectorSplineSpaceConstraints(args::Vararg{ScalarSplineSpaceConstraints{Dim},Codim}) where {Dim,Codim}
VectorSplineSpaceConstraints{T}(args::Vararg{ScalarSplineSpaceConstraints{Dim},Codim}) where {Dim,Codim,T}
VectorSplineSpaceConstraints{Dim,Codim,T}() where {Dim,Codim,T<:Integer}

Construct VectorSplineSpaceConstraints for a VectorSplineSpace of dimension Dim and codomain dimension Codim.

source