Refinement
Documentation
BasicBSpline.refinement
— FunctionRefinement of B-spline manifold with given B-spline spaces.
Example
Define original manifold
p = 2 # degree of polynomial
k = KnotVector(1:8) # knot vector
P = BSplineSpace{p}(k) # B-spline space
rand_a = [SVector(rand(), rand()) for i in 1:dim(P), j in 1:dim(P)]
a = [SVector(2*i-6.5, 2*j-6.5) for i in 1:dim(P), j in 1:dim(P)] + rand_a # random
M = BSplineManifold(a,(P,P)) # Define B-spline manifold
h-refinement
Insert additional knots to knot vector.
julia> k₊ = (KnotVector([3.3,4.2]),KnotVector([3.8,3.2,5.3])) # additional knot vectors
(KnotVector([3.3, 4.2]), KnotVector([3.2, 3.8, 5.3]))
julia> M_h = refinement(M, k₊) # refinement of B-spline manifold
BSplineManifold{2, (2, 2), StaticArraysCore.SVector{2, Float64}, Tuple{BSplineSpace{2, Float64, KnotVector{Float64}}, BSplineSpace{2, Float64, KnotVector{Float64}}}}((BSplineSpace{2, Float64, KnotVector{Float64}}(KnotVector([1.0, 2.0, 3.0, 3.3, 4.0, 4.2, 5.0, 6.0, 7.0, 8.0])), BSplineSpace{2, Float64, KnotVector{Float64}}(KnotVector([1.0, 2.0, 3.0, 3.2, 3.8, 4.0, 5.0, 5.3, 6.0, 7.0, 8.0]))), StaticArraysCore.SVector{2, Float64}[[-3.7392559679567654, -3.783078079871714] [-3.597411705002145, -2.6270907448400385] … [-4.27252342702906, 2.44794251443626] [-4.010429310201709, 3.869439330221196]; [-2.328731904641716, -4.1480930630807595] [-2.275419510381314, -2.8615581264721692] … [-2.736955136391798, 2.5020454657912223] [-2.786990222003846, 3.8096177268489324]; … ; [2.359972932445208, -3.6129585850258517] [2.373167856283101, -2.9446206124413257] … [2.210716406024899, 2.602631448306355] [2.3997592455372003, 3.5324898804805147]; [4.093841853317975, -3.9061261483801712] [3.8504632555175444, -2.9860983311743827] … [4.331025079311032, 2.333423772424664] [4.480663191353303, 4.436571553462537]])
julia> save_png("2dim_h-refinement.png", M_h) # save image
Note that this shape and the last shape are equivalent.
p-refinement
Increase the polynomial degree of B-spline manifold.
julia> p₊ = (Val(1), Val(2)) # additional degrees
(Val{1}(), Val{2}())
julia> M_p = refinement(M, p₊) # refinement of B-spline manifold
BSplineManifold{2, (3, 4), StaticArraysCore.SVector{2, Float64}, Tuple{BSplineSpace{3, Int64, KnotVector{Int64}}, BSplineSpace{4, Int64, KnotVector{Int64}}}}((BSplineSpace{3, Int64, KnotVector{Int64}}(KnotVector([1, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 8])), BSplineSpace{4, Int64, KnotVector{Int64}}(KnotVector([1, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 6, 7, 8]))), StaticArraysCore.SVector{2, Float64}[[-3.327939887958376, -3.381062882382532] [-3.2286534014564956, -2.3898453165277354] … [-3.857369028126979, 2.625613347418197] [-3.750274329305369, 3.444604754180493]; [-1.9190826728891883, -3.6996476508119316] [-1.8954644502285198, -2.596850938310199] … [-2.320089840437407, 2.6673570013295036] [-2.4013083859231266, 3.417615645058782]; … ; [2.63663136518713, -3.36586722890932] [2.6119919237133846, -2.773961995558151] … [2.5855688772510934, 2.690164285500753] [2.692907338976954, 3.352168201374152]; [3.7212735564249955, -3.491398425417405] [3.554093269596626, -2.759665500609979] … [3.9960174259147876, 2.6027151956081522] [4.087903053338675, 3.7248325816241836]])
julia> save_png("2dim_p-refinement.png", M_p) # save image
Note that this shape and the last shape are equivalent.