FunctionSpaces
All docstrings from Mantis.FunctionSpaces
Mantis.FunctionSpaces Module
This (sub-)module provides a collection of function spaces. The exported names are:
sourceMantis.FunctionSpaces.AbstractCanonicalSpace Type
AbstractCanonicalSpace <: AbstractFunctionSpaceSupertype for all element-local bases. These spaces are only defined in the canonical domain and are used to define the shape functions on the reference element.
sourceMantis.FunctionSpaces.AbstractFESpace Type
AbstractFESpace{manifold_dim, num_components, num_patches} <: AbstractFunctionSpaceSupertype for all finite element spaces. These can be of any dimension, with any number of components, and on any number of patches.
Type parameters
manifold_dim::Int: Dimension of the manifold.num_components::Int: Number of (output) components of the function space.num_patches::Int: Number of patches over which the function space is defined.
Mantis.FunctionSpaces.AbstractFunctionSpace Type
AbstractFunctionSpaceSupertype for all function spaces.
sourceMantis.FunctionSpaces.AbstractTwoScaleOperator Type
AbstractTwoScaleOperatorSupertype for all two scale relations.
sourceMantis.FunctionSpaces.BSplineSpace Type
BSplineSpace{F, G, GP, TM, TE, TI, TJ, D} <: AbstractFESpace{1, 1, 1}Univariate (general) B-Spline function space defined on a knot_vector::KnotVector, with given polynomial_degree and regularity per breakpoint.
Note that while the section spaces on each element are the same, they don't necessarily have to be polynomials; they are just named polynomials for convention.
Fields
geometry::G: Physical geometry to which the B-Spline space is mapped.knot_vector::KnotVector: 1-dimensional knot vector defining the parametric geometry. SeeKnotVectorfor more details.extraction_op::ExtractionOperator: Stores extraction coefficients and basis indices.polynomials::F: local section space F, namedpolynomialsjust for convention. Can be anyAbstractCanonicalSpace.dof_partition::D: Partitioning of the degrees of freedom into boundary and interior dofs. The type will be similar to Vector{Vector{Vector{Int}}}, where the outer Vector will have length 1 (its for patches), the middle Vector will be of length 3 (1: left boundary, 2 interior, 3 right boundary), and the inner Vector will contain the global basis indices.
Mantis.FunctionSpaces.Bernstein Type
Bernstein <: AbstractCanonicalSpaceConcrete type for Bernstein polynomials; see [2].
Fields
p::Int: Degree of the Bernstein polynomial.
Mantis.FunctionSpaces.DirectSumSpace Type
DirectSumSpace{manifold_dim, num_components, num_patches, F} <:
AbstractFESpace{manifold_dim, num_components, num_patches}A multi-component space that is the direct sum of num_components scalar function spaces. Consequently, their basis functions are evaluated independently and arranged in a using Base: COMPILETIME_PREFERENCES block-diagonal matrix. Each scalar function space contributes to a separate component of the multi-component space.
Fields
component_spaces::F: Tuple ofnum_componentsscalar function spacesbasis_offsets::NTuple{num_components, Int}: Offsets of the basis functions of each component space to get the global basis functions numbers.num_elements::Int: Number of elements in the space.space_dim::Int: Dimension of the space, i.e., the number of global d.o.f.s.
Mantis.FunctionSpaces.EdgeLobattoLegendre Type
Edge polynomials of degree
The
where
If
i.e., they satisfy an integral Kronecker-
Fields
p::Int: polynomial degree.nodes::Vector{Float64}: the nodes of the Gauss-Lobatto-Legendre Lagrange polynomials associated to it.
See [3] for more details.
sourceMantis.FunctionSpaces.ExtractionOperator Type
ExtractionOperator{num_components, TE, TI, TJ}Stores extraction coefficients and basis indices for a function space.
Fields
extraction_coefficients::Vector{NTuple{num_components, TE}}: A vector of extraction coefficient matrices, where each matrix corresponds to an element. TE should be matrix- like.basis_indices::Vector{TI}: A vector ofIndices. SeeIndicesfor more details.num_elements::Int: The number of elements.num_basis::Int: The (total) dimension of the function space.
Mantis.FunctionSpaces.GTBSplineSpace Type
GTBSplineSpace{num_patches, T, TE, TI, TJ} <: AbstractFESpace{1, 1, num_patches}Constructs a GTBSplineSpace from a tuple of NURBS or B-spline spaces and a vector of regularity conditions. Periodic spaces are a special case of GTBSplines for num_patches = 1 and regularity = [r] with r > -1; see [4].
Fields
patch_spaces::NTuple{num_patches, T}: A tuple ofnum_patchesNURBS or B-spline spaces.extraction_op::ExtractionOperator{1, TE, TI, TJ}: The extraction operator for the GTBSpline space.dof_partition::Vector{Vector{Vector{Int}}}: A vector of vectors of vectors of integers representing the degree of freedom partitioning.regularity::Vector{Int}: A vector of regularity conditions at the interfaces between the spaces.
Arguments for constructor
patch_spaces::NTuple{num_patches, T}: A tuple ofnum_patchesNURBS or B-spline spaces.regularity::Vector{Int}: A vector of regularity conditions at the interfaces between the spaces.num_dofs_left::Int: The number of degrees of freedom at the left boundary. Default is -1, which means it will be computed automatically.num_dofs_right::Int: The number of degrees of freedom at the right boundary. Default is -1, which means it will be computed automatically.
Throws
ArgumentError: If the number of regularity conditions does not match the number of interfaces.ArgumentError: If the minimal polynomial degree of any pair of adjacent spaces is less than the corresponding regularity condition.
Mantis.FunctionSpaces.GeneralizedExponential Type
GeneralizedExponential <: AbstractECTSpacesConcrete type for Generalized Exponential section space spanned by <1, x, ..., x^(p-2), exp(wx), exp(-wx)>, equivalently <1, x, ..., x^(p-2), cosh(wx), sinh(wx)>, on [0,l]; see [5].
Fields
p::Int: Degree of the space.w::Float64: Weight parameter for the space.l::Float64: Length of the interval. GExp space is not scale-invariant.t::Bool: flag to indicate if critical length is exceeded.m::Int: number of terms from the infinite sum used to build the basis.C::Matrix{Float64}: representation matrix for the local basis.
Mantis.FunctionSpaces.GeneralizedTrigonometric Type
GeneralizedTrigonometric <: AbstractECTSpacesConcrete type for Generalized Trignometric section space spanned by
Fields
p::Int: Degree of the space.w::Float64: Weight parameter for the space.l::Float64: Length of the interval. GTrig space is not scale-invariant.t::Bool: flag to indicate if critical length is exceeded.m::Int: number of terms from the infinite sum used to build the basis.C::Matrix{Float64}: representation matrix for the local basis.
Mantis.FunctionSpaces.HierarchicalActiveInfo Type
struct HierarchicalActiveInfoContains information about active objects in a hierarchical construction. The indexing in the hierarchical space is such that the index of an object in level l-1 is always less than that of an object in level l.
Fields
level_ids::Vector{Vector{Int}}: Per level collection of active objects. 'level_ids[l][i]' gives the id in level 'l' of the object indicated by 'i', not the hierarchical id of the overall set of objects.level_cum_num_ids::Vector{Int}: Total number of active objects up to a certain level, i.e. 'level_cum_num_ids[l]=sum(length.(level_ids[1:l-1]))'. First entry is always 0 for ease of use.
Mantis.FunctionSpaces.HierarchicalFiniteElementSpace Type
HierarchicalFiniteElementSpace{
manifold_dim, num_components, num_patches, S, T, G, GP
} <: AbstractFESpace{manifold_dim, num_components, num_patches}A hierarchical space that is built from nested hierarchies of manifold_dim-variate function spaces and domains; see [6].
Fields
spaces::Vector{S}: Collection ofmanifold_dim- variate function spaces.two_scale_operators::Vector{T}: Collection of two-scale operators relating each
consecutive pair of finite element spaces. See [`AbstractTwoScaleOperator`](@ref).active_elements::HierarchicalActiveInfo: Information about the active elements in each
level.active_basis::HierarchicalActiveInfo: Information about the active basis in each level.nested_domains::HierarchicalActiveInfo: Information about the nested domains in each
level. This is the usual definition of Ωₗ in the literature.multilevel_elements::SparseArrays.SparseVector{Int, Int}: Elements where basis from multiple levels have non-empty support.multilevel_extraction_coeffs::Vector{NTuple{num_components, Matrix{Float64}}}:
Extraction coefficients of active basis functions in `multilevel_elements`.multilevel_basis_indices::Vector{Vector{Int}}: Indices of active basis in
`multilevel_elements`, in hierarchical indexing.num_subdivisions::NTuple{manifold_dim, Int}: Number of subdivisions permanifold_dim,
per level for the hierarchical mesh.truncated::Bool: Flag for truncated hierarchical spaces.simplified::Bool: Flag for simplified hierarchical spaces.dof_partition::Vector{Vector{Vector{Int}}}: The degree-of-freedom partitioning of the
hierarchical space, in hierarchical indexing.Mantis.FunctionSpaces.HierarchicalFiniteElementSpace Method
HierarchicalFiniteElementSpace(
space::S,
num_subdivisions::NTuple{manifold_dim, Int},
truncated::Bool=true,
simplified::Bool=false,
) where {manifold_dim, S <: AbstractFESpace{manifold_dim}}Constructor for a Hierarchical space with no refinement
sourceMantis.FunctionSpaces.HierarchicalFiniteElementSpace Method
HierarchicalFiniteElementSpace(
spaces::Vector{S},
two_scale_operators::Vector{T},
domains_per_level::Vector{Vector{Int}},
num_subdivisions::NTuple{manifold_dim, Int},
truncated::Bool=true,
simplified::Bool=false,
) where {
manifold_dim,
num_components,
num_patches,
S <: AbstractFESpace{manifold_dim, num_components, num_patches},
T <: AbstractTwoScaleOperator,
}Helper constructor for domains given in a per-level vector.
sourceMantis.FunctionSpaces.Indices Type
Indices{num_components, TI, TJ}Stores basis indices for an ExtractionOperator.
Fields
I::TI: Global basis indices per element. Should be a vector-like type with integer elements.J::NTuple{num_components, TJ}: 'Permutation' of the basis indices. This tells theevaluatefunction to which basis on an element the evaluations correspond.
Mantis.FunctionSpaces.KnotVector Type
KnotVector1-dimensional knot vector.
Fields
geometry::G: A 1D geometry.polynomial_degree::Int: Polynomial degree.multiplicity::TM: Number of repetitions of each knot.
Mantis.FunctionSpaces.RationalFESpace Type
RationalFESpace{manifold_dim, F} <: AbstractFESpace{manifold_dim, 1, 1}A rational finite element space obtained by dividing all elements of a given function space by a fixed element from the same function space. The latter is defined with the help of specified weights.
Fields
function_space::F: The underlying function space.weights::Vector{Float64}: The weights associated with the basis functions of the function space.
Mantis.FunctionSpaces.Tchebycheff Type
Tchebycheff <: AbstractECTSpacesA Tchebycheffian section space. The parameters are the roots of a differential operator with constant coefficients; see [5].
A complex root
α + iβ,β ≠ 0, of multiplicitymcontributes2mbasis functions of the form (upto scaling):x^i e^(αx) cos(βx),x^i e^(αx) sin(βx),i = 0, ..., m-1A real root
αof multiplicitymcontributesmbasis functions of the form (upto scaling):x^i e^(αx),i = 0, ..., m-1
Fields
p::Int: Degree of the space.roots::Matrix{Float64}: (real, imag) pairs of roots.root_mult::Vector{Int}: Multiplicities of roots.root_type::Vector{Int}: Types of roots: 0=zero, 1=real, 2=imaginary, 3=complex.l::Float64: Length of the interval. Tchebycheff space is not scale-invariant.mu::Vector{Int}: Cumulative dimension for the roots.C::Matrix{Float64}: Representation matrix for the local basis.endpoint_tol::Float64: Tolerance to determine if a point is at an endpoint.
Mantis.FunctionSpaces.TensorProductSpace Type
TensorProductSpace{
manifold_dim, num_components, num_patches, num_spaces, T, G, GP, CIB, LIB, D
} <: AbstractFESpace{manifold_dim, num_components, num_patches}A structure representing a TensorProductSpace, defined by the tensor product of num_spaces constituent spaces. The resulting tensor product has a manifold_dim equal to the sum of the constituent spaces' manifold dimensions.
Fields
constituent_spaces::T: A tuple of constituent finite element spaces to be tensored.geometry::G: The underlying physical geometry.parametric_geometry::GP: The underlying parametric geometry. The function space is defined with respect to this.cart_num_basis::CIB: To convert from tensor-product indexing to constituent-wise indexing for basis functions.lin_num_basis::LIB: To convert from constituent-wise indexing to tensor-product indexing for basis functions.dof_partition::D: Seeget_dof_partition.
Mantis.FunctionSpaces.TensorProductTwoScaleOperator Type
struct TensorProductTwoScaleOperator{manifold_dim, TP, TS} <: AbstractTwoScaleOperator{manifold_dim}A structure representing a two-scale operator for tensor product spaces, defining the relationships between coarse and fine tensor product spaces.
Fields
coarse_space::TP: The coarse tensor product space.fine_space::TP: The fine tensor product space.global_subdiv_matrix::SparseArrays.SparseMatrixCSC{Float64, Int}: The global subdivision matrix for the tensor product space.twoscale_operators::TS: A tuple of two-scale operators for each constituent space.
Mantis.FunctionSpaces.TwoScaleOperator Type
struct TwoScaleOperator{manifold_dim, S} <: AbstractTwoScaleOperator{manifold_dim}A structure representing a two-scale operator that dechilds the relationships between parent and child finite element spaces.
Fields
parent_space::S: The parent finite element space.child_space::S: The child finite element space.global_subdiv_matrix::SparseArrays.SparseMatrixCSC{Float64, Int}: The global subdivision matrix. The size of this matrix is(num_child_basis, num_parent_basis)wherenum_child_basisis the dimension ofchild_spaceandnum_parent_basisthe dimension ofparent_space.parent_to_child_elements::Vector{Vector{Int}}: A vector of vectors containing the child element IDs for each parent element.child_to_parent_elements::Vector{Int}: A vector containing the parent element ID for each child element.parent_to_child_basis::Vector{Vector{Int}}: A vector of vectors containing the child basis function IDs for each parent basis function.child_to_parent_basis::Vector{Vector{Int}}: A vector of vectors containing the parent basis function IDs for each child basis function.
Mantis.FunctionSpaces._build_polar_extraction_and_dof_partition Method
_build_polar_extraction_and_dof_partition(
tp_space::TensorProductSpace,
E::SparseMatrixCSC{Float64,Int},
two_poles::Bool
)Build the extraction operator and dof partitioning for the polar spline space.
Arguments
tp_space::TensorProductSpace: The tensor product space.E::SparseMatrixCSC{Float64,Int}: The extraction operator.two_poles::Bool: Whether the polar spline space has two poles.
Returns
::Tuple{ExtractionOperator, Vector{Vector{Vector{Int}}}}: The extraction operator and dof partitioning.
Mantis.FunctionSpaces._build_standard_degenerate_control_points Method
_build_standard_degenerate_control_points(n_p::Int, n_r::Int, R::Float64)Generate degenerate control points for a given number of poloidal and radial divisions.
Arguments
n_p::Int: Number of poloidal divisions.
n_r::Int: Number of radial divisions.
R::Float64: Radius of the polar domain.
Returns
degenerate_control_points::Array{Float64,3}: The degenerate control points.
radii::Vector{Float64}: The radii values.
theta::Vector{Float64}: The theta values.
Mantis.FunctionSpaces._compute_parametric_geometry_coeffs Method
_compute_parametric_geometry_coeffs(fem_space::F) where {
manifold_dim,
num_components,
F<:FunctionSpaces.AbstractFESpace{manifold_dim, num_components}
}Compute the parametric geometry coefficients for a given finite element space.
This function calculates the coefficients necessary for representing the parametric geometry of a finite element space.
Arguments
fem_space::F: The finite element space for which to compute the parametric geometry coefficients.
Returns
coeffs::Matrix{Float64}: The coefficients necessary for representing the parametric geometry. The size of the matrix is (num_basis x manifold_dim).
Mantis.FunctionSpaces._derivative_matrix Method
_derivative_matrix(nodes::Vector{Float64}; algorithm::Int=1)Returns the first derivative of the polynomial lagrange basis functions at the nodal points.
The derivative of the Lagrange interpolating basis functions (
For computation at the nodes a more efficient and accurate formula can be used, see [7]:
with
It returns a 2-dimensional matrix,
Arguments
nodes::Vector{Float64}:nodes that define a set of Lagrange polynomials of degree , , for which to compute the derivative matrix. Note that the polynomials are such that with , \xi_{i} \in [0.0, 1.0].
Keyword arguments
algorithm::Int: Flag to specify the algorithm to use 1: <default> Stable algorithm using Eq. (7) in [1]. 2: Direct computation using Eq. (4) in [1].
Returns
D::Array{Float64, 2}:: The derivatives of the(p+1)polynomials evaluated at the(p+1)nodal points.. (size: [p+1, p+1])
Mantis.FunctionSpaces._derivative_matrix_next! Method
_derivative_matrix_next!(D_m::Array{Float64, 2}, m::Int, D::Array{Float64, 2}, nodes::Vector{Float64})
Given the derivative matrix (of order 1), D, and the derivative matrix of order n, D_m, compute the derivative of order (n+1).
We follow the algorithm proposed in section 4 of [7].
Arguments
D_m::Array{float64, 2}: Derivative matrix of ordermfor thepolynomials``of degree``p``, evaluated at the(p+1)nodal points, following the same format as the derivative matrixD` below. (size: [p+1, p+1])D::Array{Float64, 2}:: The derivatives of the(p+1)polynomials evaluated at the(p+1)nodal points.. (size: [p+1, p+1]) nodes::Vector{Float64}:nodes that define a set of Lagrange polynomials of degree , , for which to compute the derivative matrix. Note that the polynomials are such that with , \xi_{i} \in [0.0, 1.0].
Returns
D_m::Array{Float64, 2}:: The derivatives or degree(m+1)of the(p+1)polynomials evaluated at the(p+1)nodal points.. D_mgiven as input argument is updated with the new value. (size: [p+1, p+1])
Mantis.FunctionSpaces._evaluate_all_at_point Method
_evaluate_all_at_point(
canonical_space::AbstractCanonicalSpace, xi::Float64, nderivatives::Int
)Evaluates all derivatives upto order nderivatives for all basis functions of canonical_space at a given point xi.
Arguments
canonical_space::AbstractCanonicalSpace: A canonical space.xi::Float64: The point where all global basis functiuons are evaluated.nderivatives::Int: The order upto which derivatives need to be computed.
Returns
::SparseMatrixCSC{Float64}: Global basis functions, size = n_dofs x nderivatives+1
Mantis.FunctionSpaces._evaluate_all_at_point Method
_evaluate_all_at_point(
fem_space::AbstractFESpace{1, num_components},
element_id::Int,
xi::Float64,
nderivatives::Int,
) where {num_components}Evaluates all derivatives up to order nderivatives for all basis functions of fem_space at a given point xi in the element element_id.
Arguments
fem_space::AbstractFESpace{1, num_components}: A univariate FEM space.element_id::Int: The id of the element.xi::Float64: The point where all global basis functiuons are evaluated.nderivatives::Int: The order upto which derivatives need to be computed.
Returns
::SparseMatrixCSC{Float64}: Global basis functions, size = n_dofs x nderivatives+1
Mantis.FunctionSpaces._get_barycentric_coordinates Function
_get_barycentric_coordinates(points, tri, origin)Compute the barycentric coordinates of the input points w.r.t. the control triangle. The points are translated by the offset before computing the barycentric coordinates.
Arguments
points::Matrix{Float64}: The input points, where each row corresponds to a point.tri::Matrix{Float64}: Matrix with the coordinates of thei-th vertex of the control triangle in thei-th row.origin::Vector{Float64}: The point which is translated to the origin.
Returns
::Matrix{Float64}: The barycentric coordinates.
Mantis.FunctionSpaces._get_circumscribing_triangle Function
_get_circumscribing_triangle(points, origin)Build a standard triangle that contains the input points.
Arguments
points::Matrix{Float64}: The input points, where each row corresponds to a point.origin::Vector{Float64}: The point which is translated to the origin.
Returns
::Matrix{Float64}: The circumscribing triangle.
Mantis.FunctionSpaces._get_scalar_polar_extraction_submatrix Function
_get_scalar_polar_extraction_submatrix(
degenerate_control_points::Array{Float64, 3},
tri::Matrix{Float64},
origin::Vector{Float64}=[0.0, 0.0],
two_poles::Bool=false
)Compute the extraction sub-matrices for the scalar polar spline space. These are used to build the scalar polar spline extraction operator, as well as the vector polar spline extraction operator.
Arguments
degenerate_control_points::Array{Float64, 3}: The degenerate control points.tri::Matrix{Float64}: The control triangle.origin::Vector{Float64}=[0.0, 0.0]: The origin.two_poles::Bool=false: Whether the polar spline space has two poles.
Returns
E0_1::SparseMatrixCSC{Float64,Int}: The extraction sub-matrix for the first pole.E0_2::SparseMatrixCSC{Float64,Int}: The extraction sub-matrix for the second pole.
Mantis.FunctionSpaces.add_level! Method
add_level!(space::HierarchicalFiniteElementSpace)Adds an empty level to space.
Returns
space::HierarchicalFiniteElementSpace: Space with an extra refinement level.
Mantis.FunctionSpaces.add_padding! Method
add_padding!(
marked_elements_per_level::Vector{Vector{Int}}, space::HierarchicalFiniteElementSpace
)For each level of the hierarchical space, adds a padding to marked_elements_per_level[level]. The padding consists of the support of all basis functions whose supports intersect the original marked_elements_per_level.
Arguments
marked_elements_per_level::Vector{Vector{Int}}: The level-wise indexing of marked
elements.space::HierarchicalFiniteElementSpace: The hierarchical finite element space.
Returns
marked_elements_per_level::Vector{Vector{Int}}: The padded level-wise indexing of marked
elements.Mantis.FunctionSpaces.assemble_global_extraction_matrix Method
assemble_global_extraction_matrix(space::AbstractFESpace)Assembles the global extraction matrix for an FESpace by combining the extraction coefficients from each element on each patch. The global extraction matrix maps the global degrees of freedom to the local degrees of freedom.
Arguments
space::AbstractFESpace: The finite element space.
Returns
SparseMatrixCSC{Float64}: The global extraction matrix that maps global dofs to local dofs
Mantis.FunctionSpaces.build_sparse_nullspace Method
build_sparse_nullspace(constraint::SparseArrays.SparseVector{Float64})Build the sparsest possible nullspace of a constraint vector with no zero entries.
Arguments
constraint::SparseArrays.SparseVector{Float64}: The constraint vector.
Returns
::SparseMatrixCSC{Float64}: The sparse nullspace matrix.
Mantis.FunctionSpaces.build_two_scale_matrix Method
build_two_scale_matrix(canonical_space::AbstractCanonicalSpace, num_sub_elements::Int)Uniformly subdivides the canonical space into num_sub_elements sub-elements. It is assumed that num_sub_elements is a power of 2, else the method throws an argument error. It returns a global subdivision matrix that maps the global basis functions of the canonical space to the global basis functions of the subspaces.
Arguments
canonical_space::AbstractCanonicalSpace: A canonical space.num_sub_elements::Int: The number of subspaces to divide the canonical space into.
Returns
::SparseMatrixCSC{Float64}: A global subdivision matrix that maps the global basis functions of the canonical space to the global basis functions of the subspaces.
Mantis.FunctionSpaces.build_two_scale_matrix Method
build_two_scale_matrix(ect_space::AbstractLagrangePolynomials, num_sub_elements::Int)Uniformly subdivides the ECT space into num_sub_elements sub-elements. It is assumed that num_sub_elements is a power of 2, else the method throws an argument error. It returns a global subdivision matrix that maps the global basis functions of the ECT space to the global basis functions of the subspaces.
Arguments
ect_space::AbstractECTSpaces: A ect space.num_sub_elements::Int: The number of subspaces to divide the EC T space into.
Returns
::SparseMatrixCSC{Float64}: A global subdivision matrix that maps the global basis
functions of the ECT space to the global basis functions of the subspaces.
sourceMantis.FunctionSpaces.build_two_scale_matrix Method
build_two_scale_matrix(parent_knot_vector::KnotVector, child_knot_vector::KnotVector)Algorithm for the coefficients of a change of B-spline representation for knot insertion of multiple knots, recursively using single_knot_insertion_oslo(). The parent knot vector is parent_knot_vector and the inserted knots are given by child_knot_vector.
For more information, see [8].
Arguments
parent_knot_vector::KnotVector: parent knot vector.child_knot_vector::KnotVector: child knot vector, with the extra knots.
Returns
global_extraction_matrix: Global subdivision matrix
Mantis.FunctionSpaces.build_two_scale_operator Function
build_two_scale_operator(
parent_bspline::BSplineSpace, num_subdivisions::Int, child_multiplicity::Int
)Algorithm for the coefficients of a change of B-spline representation for knot insertion of multiple knots, recursively using single_knot_insertion_oslo(). The parent knot vector is parent_bspline.knot_vector and the inserted knots are given by num_subdivisions, meaning num_subdivisions-1 uniformly spaced knots are inserted, between parent breakpoints, with multiplicity 1.
For more information, see [8].
Arguments
parent_bspline::BSplineSpace: parent B-spline.num_subdivisions::Int: Number of times each element is subdivided.child_multiplicity::Int: Multiplicity of each new knot in refined knot vector.
Returns
::FiniteElementSpaces.TwoScaleOperator, child_bspline::BSplineSpace: Tuple with a twoscale_operator and child B-spline space.
Mantis.FunctionSpaces.build_two_scale_operator Method
build_two_scale_operator(
parent_bspline::BSplineSpace{F}, child_bspline::BSplineSpace{F}, num_subdivisions::Int
) where {F <: AbstractCanonicalSpace}Algorithm for the coefficients of a change of B-spline representation for knot insertion of multiple knots, recursively using single_knot_insertion_oslo(). The parent knot vector is parent_bspline.knot_vector and the inserted knots are given by child_bspline.knot_vector.
For more information, see [8].
Arguments
parent_bspline::BSplineSpace: parent B-spline.child_bspline::BSplineSpace: child B-spline, with extra knots.num_subdivisions::Int: Number of times each element is subdivided.
Returns
::FiniteElementSpaces.TwoScaleOperator, child_bspline::BSplineSpace: Tuple with a twoscale_operator and child B-spline space.
Mantis.FunctionSpaces.build_two_scale_operator Method
build_two_scale_operator(
space::TensorProductSpace{manifold_dim, num_components, num_patches, T},
nsubdivisions::NTuple{num_spaces, Int}
) where {
manifold_dim,
num_components,
num_patches,
num_spaces,
T <: NTuple{num_spaces, AbstractFESpace},
}Build a two-scale operator for a tensor product space by subdividing each constituent finite element space.
Arguments
space::TensorProductSpace: The tensor product space to be subdivided.nsubdivisions::NTuple{num_spaces, Int}: A tuple specifying the number of subdivisions for each constituent finite element space.
Returns
::TensorProductTwoScaleOperator: The two-scale operator.::TensorProductSpace: The resulting finer tensor product space after subdivision.
Mantis.FunctionSpaces.convert_element_vector_to_elements_per_level Method
convert_element_vector_to_elements_per_level(
space::HierarchicalFiniteElementSpace, hier_ids::Vector{Int}
)Separates a vector of hier_ids in hierarchical indexing into a set of level-wise indices.
Arguments
space::HierarchicalFiniteElementSpace: The hierarchical finite element space.hier_ids::Vector{Int}: The list of hierarchical indices.
Returns
Vector{Vector{Int}}: The level-wise indices. The length of the outer vector is the
number of levels of `space`.Mantis.FunctionSpaces.convert_knot_to_breakpoint_idx Method
convert_knot_to_breakpoint_idx(knot_vector::KnotVector, knot_index::Int)Retrieves the breakpoint index corresponding to knot_vector at knot_index, i.e., the index of the vector where every breakpoint[i] appears knot_vector.multiplicity[i]-times.
Arguments
knot_vector::KnotVector: Knot vector for length calculation.knot_index::Int: Index in the knot vector.
Returns
::Int: Index of breakpoint corresponding toknot_index.
Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_point::Float64,
box_size::Float64,
num_elements::Int,
degree::Int,
regularity::Int;
n_dofs_left::Int=1,
n_dofs_right::Int=1,
)Create a piecewise-polynomial 1D B-spline space based on the provided starting point, box size, number of elements, polynomial degree, and regularity. It constructs a uniform distribution of breakpoints and uses them to define a Geometry.CartesianGeometry object. The function then creates a regularity vector, with the first and last entries set to -1 to ensure an open knot vector, and returns the corresponding BSplineSpace. Optional arguments include the number of degrees of freedom on the left and right boundaries.
Arguments
starting_point::Float64: The coordinate of the starting point of the B-spline space.box_size::Float64: The size of the space along the single dimension.num_elements::Int: The number of elements along the dimension.degree::Int: The polynomial degree on each element.regularity::Int: The regularity (smoothness) between consecutive B-spline basis functions, typically between 0 anddegree - 1.n_dofs_left::Int: The number of degrees of freedom on the left boundary.n_dofs_right::Int: The number of degrees of freedom on the right boundary.
Returns
::BSplineSpace: The generated B-spline space.
Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_point::NTuple{1, Float64},
box_size::NTuple{1, Float64},
num_elements::NTuple{1, Int},
degree::NTuple{1, Int},
regularity::NTuple{1, Int};
n_dofs_left::NTuple{1, Int}=(1,),
n_dofs_right::NTuple{1, Int}=(1,),
)Create a piecewise-polynomial 1D B-spline space based on the provided starting point, box size, number of elements, polynomial degree, and regularity. It constructs a uniform distribution of breakpoints and uses them to define a Geometry.CartesianGeometry object. The function then creates a regularity vector, with the first and last entries set to -1 to ensure an open knot vector, and returns the corresponding BSplineSpace. Optional arguments include the number of degrees of freedom on the left and right boundaries.
Arguments
starting_point::Float64: The coordinate of the starting point of the B-spline space.box_size::Float64: The size of the space along the single dimension.num_elements::Int: The number of elements along the dimension.degree::Int: The polynomial degree on each element.regularity::Int: The regularity (smoothness) between consecutive B-spline basis functions, typically between 0 anddegree - 1.n_dofs_left::Int: The number of degrees of freedom on the left boundary.n_dofs_right::Int: The number of degrees of freedom on the right boundary.
Returns
::BSplineSpace: The generated B-spline space.
Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_point::Float64,
box_size::Float64,
num_elements::Int,
section_space::F,
regularity::Int;
n_dofs_left::Int=1,
n_dofs_right::Int=1,
) where {F <: AbstractCanonicalSpace}Create a 1D B-spline space based on the provided starting point, box size, number of elements, section space, and regularity. It constructs a uniform distribution of breakpoints and uses them to define a Geometry.CartesianGeometry object. The function then creates a regularity vector, with the first and last entries set to -1 to ensure an open knot vector, and returns the corresponding BSplineSpace. Optional arguments include the number of degrees of freedom on the left and right boundaries.
Arguments
starting_point::Float64: The coordinate of the starting point of the B-spline space.box_size::Float64: The size of the space along the single dimension.num_elements::Int: The number of elements along the dimension.section_space::F: The section space to use for the B-spline basis functions.regularity::Int: The regularity (smoothness) between consecutive B-spline basis functions, typically between 0 anddegree - 1.n_dofs_left::Int: The number of degrees of freedom on the left boundary.n_dofs_right::Int: The number of degrees of freedom on the right boundary.
Returns
::BSplineSpace: The generated B-spline space.
Examples
# Create a 1D B-spline space
start_1d = 0.0
size_1d = 10.0
elements_1d = 100
degree = 3
regularity = 2
section_space = Bernstein(degree)
bspline_space_1d = create_bspline_space(start_1d, size_1d, elements_1d, section_space, regularity)Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_point::NTuple{1, Float64},
box_size::NTuple{1, Float64},
num_elements::NTuple{1, Int},
section_space::NTuple{1, F},
regularity::NTuple{1, Int};
n_dofs_left::NTuple{1, Int}=(1,),
n_dofs_right::NTuple{1, Int}=(1,),
) where {F <: AbstractCanonicalSpace}Create a 1D B-spline space based on the provided starting point, box size, number of elements, section space, and regularity. It constructs a uniform distribution of breakpoints and uses them to define a Geometry.CartesianGeometry object. The function then creates a regularity vector, with the first and last entries set to -1 to ensure an open knot vector, and returns the corresponding BSplineSpace. Optional arguments include the number of degrees of freedom on the left and right boundaries.
Arguments
starting_point::NTuple{1, Float64}: The coordinate of the starting point of the B-spline space.box_size::NTuple{1, Float64}: The size of the space along the single dimension.num_elements::NTuple{1, Int}: The number of elements along the dimension.section_space::NTuple{1,F}: The section space to use for the B-spline basis functions.regularity::NTuple{1, Int}: The regularity (smoothness) between consecutive B-spline basis functions, typically between 0 anddegree - 1.n_dofs_left::NTuple{1,Int}: The number of degrees of freedom on the left boundary.n_dofs_right::NTuple{1,Int}: The number of degrees of freedom on the right boundary.
Returns
::BSplineSpace: The generated B-spline space.
Examples
# Create a 1D B-spline space
start_1d = 0.0
size_1d = 10.0
elements_1d = 100
degree = 3
regularity = 2
section_space = Bernstein(degree)
bspline_space_1d = create_bspline_space((start_1d,), (size_1d,), (elements_1d,), (section_space,), (regularity,))Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
degrees::NTuple{manifold_dim, Int},
regularities::NTuple{manifold_dim, Int};
n_dofs_left::NTuple{manifold_dim, Int}=Tuple(ones(Int, manifold_dim)),
n_dofs_right::NTuple{manifold_dim, Int}=Tuple(ones(Int, manifold_dim)),
) where {manifold_dim}Create a tensor product B-spline space based on the specified parameters for each dimension.
Arguments
starting_points::NTuple{manifold_dim, Float64}: The starting point of the B-spline space in each dimension.box_sizes::NTuple{manifold_dim, Float64}: The size of the box in each dimension.num_elements::NTuple{manifold_dim, Int}: The number of elements in each dimension.degrees::NTuple{manifold_dim, Int}: The polynomial degree in each dimension.regularities::NTuple{manifold_dim, Int}: The regularities of the B-spline in each dimension.
Returns
::TensorProductSpace: The resulting tensor product B-spline space.
Mantis.FunctionSpaces.create_bspline_space Method
create_bspline_space(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::F,
regularities::NTuple{manifold_dim, Int};
n_dofs_left::NTuple{manifold_dim, Int}=Tuple(ones(Int, manifold_dim)),
n_dofs_right::NTuple{manifold_dim, Int}=Tuple(ones(Int, manifold_dim)),
) where {manifold_dim, F <: NTuple{manifold_dim, AbstractCanonicalSpace}}Create a tensor product B-spline space based on the specified parameters for each dimension.
Arguments
starting_points::NTuple{manifold_dim, Float64}: The starting point of the B-spline space in each dimension.box_sizes::NTuple{manifold_dim, Float64}: The size of the box in each dimension.num_elements::NTuple{manifold_dim, Int}: The number of elements in each dimension.section_spaces::NTuple{manifold_dim, AbstractCanonicalSpace}: The section spaces for each dimension.regularities::NTuple{manifold_dim, Int}: The regularities of the B-spline in each dimension.
Returns
::TensorProductSpace: The resulting tensor product B-spline space.
Mantis.FunctionSpaces.create_dim_wise_bspline_spaces Method
create_dim_wise_bspline_spaces(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::F,
regularities::NTuple{manifold_dim, Int},
n_dofs_left::NTuple{manifold_dim, Int},
n_dofs_right::NTuple{manifold_dim, Int},
) where {manifold_dim, F <: NTuple{manifold_dim, AbstractCanonicalSpace}}Create manifold_dim univariate B-spline spaces based on the specified parameters for each dimension.
Arguments
starting_points::NTuple{manifold_dim, Float64}: The starting point of the B-spline space in each dimension.box_sizes::NTuple{manifold_dim, Float64}: The size of the box in each dimension.num_elements::NTuple{manifold_dim, Int}: The number of elements in each dimension.section_spaces::NTuple{manifold_dim, F}: The section spaces for each dimension.regularities::NTuple{manifold_dim, Int}: The regularities of the B-spline in each dimension.
Returns
::Tuple{BSplineSpace}: The resulting univariate B-spline spaces.
Mantis.FunctionSpaces.create_dim_wise_bspline_spaces Method
create_dim_wise_bspline_spaces(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
degrees::NTuple{manifold_dim, Int},
regularities::NTuple{manifold_dim, Int},
n_dofs_left::NTuple{manifold_dim, Int},
n_dofs_right::NTuple{manifold_dim, Int},
) where {manifold_dim}Create manifold_dim univariate B-spline spaces based on the specified parameters for each dimension.
Arguments
starting_points::NTuple{manifold_dim, Float64}: The starting point of the B-spline space in each dimension.box_sizes::NTuple{manifold_dim, Float64}: The size of the box in each dimension.num_elements::NTuple{manifold_dim, Int}: The number of elements in each dimension.degrees::NTuple{manifold_dim, Int}: The polynomial degree in each dimension.regularities::NTuple{manifold_dim, Int}: The regularities of the B-spline in each dimension.
Returns
::Tuple{BSplineSpace}: The resulting univariate B-spline spaces.
Mantis.FunctionSpaces.create_knot_vector Method
create_knot_vector(
breakpoints::AbstractVector{NT},
p::Int,
breakpoint_condition::AbstractVector{Int},
condition_type::String,
) where {NT <: Number}Creates a uniform knot vector corresponding to B-splines basis functions of polynomial degree p and continuity regularity[i] on breakpoints[i].
Arguments
breakpoints::AbstractVector{NT}: Location of each breakpoint.p::Int: Degree of the polynomial (). breakpoint_condition::AbstractVector{Int}: Either the regularity or multiplicity of each breakpoint.condition_type::String: Determines whetherbreakpoint_conditionprovides the regularity or multiplicity.
Returns
::KnotVector: Knot vector.
Mantis.FunctionSpaces.create_polar_geometry_data Method
create_polar_geometry_data(
num_elements::NTuple{2, Int},
degrees::NTuple{2, Int},
regularities::NTuple{2, Int};
geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing,
R::Float64=1.0,
two_poles::Bool=false
)Create all data required for creating a polar spline geometry.
Arguments
num_elements::NTuple{2, Int}: The number of elements in each direction.degrees::NTuple{2, Int}: The polynomial degrees in each direction.regularities::NTuple{2, Int}: The regularities in each direction.geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}: The geometry coefficients.R::Float64: The radius of the domain.
Returns
P_geom: The polar spline geometry space.geom_coeffs_polar: The polar geometry coefficients.
Mantis.FunctionSpaces.create_scalar_polar_spline_space Method
create_scalar_polar_spline_space(
num_elements::NTuple{2, Int},
degrees::NTuple{2, Int},
regularities::NTuple{2, Int};
geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing,
R::Float64 = 1.0,
two_poles::Bool = false
)Create a scalar polar spline space and geometry based on the provided parameters. The function constructs a tensor-product B-spline space in the angular and radial directions, and then creates a polar spline space and geometry based on the tensor-product space. The geometry is defined by the radius R and the number of elements in the angular and radial directions. Optional arguments include a flag to refine the geometry, the geometry coefficients, and whether the scalars are constrained to zero at poles.
Arguments
num_elements::NTuple{2, Int}: The number of elements in the angular and radial directions.degrees::NTuple{2, Int}: The polynomial degrees in the angular and radial directions.regularities::NTuple{2, Int}: The regularities of the B-spline in the angular and radial directions.geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing: The geometry coefficients for the polar spline space.R::Float64=1.0: The radius of the polar spline space.two_poles::Bool=false: Whether the polar spline space has two poles.zero_at_poles::Bool=false: Whether the scalars are constrained to zero at the poles.
Returns
::PolarSplineSpace: The resulting scalar polar spline space.
Mantis.FunctionSpaces.create_scalar_polar_spline_space Method
create_scalar_polar_splines_space(
num_elements::NTuple{2, Int},
section_spaces::F,
regularities::NTuple{2, Int};
geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing,
R::Float64=1.0,
two_poles::Bool=false,
zero_at_poles::Bool=false
) where {F <: NTuple{2, AbstractCanonicalSpace}}Create a scalar polar spline space and geometry based on the provided parameters. The function constructs a tensor-product B-spline space in the angular and radial directions, and then creates a polar spline space and geometry based on the tensor-product space. The geometry is defined by the radius R and the number of elements in the angular and radial directions. Optional arguments include the geometry coefficients, whether there are two poles, and whether the scalars are constrained to zero at the poles.
Arguments
num_elements::NTuple{2, Int}: The number of elements in the angular and radial directions.section_spaces::F: The section spaces for the angular and radial directions.regularities::NTuple{2, Int}: The regularities of the B-spline in the angular and radial directions.geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing: The geometry coefficients for the polar spline space.R::Float64=1.0: The radius of the polar spline space.two_poles::Bool=false: Whether the polar spline space has two poles.zero_at_poles::Bool=false: Whether the scalars are constrained to zero at the poles.
Returns
::PolarSplineSpace: The resulting scalar polar spline space.
Mantis.FunctionSpaces.create_vector_polar_spline_space Method
create_vector_polar_spline_space(
num_elements::NTuple{2, Int},
degrees::NTuple{2, Int},
regularities::NTuple{2, Int};
geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing,
R::Float64=1.0,
two_poles::Bool=false
)Create a vector polar spline space and geometry based on the provided parameters. The function constructs two tensor-product B-spline spaces, and then creates a 2-component polar spline space and geometry based on them. The geometry is defined by the radius R and the number of elements in the angular and radial directions. Optional arguments include the geometry coefficients, and whether there are two poles.
Arguments
num_elements::NTuple{2, Int}: The number of elements in each direction.degrees::NTuple{2, Int}: The polynomial degrees in each direction.regularities::NTuple{2, Int}: The regularities in each direction.geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}: The geometry coefficients.R::Float64: The radius of the domain.
Returns
::PolarSplineSpace: The resulting vector polar spline space.
Mantis.FunctionSpaces.create_vector_polar_spline_space Method
create_vector_polar_spline_space(
num_elements::NTuple{2, Int},
section_spaces::F,
regularities::NTuple{2, Int};
geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}=nothing,
R::Float64=1.0,
two_poles::Bool=false,
) where {F <: NTuple{2, AbstractCanonicalSpace}}Create a vector polar spline space and geometry based on the provided parameters. The function constructs two tensor-product B-spline spaces, and then creates a 2-component polar spline space and geometry based on them. The geometry is defined by the radius R and the number of elements in the angular and radial directions. Optional arguments include the geometry coefficients, and whether there are two poles.
Arguments
num_elements::NTuple{2, Int}: The number of elements in each direction.degrees::NTuple{2, Int}: The polynomial degrees in each direction.regularities::NTuple{2, Int}: The regularities in each direction.geom_coeffs_tp::Union{Nothing, Array{Float64, 3}}: The geometry coefficients.R::Float64: The radius of the domain.
Returns
::PolarSplineSpace: The resulting vector polar spline space.
Mantis.FunctionSpaces.evaluate Function
evaluate(polynomial::Bernstein, ξ::Vector{Float64}, nderivatives::Int=0)Compute derivatives up to order nderivatives for all Bernstein polynomials of degree p at ξ for
Arguments
polynomial::Bernstein: Bernstein polynomial.ξ::Vector{Float64}: Vector of evaluation points. nderivatives::Int=0: Maximum order of derivatives to be computed (nderivatives). Defaults to 0, i.e., only the values of the polynomials are computed.
Returns
::Vector{Vector{Matrix{Float64}}}: Nested vector containing the values.
Mantis.FunctionSpaces.evaluate Function
evaluate(polynomials::EdgeLobattoLegendre, ξ::Vector{Float64}, nderivatives::Int=0)Evaluate the polynomials polynomials at ξ for
Arguments
polynomials::EdgeLobattoLegendre:polynomials of degree , with , to evaluate. ξ::Vector{Float64}: vector ofevaluation points . nderivatives::Int: maximum order of derivatives to be computed (nderivatives). Will compute the polynomial, first derivative, second derivative, etc, up to nderivatives.
Returns
d_polynomials::Array{Float64, 3}(n, p+1, nderivatives) with the evaluation of polynomials and its derivatives up to degree nderivatives at every point ξ. d_polynomials[i, j, k]
Mantis.FunctionSpaces.evaluate Function
evaluate(polynomials::AbstractLagrangePolynomials, ξ::Vector{Float64}, nderivatives::Int=0)Evaluate the first nderivatives derivatives of the polynomials polynomials at ξ for
Arguments
polynomials::AbstractLagrangePolynomials:polynomials of degree , with , to evaluate. ξ::Vector{Float64}: vector ofevaluation points . nderivatives::Int: maximum order of derivatives to be computed (nderivatives). Will compute the polynomial, first derivative, second derivative, etc, up to nderivatives.
Returns
d_polynomials::Array{Float64, 3}(n, p+1, nderivatives) with the evaluation of polynomials and its derivatives up to degree nderivatives at every point ξ. d_polynomials[i, j, k]
Mantis.FunctionSpaces.evaluate Function
evaluate(ect_space::AbstractECTSpaces, ξ::Points.AbstractPoints{1}, nderivatives::Int=0)Compute derivatives up to order nderivatives for all basis functions of degree p at ξ for
Arguments
ect_space::AbstractECTSpaces: ECT section space.ξ::Points.AbstractPoints{1}: vector of evaluation points. nderivatives::Int: maximum order of derivatives to be computed (nderivatives). Defaults to 0, i.e., only the values are computed.
Mantis.FunctionSpaces.evaluate Method
evaluate(ect_space::GeneralizedExponential, ξ::Vector{Float64})Compute all basis function values at ξ in
Arguments
ect_space::GeneralizedExponential: Generalized Exponential section space.xi::Vector{Float64}: vector of evaluation points.
Mantis.FunctionSpaces.evaluate Method
evaluate(ect_space::GeneralizedTrigonometric, ξ::Vector{Float64})Compute all basis function values at ξ in
Arguments
ect_space::GeneralizedTrigonometric: Generalized Trigonometric section space.xi::Vector{Float64}: vector of evaluation points in.
See also evaluate(ect_space::GeneralizedTrigonometric, xi::Vector{Float64}, nderivatives::Int64).
Mantis.FunctionSpaces.evaluate Method
evaluate(ect_space::Tchebycheff, ξ::Vector{Float64})Compute all basis function values at ξ in
Arguments
ect_space::Tchebycheff: Tchebycheff section space.xi::Vector{Float64}: vector of evaluation points.
Mantis.FunctionSpaces.evaluate Method
evaluate(
space::AbstractFESpace{manifold_dim, num_components, num_patches},
element_id::Int,
xi::NTuple{manifold_dim,Vector{Float64}},
nderivatives::Int,
coefficients::Vector{Float64}
) where {manifold_dim, num_components, num_patches}Evaluate the basis functions with coefficients of the finite element space space at the point xi on element element_id up to order nderivatives. See evaluate for more details.
Arguments
space::AbstractFESpace{manifold_dim, num_components, num_patches}: Finite element space.element_id::Int: Index of the element.xi::Points.AbstractPoints{manifold_dim}: Point on the element in canonical coordinates.nderivatives::Int=0: Order of the derivatives. Default is 0 (i.e., function evaluation).coefficients::Vector{Float64}: Coefficients.
Returns
evaluation::Vector{Vector{Vector{Vector{Float64}}}}: Values at the points.
Mantis.FunctionSpaces.evaluate Method
evaluate(
space::AbstractFESpace{manifold_dim, num_components, num_patches},
element_id::Int,
xi::NTuple{manifold_dim,Vector{Float64}},
nderivatives::Int=0
) where {manifold_dim, num_components, num_patches}Evaluate the basis functions of the finite element space space at the point xi on element element_id up to order nderivatives.
All of our function spaces are built in the parameteric domain. For example, in 1D, let the mapping from canonical coordinates to the i-th parametric element be Φᵢ: [0, 1] -> [aᵢ, bᵢ] then, for a function f defined on the parametric patch, the evaluate method actually returns the values/derivatives of f∘Φᵢ. Consider the function f₀ := f∘Φᵢ. Then, FunctionSpaces.evaluate(f) returns evaluations::Vector{Vector{Vector{Matrix{Float64}}} where evaluations[i][j][k][a,b] is the evaluation of:
the
j-th mixed derivative ...of order
i-1...for the
b-th basis function ...of the
k-th component ...at the
a-th evaluation point ...for
f₀.
See get_derivative_idx for more details on the order in which all the mixed derivatives of order i-1 are stored.
Arguments
space::AbstractFESpace{manifold_dim, num_components, num_patches}: Finite element space.element_id::Int: Index of the element.xi::Points.AbstractPoints{manifold_dim}: Point on the element in canonical coordinates.nderivatives::Int=0: Order of the derivatives. Default is 0 (i.e., function evaluation).
Returns
evaluation::Vector{Vector{Vector{Matrix{Float64}}}}: Values of the basis functions.basis_indices::TI: Global indices of the basis functions. The typeTIis an vector- like object with integer type elements. See the documentation ofspaceorIndicesfor more details.
Mantis.FunctionSpaces.extract_bspline_to_section_space Method
extract_bspline_to_section_space(
knot_vector::KnotVector, canonical_space::AbstractCanonicalSpace
)Compute the extraction coefficients of B-Spline basis functions in terms of canonical basis functions; see [9] [10] [4].
Arguments
knot_vector::KnotVector: The knot vector defining the B-Spline basis.polynomials::AbstractCanonicalSpace: The canonical space to extract to.
Returns
::ExtractionOperator{Indices{1, TE, TI, TJ}}: SeeExtractionOperatorfor the details.
Note
The extraction coefficients E[el] for element el contain the coefficients of the linear combination of reference Canonical polynomials determining the basis functions on that element.
Mantis.FunctionSpaces.extract_gtbspline_to_bspline Method
extract_gtbspline_to_bspline(
spline_spaces::NTuple{m, F}, regularity::Vector{Int}
) where {m, F <: Union{BSplineSpace, RationalFESpace}}Compute the extraction coefficients of GTB-Spline basis functions in terms of (rational) B-spline basis functions.
Arguments
spline_spaces::NTuple{m,F}: Collection of (rational) B-spline spaces.regularity::Vector{Int}: Smoothness to be imposed at patch interfaces.
Returns
ExtractionOperator{Indices{1, TE, TI, TJ}}: The extraction operator containing the coefficients. SeeExtractionOperatorfor the details.
Mantis.FunctionSpaces.extract_monomial_to_bernstein Method
extract_monomial_to_bernstein(polynomial::Bernstein)Computes transformation matrix T that transforms coefficients of a polynomial in terms of the monomial basis into coefficients of in terms of the Bernstein basis.
Arguments
polynomial::Bernstein: Bernstein polynomial
Mantis.FunctionSpaces.extract_scalar_polar_splines_to_tensorproduct Function
extract_scalar_polar_splines_to_tensorproduct(
degenerate_control_points::Array{Float64, 3},
num_basis_r::Int,
two_poles::Bool=false,
zero_at_poles::Bool=nothing
)Build the extraction operator to extract the polar spline basis functions from the tensor product space.
Arguments
degenerate_control_points::Array{Float64, 3}: The degenerate control points.num_basis_r::Int: Number of radial basis functions.two_poles::Bool=false: Whether the polar spline space has two poles.zero_at_poles::Bool=nothing: Whether functions are constrained to zero at poles.
Returns
E::SparseMatrixCSC{Float64,Int}: The extraction operator.tri::Matrix{Float64}: The control triangle.
Mantis.FunctionSpaces.extract_vector_polar_splines_to_tensorproduct Function
extract_vector_polar_splines_to_tensorproduct(
degenerate_control_points::Array{Float64, 3},
num_basis_r::Int;
two_poles::Bool=false
)Build the extraction operator to extract the vector polar spline basis functions w.r.t. the tensor product basis functions.
Arguments
degenerate_control_points::Array{Float64, 3}: The degenerate control points.num_basis_r::Int: Number of radial basis functions.two_poles::Bool=false: Whether the polar spline space has two poles.
Returns
E::Tuple{SparseMatrixCSC{Float64,Int},SparseMatrixCSC{Float64,Int}}: The extraction operators.
The first element corresponds to the horizontal edges and the second element to the vertical edges.
tri::Matrix{Float64}: The control triangle.
Mantis.FunctionSpaces.get_Blk Method
get_Blk(space::HierarchicalFiniteElementSpace, l::Int, k::Int)Returns the basis indices the original space at level l whose support is contained in the domain Ωₖ.
Returns
Vector{Int}: The basis contained in the domainΩₖ.
Mantis.FunctionSpaces.get_active_objects_and_nested_domains Method
get_active_objects_and_nested_domains(
spaces::Vector{S},
two_scale_operators::Vector{T},
domains::HierarchicalActiveInfo,
simplified::Bool,
) where {S <: AbstractFESpace, T <: AbstractTwoScaleOperator}Computes the active elements and basis on each level based on spaces, two_scale_operators and the set of nested domains.
The construction loops over the domains on each level, deactivates basis functions fully supported on the next level's domain, and then selects the active basis in the next level as either the basis functions supported on the domain of the next level, or the children of deactivated basis, based on wheter the space is simplified or not. A similar logic is applied to determine the active elements.
Arguments
spaces::Vector{AbstractFESpace{manifold_dim, num_components, num_patches}}: Finite
element spaces at each level.two_scale_operators::Vector{AbstractTwoScaleOperator}: Two scale operators relating the finite element spaces at each level.domains::HierarchicalActiveInfo: Nested domains where the support of active basis is determined.
Returns
active_elements::HierarchicalActiveInfo: Active elements on each level.active_basis::HierarchicalActiveInfo: Active basis on each level.
Mantis.FunctionSpaces.get_basis_children Method
get_basis_children(operator::TensorProductTwoScaleOperator, basis_id::Int)Retrieve and return the child basis function IDs for a given basis function ID within a tensor product two-scale operator.
Arguments
operator::TensorProductTwoScaleOperator: The tensor product two-scale operator that defines the parent-child relationships between basis functions.basis_id::Int: The identifier of the basis function whose children are to be retrieved.
Returns
::Vector{Int}: A vector containing the identifiers of the child basis functions.
Mantis.FunctionSpaces.get_basis_indices Method
get_basis_indices(space::AbstractFESpace, element_id::Int)Get the global indices of the basis functions of space on element element_id.
Arguments
space::AbstractFESpace: Finite element space.element_id::Int: Identifier of the element.
Returns
::TI: Global indices of the basis functions supported on this element. The typeTIis an vector-like object with integer type elements. See the documentation ofspaceorIndicesfor more details.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_basis_indicesmethod forspaceeither.
Mantis.FunctionSpaces.get_basis_parents Method
get_basis_parents(operator::TensorProductTwoScaleOperator, basis_id::Int)Retrieve and return the parent basis functions for a given basis function ID within a tensor product two-scale operator.
Arguments
operator::TensorProductTwoScaleOperator: The tensor product two-scale operator that defines the parent-child relationships between basis functions.basis_id::Int: The identifier of the basis function whose parent is to be retrieved.
Returns
::Vector{Int}: The identifier of the parent basis functions.
Mantis.FunctionSpaces.get_basis_permutation Function
get_basis_permutation(space::AbstractFESpace, element_id::Int, component_id::Int=1)Get the permutation' of the basis indices. This tells the evaluate function to which basis on an element the evaluations correspond.
Arguments
space::AbstractFESpace: Finite element space.element_id::Int: Identifier of the element.component_id::Int=1: The component ID. This is only relevant for multi-component spaces, and thus defaults to 1. While it is not needed for single-component spaces, it is still required for the function signature.
Returns
::TJ: Permutations of indices of the basis functions supported on this element. The typeTJis a vector-like object with integer type elements. See the documentation ofspaceorIndicesfor more details.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_basis_indicesmethod forspaceeither.
Mantis.FunctionSpaces.get_bisected_canonical_space Method
get_bisected_canonical_space(elem_loc_basis::AbstractCanonicalSpace)This default method returns the given element-local basis. This method should be overloaded for element-local bases that do not satisfy this property or those that need additional parameters; e.g., ECT spaces.
Arguments
elem_loc_basis::AbstractCanonicalSpace: An element-local basis.
Returns
::AbstractCanonicalSpace: The input element-local basis.
Mantis.FunctionSpaces.get_bisected_canonical_space Method
get_child_canonical_space(ect_space::GeneralizedExponential)Bisect the canonical space by dividing the length in half.
Arguments
ect_space::GeneralizedExponential: A generalized exponential space.
Returns
::GeneralizedExponential: A generalized exponential space with the length divided by 2.
Mantis.FunctionSpaces.get_bisected_canonical_space Method
get_bisected_canonical_space(ect_space::GeneralizedTrigonometric)Bisect the canonical space by dividing the length in half.
Arguments
ect_space::GeneralizedTrigonometric: A generalized trigonometric space.
Returns
::GeneralizedTrigonometric: A generalized trigonometric space with the length divided by 2.
Mantis.FunctionSpaces.get_bisected_canonical_space Method
get_bisected_canonical_space(ect_space::Tchebycheff)Bisect the canonical space by dividing the length in half.
Arguments
ect_space::Tchebycheff: A Tchebycheff space.
Returns
::Tchebycheff: A Tchebycheff space with the length divided by 2.
Mantis.FunctionSpaces.get_cart_num_elements Method
get_cart_num_elements(space::TensorProductSpace)See Geometry.get_cart_num_elements.
Mantis.FunctionSpaces.get_child_basis_coefficients Method
get_child_basis_coefficients(coarse_basis_coeffs::Vector{Float64}, operator::AbstractTwoScaleOperator)Perform a change of basis using a two-scale operator from a coarse basis and return the resulting fine basis coefficients.
Arguments
coarse_basis_coeffs::Vector{Float64}: A vector containing the coefficients of the coarse basis.operator::T: The two-scale operator that defines the subdivision process, whereTis a subtype ofAbstractTwoScaleOperator.
Returns
::Vector{Float64}: A vector containing the coefficients of the fine basis after subdivision.
Mantis.FunctionSpaces.get_child_canonical_space Method
get_child_canonical_space(elem_loc_basis::AbstractCanonicalSpace, num_sub_elements::Int)This default method returns the given element-local basis. This method should be overloaded for element-local bases that do not satisfy this property or those that need additional parameters; e.g., ECT spaces.
Arguments
elem_loc_basis::AbstractCanonicalSpace: An element-local basis.num_sub_elements::Int: The number of sub-elements to divide the canonical space into.
Returns
::AbstractCanonicalSpace: The input element-local basis.
Mantis.FunctionSpaces.get_child_canonical_space Method
get_child_canonical_space(ect_space::GeneralizedExponential, num_sub_elements::Int)For number of sub-elements which is powers of 2, bisect the canonical space by dividing the length in half for each power.
Arguments
ect_space::GeneralizedExponential: A generalized exponential space.num_sub_elements::Int: Number of sub-elements to be created.
Returns
::GeneralizedExponential: A generalized exponential space with the subdivided length.
Mantis.FunctionSpaces.get_child_canonical_space Method
get_child_canonical_space(ect_space::GeneralizedTrigonometric, num_sub_elements::Int)For number of sub-elements which is powers of 2, bisect the canonical space by dividing the length in half for each power.
Arguments
ect_space::GeneralizedTrigonometric: A generalized trigonometric space.num_sub_elements::Int: Number of sub-elements to be created.
Returns
::GeneralizedTrigonometric: A generalized trigonometric space with the subdivided length.
Mantis.FunctionSpaces.get_child_space Method
get_child_space(operator::TwoScaleOperator)Retrieve and return the fine space associated with a two-scale operator.
Arguments
operator::TwoScaleOperator: The two-scale operator from which to retrieve the fine space.
Returns
::AbstractFESpace: The fine space associated with the two-scale operator.
Mantis.FunctionSpaces.get_component_spaces Method
get_component_spaces(space::AbstractFESpace)Get the component spaces of the (multi-)component finite element space. For a single component space, this function will return the original space. Note that, in the most general case, the component spaces are not necessarily single-patch spaces, and the component spaces may contribute to multiple components.
Arguments
space::AbstractFESpace: A (multi-)component finite element space.
Returns
component_spaces::Tuple{AbstractFESpace}: Tuple of single-component spaces.
Mantis.FunctionSpaces.get_constituent_basis_id Method
get_constituent_basis_id(space::TensorProductSpace, basis_id::Int)Returns a tuple corresponding to the conversion of basis_id in tensor-product numbering to constituent-wise numbering.
Mantis.FunctionSpaces.get_constituent_basis_indices Method
get_constituent_basis_indices(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
element_id::Int,
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise basis indices supported on element_id.
See also get_basis_indices.
Mantis.FunctionSpaces.get_constituent_element_id Method
get_constituent_element_id(space::TensorProductSpace, element_id::Int)Returns a tuple corresponding to the conversion of element_id in tensor-product numbering to constituent-wise numbering.
Mantis.FunctionSpaces.get_constituent_evaluation_points Method
get_constituent_evaluation_points(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise splitting of xi according to each constituent space's manifold dimension.
Mantis.FunctionSpaces.get_constituent_evaluations Method
get_constituent_evaluations(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
element_id::Int,
xi::Points.AbstractPoints{manifold_dim},
nderivatives::Int=0,
) where {manifold_dim, num_components, num_patches, num_spaces}Get evaluations of all constituent spaces at element_id and points xi.
Mantis.FunctionSpaces.get_constituent_extraction Method
get_constituent_extraction(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
element_id::Int,
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise extraction at element_id.
See also get_extraction.
Mantis.FunctionSpaces.get_constituent_local_basis Method
get_constituent_local_basis(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
element_id::Int,
xi::Points.AbstractPoints{manifold_dim},
nderivatives::Int=0,
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise local basis evaluation at element_id and points xi.
See also get_local_basis.
Mantis.FunctionSpaces.get_constituent_manifold_dim Method
get_constituent_manifold_dim(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces}
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise manifold dimension.
sourceMantis.FunctionSpaces.get_constituent_manifold_indices Method
get_constituent_manifold_indices(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces}
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple of ranges corresponding to the constituent-wise splitting manifold_dim, use to iterate over each manifold dimension of each constituent space.
Mantis.FunctionSpaces.get_constituent_num_basis Method
get_constituent_num_basis(space::TensorProductSpace)Returns a tuple corresponding to the constituent-wise number of basis functions — or dimension.
sourceMantis.FunctionSpaces.get_constituent_num_basis Method
get_constituent_num_basis(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
element_id::Int,
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise number of basis functions supported on element_id.
Mantis.FunctionSpaces.get_constituent_polynomial_degree Method
get_constituent_polynomial_degree(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces}
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise polynomial degree. Note that get_polynomial_degree is not necessarily defined for every constituent space.
See also get_polynomial_degree.
Mantis.FunctionSpaces.get_constituent_space Method
get_constituent_space(space::TensorProductSpace, space_id::Int)Returns the constituent space numbered space_id of the tensor product space.
Mantis.FunctionSpaces.get_constituent_support Method
get_constituent_support(
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces},
basis_id::Int,
) where {manifold_dim, num_components, num_patches, num_spaces}Returns a tuple corresponding to the constituent-wise support of the basis function identified by basis_id.
See also get_support.
Mantis.FunctionSpaces.get_contained_knot_vector Method
get_contained_knot_vector(
boundary_breakpoints::NTuple{2, Int},
ts::AbstractTwoScaleOperator,
fine_space::BSplineSpace,
)Returns a KnotVector corresponding to the largest subset of the knot-vector defining fine_space that is contained between boundary_breakpoints.
Returns
KnotVector: The largest knot-vector contained betweenboundary_breakpoints.
Mantis.FunctionSpaces.get_derivative_space Method
get_derivative_space(elem_loc_basis::AbstractCanonicalSpace)This default method returns the element-local basis of one degree lower than the given element-local basis. This method should be overloaded for element-local bases that do not satisfy this property or those that need additional parameters; e.g., ECT spaces.
Arguments
elem_loc_basis::AbstractCanonicalSpace: An element-local basis.
Returns
::AbstractCanonicalSpace: The element-local basis of one degree lower than the given element-local basis.
Mantis.FunctionSpaces.get_derivative_space Method
get_derivative_space(space::BSplineSpace)Returns the derivative space of the B-spline space.
Arguments
space::BSplineSpace: The B-spline space.
Returns
::BSplineSpace: The derivative space.
Mantis.FunctionSpaces.get_derivative_space Method
get_derivative_space(ect_space::GeneralizedExponential)Get the space of one degree lower than the input space. Assumes that the degree of the space is at least 2.
Arguments
ect_space::GeneralizedExponential: A generalized exponential space.
Returns
::GeneralizedExponential: A generalized exponential space of one degree lower than the input space.
Mantis.FunctionSpaces.get_derivative_space Method
get_derivative_space(ect_space::GeneralizedTrigonometric)Get the space of one degree lower than the input space. Assumes that the degree of the space is at least 2.
Arguments
ect_space::GeneralizedTrigonometric: A generalized trigonometric space.
Returns
::GeneralizedTrigonometric: A generalized trigonometric space of one degree lower than the input space.
Mantis.FunctionSpaces.get_derivative_space Method
get_derivative_space(ect_space::Tchebycheff)Get the space of one degree lower than the input space. Requires that the input space has the zero root with multiplicity at least 1.
Arguments
ect_space::Tchebycheff: A Tchebycheff space.
Returns
::Tchebycheff: A Tchebycheff space of one degree lower than the input space.
Mantis.FunctionSpaces.get_dof_partition Method
get_dof_partition(space::AbstractFESpace)Retrieve and return the degrees of freedom (d.o.f.s) partition for space.
Arguments
space::AbstractFESpace: Single-component finite element space.
Returns
::Vector{Vector{Vector{Int}}}: Nested d.o.f. partition. The first level of nesting corresponds to the patch. The second level corresponds to the division (see ... for its definition). The third level corresponds to the individual d.o.f.s.
Mantis.FunctionSpaces.get_dorfler_marking Method
get_dorfler_marking(element_errors::Vector{Float64}, dorfler_parameter::Float64)Computes the indices of elements with at least dorfler_parameter*100% of the highest error in element_errors.
Arguments
element_errors::Vector{Float64}: element-wise errors.dorfler_parameter::Float64: dorfler parameter determing how many elements are selected.
Returns
::Vector{Int}: indices of elements with at leastdorfler_parameter*100% of the highest
error.Mantis.FunctionSpaces.get_element_ancestor Method
get_element_ancestor(two_scale_operators, child_element_id::Int, child_level::Int, num_ancestor_levels::Int)Compute and return the ancestor element ID for a given child element ID within a specified number of ancestor levels.
Arguments
two_scale_operators: A collection of operators that define the parent-child relationships between elements at different levels.child_element_id::Int: The identifier of the child element w.r.t.child_level.child_level::Int: The level of the child element.num_ancestor_levels::Int: The number of ancestor levels to traverse.
Returns
ancestor_id::Int: The identifier of the ancestor element.
Mantis.FunctionSpaces.get_element_children Method
get_element_children(operator::TensorProductTwoScaleOperator, element_id::Int)Retrieve and return the child element IDs for a given element ID within a tensor product two-scale operator.
Arguments
operator::TensorProductTwoScaleOperator: The tensor product two-scale operator that defines the parent-child relationships between elements.element_id::Int: The identifier of the element whose children are to be retrieved.
Returns
::Vector{Int}: A vector containing the identifiers of the child elements.
Mantis.FunctionSpaces.get_element_lengths Method
get_element_lengths(space::AbstractFESpace, element_id::Int)Computes the length, in each manifold dimension, of the element given by element_id of the geometry on which the space is build.
Arguments
'space::AbstractFESpace': A finite element space.
'element_id::Int': Index of the element being considered.
Returns
- '<:NTuple{manifold_dim, Number}': The element's lengths.
Mantis.FunctionSpaces.get_element_measure Method
get_element_measure(space::AbstractFESpace, element_id::Int)Computes the measure of the element given by element_id of the geometry on which the space is build.
Arguments
'space::AbstractFESpace': A finite element space.
'element_id::Int': Index of the element being considered.
Returns
- '<:Number': The measure of the element.
Mantis.FunctionSpaces.get_element_parent Method
get_element_parent(operator::TensorProductTwoScaleOperator, element_id::Int)Retrieve and return the parent element ID for a given element ID within a tensor product two-scale operator.
Arguments
operator::TensorProductTwoScaleOperator: The tensor product two-scale operator that defines the parent-child relationships between elements.element_id::Int: The identifier of the element whose parent is to be retrieved.
Returns
::Int: The identifier of the parent element.
Mantis.FunctionSpaces.get_element_vertices Method
get_element_vertices(space::AbstractFESpace, element_id::Int)Computes the vertices, in each manifold dimension, of the element given by element_id of the geometry on which the space is build.
Arguments
'space::AbstractFESpace': A finite element space.
'element_id::Int': Index of the element being considered.
Returns
- '<:NTuple{manifold_dim, NTuple{2, Number}}': The element's vertices per manifold dim. For example, for the unit cube [0.0, 1.0]^3 this will be: ((0.0, 1.0), (0.0, 1.0), (0.0, 1.0)).
Mantis.FunctionSpaces.get_extraction Function
get_extraction(space::AbstractFESpace, element_id::Int, component_id::Int=1)Returns the extraction coefficients and indices of the supported basis functions on the given element element_id for the given component component_id.
Arguments
space::AbstractFESpace: A finite element space.element_id::Int: Identifier of the element.component_id::Int=1: The component ID. This is only relevant for multi-component spaces, and thus defaults to 1. While it is not needed for single-component spaces, it is still required for the function signature.
Returns
::Matrix{Float64}: The extraction coefficients.::Vector{Int}: The (global) basis functions supported on this element.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_extractionmethod forspaceeither.
Mantis.FunctionSpaces.get_extraction_coefficients Function
get_extraction_coefficients(
space::AbstractFESpace, element_id::Int, component_id::Int=1
)Returns the extraction coefficients on the given element.
Arguments
space::AbstractFESpace: A finite element space.element_id::Int: Identifier of the element.component_id::Int=1: The component ID. This is only relevant for multi-component spaces, and thus defaults to 1. While it is not needed for single-component spaces, it is still required for the function signature.
Returns
::Matrix{Float64}: The extraction coefficients on the requested element.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_extraction_coefficientsmethod forspaceeither.
Mantis.FunctionSpaces.get_extraction_operator Method
get_extraction_operator(space::AbstractFESpace)Returns the extraction operator of the given space.
Not all AbstractFESpaces have an extraction operator.
Having an explicitly defined extraction operator is not required for building a finite element space.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::ExtractionOperator: The extraction operator.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no explicitly defined extraction operator is present for this
space.
Mantis.FunctionSpaces.get_finer_canonical_space Method
get_finer_canonical_space(ect_space::Tchebycheff, num_sub_elements::Int)Bisect the canonical space by dividing the length in half for each power.
Arguments
ect_space::Tchebycheff: A Tchebycheff space.num_sub_elements::Int: Number of sub-elements to be created.
Returns
::Tchebycheff: A Tchebycheff space with the subdivided length.
Mantis.FunctionSpaces.get_first_knot_index Method
get_first_knot_index(knot_vector::KnotVector, breakpoint_index::Int)Get the index of the first knot corresponding to a given breakpoint.
Arguments
knot_vector::KnotVector: The knot vector.breakpoint_index::Int: Index of the breakpoint.
Returns
::Int: Index of the first knot for the given breakpoint.
Mantis.FunctionSpaces.get_geometry Method
get_geometry(space::AbstractFESpace)Get the geometry underlying the given space.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::AbstractGeometry: The underlying geometry.
Mantis.FunctionSpaces.get_global_element_id Method
get_global_element_id(space::AbstractFESpace, patch_id::Int, local_element_id::Int)Get the global element ID of the underlying geometry for the specified constituent patch ID and local element ID.
Arguments
space::AbstractFESpace: A finite element space.patch_id::Int: The constituent patch ID.local_element_id::Int: The local element ID.
Returns
::Int: The global element ID.
Mantis.FunctionSpaces.get_global_subdiv_matrix Method
get_global_subdiv_matrix(operator::AbstractTwoScaleOperator)Retrieve and return the global subdivision matrix associated with a two-scale operator.
Arguments
operator::AbstractTwoScaleOperator: The two-scale operator from which to retrieve the global subdivision matrix.
Returns
::SparseArrays.SparseMatrixCSC{Float64, Int}: The global subdivision matrix associated with the two-scale operator.
Mantis.FunctionSpaces.get_greville_points Method
get_greville_points(knot_vector::KnotVector)Compute the Greville points for the given knot vector.
Arguments
knot_vector::KnotVector: The knot vector.
Returns
::Tuple{Vector{Float64}}: Vector of Greville points.
Mantis.FunctionSpaces.get_greville_points Method
get_greville_points(space::TensorProductSpace{manifold_dim, T}) where {
manifold_dim, num_spaces, T <: NTuple{num_spaces, BSplineSpace}
}Compute the Greville points for a TensorProductSpace composed of BSplineSpaces.
Arguments
space::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces, T}: The tensor product space containingBSplineSpaces.
Returns
::NTuple{manifold_dim, Vector{Float64}}: A tuple of vectors containing the Greville points for each dimension of the tensor product space.
Mantis.FunctionSpaces.get_interaction_box Method
get_interaction_box(
space::HierarchicalFiniteElementSpace{2}, level::Int, Blk::Vector{Int}, βᵢ::Int
)Returns a list of basis functions that are at most p[k]+1 away from βᵢ in index space for each manifold dimension k, where p[k] is the polynomial degree.
Returns
Vector{Int}: The list of basis functions interacting withβᵢ.
Mantis.FunctionSpaces.get_knot_multiplicity Method
get_knot_multiplicity(knot_vector::KnotVector, knot_index::Int)Retrieves the multiplicity of the breakpoint corresponding to knot_vector at knot_index, i.e., the index of the vector where every breakpoint[i] appears knot_vector.multiplicity[i]-times.
Arguments
knot_vector::KnotVector: Knot vector for length calculation.knot_index::Int: Index in the knot vector.
Returns
::Int: Multiplicity of the breakpoint corresponding toknot_index.
Mantis.FunctionSpaces.get_knot_value Method
get_knot_value(knot_vector::KnotVector, knot_index::Int)Retrieves the breakpoint corresponding to knot_vector at knot_index, i.e., the index of the vector where every breakpoint[i] appears knot_vector.multiplicity[i]-times.
Arguments
knot_vector::KnotVector: Knot vector for length calculation.knot_index::Int: Index in the knot vector.
Returns
::Number: Breakpoint corresponding toknot_index.
Mantis.FunctionSpaces.get_knot_vector Method
get_knot_vector(space::BSplineSpace)Returns the knot vector object of the B-spline space space.
Arguments
space::BSplineSpace: The B-spline space.
Returns
::KnotVector: The knot vector of the B-spline space.
Mantis.FunctionSpaces.get_knot_vector_length Method
get_knot_vector_length(knot_vector::KnotVector)Determines the length of knot_vector by summing the multiplicities of each knot vector.
Arguments
knot_vector::KnotVector: Knot vector for length calculation.
Returns
::Int: Length of the knot vector.
Mantis.FunctionSpaces.get_last_knot_index Method
get_last_knot_index(knot_vector::KnotVector, breakpoint_index::Int)Get the index of the last knot corresponding to a given breakpoint.
Arguments
knot_vector::KnotVector: The knot vector.breakpoint_index::Int: Index of the breakpoint.
Returns
::Int: Index of the last knot for the given breakpoint.
Mantis.FunctionSpaces.get_lchain_corner Method
get_lchain_corner(
space::HierarchicalFiniteElementSpace{2},
level::Int,
Blk::Vector{Int},
(βᵢ, βⱼ)::Tuple{Int, Int},
)Returns a corner basis function of an L-chain between βᵢ and βⱼ, with preference for resolved corners.
Returns
Int: The id of the corner basis function.
Mantis.FunctionSpaces.get_lin_num_elements Method
get_lin_num_elements(space::TensorProductSpace)See Geometry.get_lin_num_elements.
Mantis.FunctionSpaces.get_local_basis Method
get_local_basis(
space::AbstractFESpace{manifold_dim, num_components, num_patches},
element_id::Int,
xi::NTuple{manifold_dim,Vector{Float64}},
nderivatives::Int,
component_id::Int=1,
) where {manifold_dim, num_components, num_patches}Evaluates the local basis functions used to construct the finite element space space. The default for multi-component spaces are the component spaces. There is no default for single- component spaces. Single-component spaces are expected to have a specialised implementation.
Arguments
space::AbstractFESpace{manifold_dim, num_components, num_patches}: A finite element space.element_id::Int: The indentifier of the element.xi::Points.AbstractPoints{manifold_dim}: The coordinates at which to evaluate the basis functions. These coordinates are in the canonical domain, and thus always lie in the interval[0, 1]. The coordinates have to be given per dimension. Multi- dimensional spaces are evaluated on the tensor product of the given coordinates.nderivatives::Int: The number of derivatives to compute.component_id::Int=1: The component ID. This is only relevant for multi-component spaces, and thus defaults to 1. While it is not needed for single-component spaces, it is still required for the function signature.
Returns
::Vector{Vector{Vector{Matrix{Float64}}}}: A nested vector structure containing the local basis functions and their derivatives. The first level of nesting corresponds to the order of the derivatives. The second level corresponds to a specific derivative. The third level corresponds to the component. The matrix contains the actual evaluations. Seeget_derivative_idxfor more details on the order in which the derivatives are stored.
Mantis.FunctionSpaces.get_local_knot_vector Method
get_local_knot_vector(knot_vector::KnotVector, basis_id::Int)Returns the local knot vector necessary to characterize the B-spline identified by basis_id.
Arguments
knot_vector::KnotVector: The knot vector of the full B-spline basis.basis_id::Int: The id of the B-spline.
Returns
::KnotVector: The knot vector of the B-spline identified bybasis_id.
Mantis.FunctionSpaces.get_local_pairs Method
get_local_pairs(
space::HierarchicalFiniteElementSpace{2},
level::Int,
Blk::Vector{Int},
unchecked::Vector{Int},
)Returns a list of pairs of basis functions that need to be checked for problems from a set of unchecked basis functions.
Arguments
unchecked::Vector{Int}: A list of unresolved basis functions.
Returns
Vector{Tuple{Int, Int}}: The list of possibly problematic pairs.
See also initiate_pairs and is_resolved.
Mantis.FunctionSpaces.get_local_subdiv_matrix Method
get_local_subdiv_matrix(operator::AbstractTwoScaleOperator, coarse_element_id::Int, fine_element_id::Int)Retrieve and return the local subdivision matrix for a given pair of coarse and fine elements within a two-scale operator.
Arguments
operator::AbstractTwoScaleOperator: The two-scale operator that defines the subdivision process.coarse_element_id::Int: The identifier of the coarse element.fine_element_id::Int: The identifier of the fine element.
Returns
::Matrix{Float64}: The local subdivision matrix corresponding to the specified coarse and fine elements.
Mantis.FunctionSpaces.get_max_local_dim Method
get_max_local_dim(space::AbstractFESpace)Compute an upper bound of the element-local dimension of space. Note that this is not necessarily a tight upper bound.
The fallback computation for multi-component spaces is a very conservative estimate to avoid having to loop over all elements, computing the union of all active basis functions, and returning the length of the largest union.
For single-component spaces, there is no general fallback.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::Int: The element-local upper bound.
Exceptions
- Error "'get_max_local_dim' not implemented": This error is thrown if no 'get_max_local_dim' method is defined for a single-component space (which can be a component of a multi- component space).
Mantis.FunctionSpaces.get_multilevel_extraction Method
get_multilevel_extraction(
spaces::Vector{S},
two_scale_operators::Vector{T},
active_elements::HierarchicalActiveInfo,
active_basis::HierarchicalActiveInfo,
truncated::Bool,
) where {manifold_dim, num_components, num_patches, S <: AbstractFESpace{manifold_dim, num_components, num_patches}, T <: AbstractTwoScaleOperator}Computes which elements are multilevel elements, i.e. elements for which basis from multiple levels have non-emtpy support, as well as their extraction coefficients matrices and active basis indices.
The extraction coefficients depend on whether the hierarchical space is truncated or not.
Arguments
spaces::Vector{AbstractFESpace{manifold_dim, num_components, num_patches}}: finite element spaces at each level.two_scale_operators::Vector{AbstractTwoScaleOperator}: two scale operators relating the finite element spaces at each level.active_elements::HierarchicalActiveInfo: active elements on each level.active_basis::HierarchicalActiveInfo: active basis on each level.truncated: flag for a truncated hierarchical space.
Returns
multilevel_elements::SparseArrays.SparseVector{Int, Int}: elements where basis from multiple levels have non-empty support.multilevel_extraction_coeffs::Vector{Matrix{Float64}}: extraction coefficients of active basis inmultilevel_elements.multilevel_basis_indices::Vector{Vector{Int}}: indices of active basis inmultilevel_elements.
Mantis.FunctionSpaces.get_multilevel_information Method
get_multilevel_information(
spaces::Vector{S},
two_scale_operators::Vector{T},
active_elements::HierarchicalActiveInfo,
active_basis::HierarchicalActiveInfo,
) where {manifold_dim, num_components, num_patches, S <: AbstractFESpace{manifold_dim, num_components, num_patches}, T <: AbstractTwoScaleOperator}Computes which active elements are multilevel elements, i.e. elements where basis from multiple levels have non-empty support, as well as which basis from parentr levels are active on those elements.
Arguments
spaces::Vector{AbstractFESpace{manifold_dim, num_components, num_patches}}: finite element spaces at each level.two_scale_operators::Vector{AbstractTwoScaleOperator}: two scale operators relating the finite element spaces at each level.active_elements::HierarchicalActiveInfo: active elements on each level.active_basis::HierarchicalActiveInfo: active basis on each level.
Returns
multilevel_information::Dict{Tuple{Int, Int}, Vector{Tuple{Int, Int}}}: information about multilevel elements. The key's two indices indicate the multilevel element's level and id and the and the key's value is a vector of tuples where the indices are the basis level and id (from parentr levels), respectively.
Mantis.FunctionSpaces.get_multiplicity Method
get_multiplicity(knot_vector::KnotVector)Returns the multiplicity of each knot in knot_vector.
Arguments
knot_vector::KnotVector.
Returns
<:AbstractVector{Int}: Multiplicity of each knot.
Mantis.FunctionSpaces.get_multiplicity_vector Method
get_multiplicity_vector(space::BSplineSpace)Returns the multiplicities of the knot vector associated with the univariate function space space.
Arguments
space::BSplineSpace: The B-Spline function space.
Returns
::Vector{Int}: The multiplicity of the knot vector associated with the B-Spline space.
Mantis.FunctionSpaces.get_num_basis Method
get_num_basis(space::AbstractFESpace, element_id::Int)Get the number of basis functions of the finite element space space supported on element element_id.
Arguments
space::AbstractFESpace: Finite element space.element_id::Int: Indentifier of the element.
Returns
::Int: Number of basis functions supported on the given element.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_num_basismethod forspaceeither.
Mantis.FunctionSpaces.get_num_basis Method
get_num_basis(space::AbstractFESpace)Returns the number of basis functions of the finite element space space.
Arguments
space::AbstractFESpace: Finite element space.
Returns
::Int: Number of basis functions spanning the finite element space.
Exceptions
- Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for
space, and there is no specificget_num_basismethod forspaceeither.
Mantis.FunctionSpaces.get_num_elements Method
get_num_elements(space::AbstractFESpace)Returns the total number of elements of the geometry on which the space is build.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::Int: The number of elements.
Mantis.FunctionSpaces.get_num_elements_per_patch Method
get_num_elements_per_patch(space::AbstractFESpace)Get the number of elements per patch of the underlying geometry.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::NTuple{num_patches, Int}: The number of elements per patch.
Mantis.FunctionSpaces.get_num_spaces Method
get_num_spaces(
::TensorProductSpace{manifold_dim, num_components, num_patches, num_spaces}
) where {manifold_dim, num_components, num_patches, num_spaces}Returns the number of constituent spaces in a given TensorProductSpace.
Mantis.FunctionSpaces.get_padding_per_level Method
get_padding_per_level(
space::HierarchicalFiniteElementSpace, marked_elements::Vector{Int};
)Separates a list of marked_elements in hierarchical indexing into level-wise indexing, and adds a padding to each level.
See also convert_element_vector_to_elements_per_level and add_padding!.
Arguments
space::HierarchicalFiniteElementSpace: The hierarchical finite element space.marked_elements::Vector{Int};: The list of marked elements in hierarchical indexing.
Returns
element_ids_per_level::Vector{Vector{Int}}: Level-wise indexing of marked elements.
Mantis.FunctionSpaces.get_parametric_geometry Method
get_parametric_geometry(space::AbstractFESpace)Get the parametric geometry underlying the given space.
Arguments
space::AbstractFESpace: A finite element space.
Returns
::AbstractGeometry: The underlying parametric geometry.
Mantis.FunctionSpaces.get_parent_function Method
get_parent_function(space::HierarchicalFiniteElementSpace, level::Int, βᵢ::Int)Returns the first basis function of βᵢ.
Returns
Int: The id of the parent basis function.
Mantis.FunctionSpaces.get_parent_space Method
get_coarse_space(operator::TwoScaleOperator)Retrieve and return the coarse space associated with a two-scale operator.
Arguments
operator::TwoScaleOperator: The two-scale operator from which to retrieve the coarse space.
Returns
::AbstractFESpace: The coarse space associated with the two-scale operator.
Mantis.FunctionSpaces.get_patch_and_local_element_id Method
get_patch_and_local_element_id(space::AbstractFESpace, element_id::Int)Get the constituent patch ID and local element ID of the underlying geometry for the specified global element ID.
Arguments
space::AbstractFESpace: A finite element space.element_id::Int: The global element ID.
Returns
patch_id::Int: The patch IDlocal_element_id::Int: The local element ID.
Mantis.FunctionSpaces.get_patch_id Method
get_patch_id(space::AbstractFESpace, element_id::Int)Get the ID of the patch of the underlying geometry to which the specified global element belongs.
Arguments
space::AbstractFESpace: A finite element space.element_id::Int: The global element ID.
Returns
::Int: ID of the patch to which the element belongs.
Mantis.FunctionSpaces.get_polynomial_degree Method
get_polynomial_degree(elem_loc_basis::AbstractCanonicalSpace)Returns the polynomial degree of the element-local basis.
Arguments
elem_loc_basis::AbstractCanonicalSpace: An element-local basis.
Returns
::Int: The polynomial degree of the element-local basis.
Mantis.FunctionSpaces.get_polynomial_degree Method
get_polynomial_degree(space::RationalFESpace, element_id::Int)Returns the polynomial degree (or the degree of the underlying function space) of the rational finite element space for a specific element.
Arguments
space::RationalFESpace: The rational finite element space.element_id::Int: The index of the element.
Returns
The polynomial degree (or the degree of the underlying function space) of the rational finite element space for the specified element.
sourceMantis.FunctionSpaces.get_polynomials Method
get_polynomials(space::BSplineSpace)Returns the reference Bernstein polynomials of space.
Arguments
space::BSplineSpace: A univariate B-Spline function space.
Returns
::Bernstein: Bernstein polynomials.
Mantis.FunctionSpaces.get_support Method
get_support(space::BSplineSpace, basis_id::Int)Returns the elements where the B-spline given by basis_id is supported.
Arguments
space::BSplineSpace: The B-Spline function space.basis_id::Int: The id of the basis function.
Returns
::Vector{Int}: The support of the basis function.
Mantis.FunctionSpaces.gexp_representation Method
gexp_representation(p::Int, w::Float64, t::Bool, m::Int)Build representation matrix for Generalized Exponential section space of degree p, weight w, and length l.
Arguments
p::Int: Degree of the space.w::Float64: Weight parameter for the space.l::Float64: Length of the interval. GExp space is not scale-invariant.t::Bool: flag to indicate if critical length is exceeded.m::Int: number of terms from the infinite sum used to build the basis.
Returns:
C::Matrix{Float64}: representation matrix for the local basis.
Mantis.FunctionSpaces.has_minimal_intersection Method
has_minimal_intersection(
space::HierarchicalFiniteElementSpace{2}, level::Int, (βᵢ, βⱼ)::Tuple{Int, Int}
)Checks whether a (βᵢ, βⱼ) share a minimal-(l+1) intersection.
Returns
Bool: Whether the pair shares a minimal intersection.
Mantis.FunctionSpaces.has_shortest_chain Method
has_shortest_chain(
space::HierarchicalFiniteElementSpace{2},
level::Int,
Blk::Vector{Int},
(βᵢ, βⱼ)::Tuple{Int, Int},
)Checks whether a (βᵢ, βⱼ) have a shortest chain between them.
Returns
Bool: Whether(βᵢ, βⱼ)have a shortest chain between them.
Mantis.FunctionSpaces.initiate_pairs Method
initiate_pairs(
space::HierarchicalFiniteElementSpace{2},
level::Int,
Blk::Vector{Int},
marked_els::Vector{Int},
)Generates all the possibly problematic pairs at level that need to be checked for problems.
Returns
Vector{Tuple{Int, Int}}: The pairs that need to be checked for problems.
See also update_space_with_lchains!, get_Blk and get_local_pairs.
Mantis.FunctionSpaces.is_problematic Method
is_problematic(
space::HierarchicalFiniteElementSpace{2},
level::Int,
Blk::Vector{Int},
(βᵢ, βⱼ)::Tuple{Int, Int},
)Checks whether a (βᵢ, βⱼ) is a problematic pair.
Returns
Bool: Whether the pair is problematic.
Mantis.FunctionSpaces.is_resolved Method
is_resolved(
space::HierarchicalFiniteElementSpace{2}, level::Int, Blk::Vector{Int}, βᵢ::Int
)Checks whether the basis function βᵢ at level is resolved or not.
Returns
Bool: Whetherβᵢis resolved.
Mantis.FunctionSpaces.refine_mesh! Method
refine_mesh!(
space::HierarchicalFiniteElementSpace, level::Int, marked_elements::Vector{Int}
)Updates the hierarchical mesh underlying space based on marked_elements_per_level at level.
Returns
space::HierarchicalFiniteElementSpace: Space with refined mesh atlevel.
Mantis.FunctionSpaces.refine_mesh! Method
refine_mesh!(
space::HierarchicalFiniteElementSpace, marked_elements_per_level::Vector{Vector{Int}}
)Updates the hierarchical mesh underlying space based on marked_elements_per_level.
Returns
space::HierarchicalFiniteElementSpace: Space with refined mesh.
Mantis.FunctionSpaces.refine_polar_geometry_data Method
refine_polar_geometry_data(P_geom, geom_coeffs_polar; two_poles=false)Refine the polar geometry data.
Arguments
P_geom: The polar spline geometry space.geom_coeffs_polar: The polar geometry coefficients.two_poles: Whether the polar geometry contains two poles.
Returns
P_geom_ref: The refined polar spline geometry space.geom_coeffs_polar_tp_ref: The refined polar geometry coefficients.
Mantis.FunctionSpaces.single_knot_insertion_oslo Method
single_knot_insertion_oslo(
parent_knot_vector::KnotVector, child_knot_vector::KnotVector, cf::Int, rf::Int
)Algorithm for the coefficients of a change of B-spline representation for a single knot insertion. The parent knot vector is parent_knot_vector and the inserted knot is given by child_knot_vector.
For more information, see A note on the Oslo Algorithm.
Arguments
parent_knot_vector::KnotVector: parent knot vector.child_knot_vector::KnotVector: child knot vector, with the extra knot.cf::Int: Index of the parent knot vector.rf::Int: Index of the child knot vector such thatget_knot_value(parent_knot_vector,cf) <= get_knot_value(child_knot_vector,rf) < get_knot_value(parent_knot_vector,cf+1).
Returns
b::Vector{Float64}: Coefficients for the change of basis.
Mantis.FunctionSpaces.subdivide_breakpoints Method
subdivide_breakpoints(parent_breakpoints::Vector{Float64}, num_subdivisions::Int)Subdivides parent_breakpoints by uniformly subdiving each element num_subdivisions times.
Arguments
parent_breakpoints::AbstractVector: Parent set of breakpoints.num_subdivisions: Number of times each element is subdivided.
Returns
child_breakpoints::Vector{Float64}: Child set of breakpoints.
Mantis.FunctionSpaces.subdivide_geometry Method
subdivide_geometry(parent_geo::Geometry.AbstractGeometry, num_subdivisions)Returns a refined version of parent_geo where each element is subdivided according to num_subdivisions.
Returns
child_geometry: The geometry corresponding to the subdivision ofparent_geo.
Mantis.FunctionSpaces.subdivide_knot_vector Method
subdivide_knot_vector(
parent_knot_vector::KnotVector, num_subdivisions::Int, child_multiplicity::Int
)Subdivides parent_knot_vector by uniformly subdiving each element num_subdivisions times. The parent multiplicities are preserved in the child_multiplicity_vector, and newly inserted ones are given multiplicity child_multiplicity.
Arguments
parent_knot_vector::KnotVector: parent knot vector.num_subdivisions::Int: Number of times each element is subdivided.child_multiplicity::Int: Multiplicity of each new knot.
Returns
::KnotVector: child knot vector.
Mantis.FunctionSpaces.subdivide_multiplicity_vector Function
subdivide_multiplicity_vector(
parent_multiplicity::Vector{Int}, num_subdivisions::Int, child_multiplicity::Int
)Subdivides parent_multiplicity by uniformly subdiving each element num_subdivisions times. The parent multiplicities are preserved in the child_multiplicity_vector, and newly inserted ones are given multiplicity child_multiplicity.
Arguments
parent_multiplicity::Vector{Int}: parent multiplicity vector.num_subdivisions::Int: Number of times each element is subdivided.child_multiplicity::Int: Multiplicity of each new knot.
Returns
child_multiplicity_vector::Vector{Int}: child multiplicity vector.
Mantis.FunctionSpaces.subdivide_space Function
subdivide_space(
parent_bspline::BSplineSpace, num_subdivisions::Int, child_multiplicity::Int
)Subdivides parent_bspline by uniformly subdiving each element num_subdivisions times. The parent multiplicities are preserved in the final multiplicity vector, and newly inserted ones are given multiplicity child_multiplicity.
Arguments
parent_bspline::BSplineSpace: parent B-spline.num_subdivisions::Int: Number of times each element is subdivided.child_multiplicity::Int: Multiplicity of each new knot.
Returns
::BSplineSpace: refined B-spline space.
Mantis.FunctionSpaces.subdivide_space Method
subdivide_space(
space::TensorProductSpace{manifold_dim, num_components, num_patches, T},
nsubdivisions::NTuple{num_spaces, Int}
) where {
manifold_dim,
num_components,
num_patches,
num_spaces,
T <: NTuple{num_spaces, AbstractFESpace},
}Subdivide the finite element spaces within a tensor product space and return the resulting finer tensor product space.
Arguments
space::TensorProductSpace: The tensor product space containing finite element spaces to be subdivided.nsubdivisions::NTuple{num_spaces, Int}: A tuple specifying the number of subdivisions for each finite element space.
Returns
::TensorProductSpace: The resulting finer tensor product space after subdivision.
Mantis.FunctionSpaces.tcheb_representation Method
tcheb_representation(p::Int, roots::Matrix{Float64}, root_mult::Vector{Int}, root_type::Vector{Int},
l::Float64, mu::Vector{Int})Build representation matrix for Tchebycheff section space of degree p, roots roots, root multiplicities root_mult, root types root_type, length l, and cumulative dimensions mu.
Arguments
p::Int: Degree of the space.roots::Matrix{Float64}: (real, imag) pairs of roots.root_mult::Vector{Int}: Multiplicities of roots.root_type::Vector{Int}: Types of roots: 0=zero, 1=real, 2=imaginary, 3=complex.l::Float64: Length of the interval.mu::Vector{Int}: Cumulative dimension for the roots.
Returns
C::Matrix{Float64}: Representation matrix for the local basis.
Mantis.FunctionSpaces.truncate_refinement_matrix! Method
truncate_refinement_matrix!(refinement_matrix, active_indices::Vector{Int})Updates refinement_matrix by the rows of active_indices to zeros in lower level basis functions.
Arguments
refinement_matrix: the refinement matrix to be updated.active_indices::Vector{Int}: element local indices of active basis functions from the highest refinement level.
Returns
refinement_matrix: truncated refinement matrix.
Mantis.FunctionSpaces.update_basis! Method
update_basis!(space::HierarchicalFiniteElementSpace)Updates the hierarchical basis underlying space, after the latter has had mesh refinement.
Returns
space::HierarchicalFiniteElementSpace: Space with updated hierarchical basis.
Mantis.FunctionSpaces.update_space! Method
update_space!(
space::HierarchicalFiniteElementSpace, marked_elements_per_level::Vector{Vector{Int}}
)Updates the given hierarchical space based on marked_elements_per_level.
Returns
space::HierarchicalFiniteElementSpace: The updated space.
See also refine_mesh! and update_basis!.
Mantis.FunctionSpaces.update_space_with_lchains! Method
update_space_with_lchains!(
space::HierarchicalFiniteElementSpace{2}, marked_els::Vector{Vector{Int}}
)Takes as input a space corresponding to an exact de Rham complex and a set of marked_els for refinement, and returns a refined space corresponding to an exact complex by adding L-chains where needed. We refer the reader to [11] for further details.
Arguments
space::HierarchicalFiniteElementSpace{2}: The space to be updated.marked_els::Vector{Vector{Int}}: The marked elements.
Returns
space::HierarchicalFiniteElementSpace{2}: The refined space, with no problematic pairs.