Skip to content

FunctionSpaces

All docstrings from Mantis.FunctionSpaces

Mantis.FunctionSpaces Module

This (sub-)module provides a collection of function spaces. The exported names are:

source
Mantis.FunctionSpaces.AbstractCanonicalSpace Type
julia
AbstractCanonicalSpace <: AbstractFunctionSpace

Supertype 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.

source
Mantis.FunctionSpaces.AbstractFESpace Type
julia
AbstractFESpace{manifold_dim, num_components, num_patches} <: AbstractFunctionSpace

Supertype 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.

source
Mantis.FunctionSpaces.AbstractFunctionSpace Type
julia
AbstractFunctionSpace

Supertype for all function spaces.

source
Mantis.FunctionSpaces.AbstractTwoScaleOperator Type
julia
AbstractTwoScaleOperator

Supertype for all two scale relations.

source
Mantis.FunctionSpaces.BSplineSpace Type
julia
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. See KnotVector for more details.

  • extraction_op::ExtractionOperator: Stores extraction coefficients and basis indices.

  • polynomials::F: local section space F, named polynomials just for convention. Can be any AbstractCanonicalSpace.

  • 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.

source
Mantis.FunctionSpaces.Bernstein Type
julia
Bernstein <: AbstractCanonicalSpace

Concrete type for Bernstein polynomials; see [2].

Fields

  • p::Int: Degree of the Bernstein polynomial.
source
Mantis.FunctionSpaces.DirectSumSpace Type
julia
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 of num_components scalar function spaces

  • basis_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.

source
Mantis.FunctionSpaces.EdgeLobattoLegendre Type

Edge polynomials of degree p over Gauss-Lobatto-Legendre nodes.

The j-th edge basis polynomial, ej(ξ), is given by, see [1],

ej(ξ)=k=1jdhk(ξ)dξ,j=1,,p+1.

where hk(ξ) is the k-th Lagrange polynomial of degree (p+1) over Gauss-Lobatto-Legendre nodes.

If ξi are the (p+1) nodes of the associated Gauss-Lobatto-Legendre polynomials, then

ξiξi+1ej(ξ)dξ=δi,j,i,j=1,,p,

i.e., they satisfy an integral Kronecker-δ property.

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.

source
Mantis.FunctionSpaces.ExtractionOperator Type
julia
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 of Indices. See Indices for more details.

  • num_elements::Int: The number of elements.

  • num_basis::Int: The (total) dimension of the function space.

source
Mantis.FunctionSpaces.GTBSplineSpace Type
julia
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 of num_patches NURBS 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 of num_patches NURBS 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.

source
Mantis.FunctionSpaces.GeneralizedExponential Type
julia
GeneralizedExponential <: AbstractECTSpaces

Concrete 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.

source
Mantis.FunctionSpaces.GeneralizedTrigonometric Type
julia
GeneralizedTrigonometric <: AbstractECTSpaces

Concrete type for Generalized Trignometric section space spanned by <1,x,...,x(p2),cos(wx),sin(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. 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.

source
Mantis.FunctionSpaces.HierarchicalActiveInfo Type
julia
struct HierarchicalActiveInfo

Contains 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.

source
Mantis.FunctionSpaces.HierarchicalFiniteElementSpace Type
julia
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 of manifold_dim- variate function spaces.

  • two_scale_operators::Vector{T}: Collection of two-scale operators relating each

julia
consecutive pair of finite element spaces. See [`AbstractTwoScaleOperator`](@ref).
  • active_elements::HierarchicalActiveInfo: Information about the active elements in each
julia
level.
  • active_basis::HierarchicalActiveInfo: Information about the active basis in each level.

  • nested_domains::HierarchicalActiveInfo: Information about the nested domains in each

julia
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}}}:

julia
Extraction coefficients of active basis functions in `multilevel_elements`.
  • multilevel_basis_indices::Vector{Vector{Int}}: Indices of active basis in
julia
`multilevel_elements`, in hierarchical indexing.
  • num_subdivisions::NTuple{manifold_dim, Int}: Number of subdivisions per manifold_dim,
julia
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

julia
hierarchical space, in hierarchical indexing.
source
Mantis.FunctionSpaces.HierarchicalFiniteElementSpace Method
julia
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

source
Mantis.FunctionSpaces.HierarchicalFiniteElementSpace Method
julia
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.

source
Mantis.FunctionSpaces.Indices Type
julia
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 the evaluate function to which basis on an element the evaluations correspond.

source
Mantis.FunctionSpaces.KnotVector Type
julia
KnotVector

1-dimensional knot vector.

Fields

  • geometry::G: A 1D geometry.

  • polynomial_degree::Int: Polynomial degree.

  • multiplicity::TM: Number of repetitions of each knot.

source
Mantis.FunctionSpaces.RationalFESpace Type
julia
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.

source
Mantis.FunctionSpaces.Tchebycheff Type
julia
Tchebycheff <: AbstractECTSpaces

A Tchebycheffian section space. The parameters are the roots of a differential operator with constant coefficients; see [5].

  • A complex root α + iβ, β ≠ 0, of multiplicity m contributes 2m basis functions of the form (upto scaling): x^i e^(αx) cos(βx), x^i e^(αx) sin(βx), i = 0, ..., m-1

  • A real root α of multiplicity m contributes m basis 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.

source
Mantis.FunctionSpaces.TensorProductSpace Type
julia
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: See get_dof_partition.

source
Mantis.FunctionSpaces.TensorProductTwoScaleOperator Type
julia
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.

source
Mantis.FunctionSpaces.TwoScaleOperator Type
julia
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) where num_child_basis is the dimension of child_space and num_parent_basis the dimension of parent_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.

source
Mantis.FunctionSpaces._build_polar_extraction_and_dof_partition Method
julia
_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.
source
Mantis.FunctionSpaces._build_standard_degenerate_control_points Method
julia
_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.

source
Mantis.FunctionSpaces._compute_parametric_geometry_coeffs Method
julia
_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).
source
Mantis.FunctionSpaces._derivative_matrix Method
julia
_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 (lnp(x)) are given by:

dln(x)dx=i=1,inp+1j=1,jn,jip+11xnxixxjxnxj

For computation at the nodes a more efficient and accurate formula can be used, see [7]:

dk,j={ckcj1xkxj,kj l=1,lkp+11xkxl,k=j

with

ck=l=1,lkp+1(xkxl)

It returns a 2-dimensional matrix, D, with the values of the derivative of the polynomials, Bj, of order p

Dk,j=dBj(xk)dx

Arguments

  • nodes::Vector{Float64}: (p+1) nodes that define a set of Lagrange polynomials of degree p, Bjp(ξ), for which to compute the derivative matrix. Note that the polynomials are such that Bjp(ξi)=δj,i with j,i=1,,p+1, \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. Dk,j=dBj(xk)dx. (size: [p+1, p+1])
source
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 order m for the (p+1) polynomials``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. Dk,j=dBj(xk)dx. (size: [p+1, p+1])

  • nodes::Vector{Float64}: (p+1) nodes that define a set of Lagrange polynomials of degree p, Bjp(ξ), for which to compute the derivative matrix. Note that the polynomials are such that Bjp(ξi)=δj,i with j,i=1,,p+1, \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. Dk,j(m)=dmBj(xk)dxm. D_m given as input argument is updated with the new value. (size: [p+1, p+1])
source
Mantis.FunctionSpaces._evaluate_all_at_point Method
julia
_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
source
Mantis.FunctionSpaces._evaluate_all_at_point Method
julia
_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
source
Mantis.FunctionSpaces._get_barycentric_coordinates Function
julia
_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 the i-th vertex of the control triangle in the i-th row.

  • origin::Vector{Float64}: The point which is translated to the origin.

Returns

  • ::Matrix{Float64}: The barycentric coordinates.
source
Mantis.FunctionSpaces._get_circumscribing_triangle Function
julia
_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.
source
Mantis.FunctionSpaces._get_scalar_polar_extraction_submatrix Function
julia
_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.

source
Mantis.FunctionSpaces.add_level! Method
julia
add_level!(space::HierarchicalFiniteElementSpace)

Adds an empty level to space.

Returns

  • space::HierarchicalFiniteElementSpace: Space with an extra refinement level.
source
Mantis.FunctionSpaces.add_padding! Method
julia
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
julia
elements.
  • space::HierarchicalFiniteElementSpace: The hierarchical finite element space.

Returns

  • marked_elements_per_level::Vector{Vector{Int}}: The padded level-wise indexing of marked
julia
elements.
source
Mantis.FunctionSpaces.assemble_global_extraction_matrix Method
julia
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
source
Mantis.FunctionSpaces.build_sparse_nullspace Method
julia
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.
source
Mantis.FunctionSpaces.build_two_scale_matrix Method
julia
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.
source
Mantis.FunctionSpaces.build_two_scale_matrix Method
julia
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.

source
Mantis.FunctionSpaces.build_two_scale_matrix Method
julia
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
source
Mantis.FunctionSpaces.build_two_scale_operator Function
julia
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.
source
Mantis.FunctionSpaces.build_two_scale_operator Method
julia
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.
source
Mantis.FunctionSpaces.build_two_scale_operator Method
julia
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.

source
Mantis.FunctionSpaces.convert_element_vector_to_elements_per_level Method
julia
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
julia
number of levels of `space`.
source
Mantis.FunctionSpaces.convert_knot_to_breakpoint_idx Method
julia
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 to knot_index.
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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 and degree - 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.
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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 and degree - 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.
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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 and degree - 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

julia
# 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)
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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 and degree - 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

julia
# 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,))
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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.
source
Mantis.FunctionSpaces.create_bspline_space Method
julia
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.
source
Mantis.FunctionSpaces.create_dim_wise_bspline_spaces Method
julia
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.
source
Mantis.FunctionSpaces.create_dim_wise_bspline_spaces Method
julia
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.
source
Mantis.FunctionSpaces.create_knot_vector Method
julia
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 (p0).

  • breakpoint_condition::AbstractVector{Int}: Either the regularity or multiplicity of each breakpoint.

  • condition_type::String: Determines whether breakpoint_condition provides the regularity or multiplicity.

Returns

  • ::KnotVector: Knot vector.
source
Mantis.FunctionSpaces.create_polar_geometry_data Method
julia
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.

source
Mantis.FunctionSpaces.create_scalar_polar_spline_space Method
julia
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.
source
Mantis.FunctionSpaces.create_scalar_polar_spline_space Method
julia
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.
source
Mantis.FunctionSpaces.create_vector_polar_spline_space Method
julia
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.
source
Mantis.FunctionSpaces.create_vector_polar_spline_space Method
julia
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.
source
Mantis.FunctionSpaces.evaluate Function
julia
evaluate(polynomial::Bernstein, ξ::Vector{Float64}, nderivatives::Int=0)

Compute derivatives up to order nderivatives for all Bernstein polynomials of degree p at ξ for ξ[0.0,1.0].

Arguments

  • polynomial::Bernstein: Bernstein polynomial.

  • ξ::Vector{Float64}: Vector of evaluation points [0.0,1.0].

  • nderivatives::Int=0: Maximum order of derivatives to be computed (nderivatives p). Defaults to 0, i.e., only the values of the polynomials are computed.

Returns

  • ::Vector{Vector{Matrix{Float64}}}: Nested vector containing the values.
source
Mantis.FunctionSpaces.evaluate Function
julia
evaluate(polynomials::EdgeLobattoLegendre, ξ::Vector{Float64}, nderivatives::Int=0)

Evaluate the polynomials Bj(ξ), j=1,,p+1, in polynomials at ξ for ξ[0.0,1.0].

Arguments

  • polynomials::EdgeLobattoLegendre: (p+1) polynomials of degree p, Bjp(ξ) with j=1,,p+1, to evaluate.

  • ξ::Vector{Float64}: vector of n evaluation points ξ[0.0,1.0].

  • nderivatives::Int: maximum order of derivatives to be computed (nderivatives p). 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] =dkBjdξk(ξi).

source
Mantis.FunctionSpaces.evaluate Function
julia
evaluate(polynomials::AbstractLagrangePolynomials, ξ::Vector{Float64}, nderivatives::Int=0)

Evaluate the first nderivatives derivatives of the polynomials Bj(ξ), j=1,,p+1, in polynomials at ξ for ξ[0.0,1.0].

Arguments

  • polynomials::AbstractLagrangePolynomials: (p+1) polynomials of degree p, Bjp(ξ) with j=1,,p+1, to evaluate.

  • ξ::Vector{Float64}: vector of n evaluation points ξ[0.0,1.0].

  • nderivatives::Int: maximum order of derivatives to be computed (nderivatives p). 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] =dkBjdξk(ξi).

source
Mantis.FunctionSpaces.evaluate Function
julia
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 ξ[0.0,1.0].

Arguments

  • ect_space::AbstractECTSpaces: ECT section space.

  • ξ::Points.AbstractPoints{1}: vector of evaluation points [0.0,1.0].

  • nderivatives::Int: maximum order of derivatives to be computed (nderivatives p). Defaults to 0, i.e., only the values are computed.

source
Mantis.FunctionSpaces.evaluate Method
julia
evaluate(ect_space::GeneralizedExponential, ξ::Vector{Float64})

Compute all basis function values at ξ in [0.0,1.0].

Arguments

  • ect_space::GeneralizedExponential: Generalized Exponential section space.

  • xi::Vector{Float64}: vector of evaluation points in[0.0,1.0].

source
Mantis.FunctionSpaces.evaluate Method
julia
evaluate(ect_space::GeneralizedTrigonometric, ξ::Vector{Float64})

Compute all basis function values at ξ in [0.0,1.0].

Arguments

  • ect_space::GeneralizedTrigonometric: Generalized Trigonometric section space.

  • xi::Vector{Float64}: vector of evaluation points in [0.0,1.0].

See also evaluate(ect_space::GeneralizedTrigonometric, xi::Vector{Float64}, nderivatives::Int64).

source
Mantis.FunctionSpaces.evaluate Method
julia
evaluate(ect_space::Tchebycheff, ξ::Vector{Float64})

Compute all basis function values at ξ in [0.0,1.0].

Arguments

  • ect_space::Tchebycheff: Tchebycheff section space.

  • xi::Vector{Float64}: vector of evaluation points in[0.0,1.0].

source
Mantis.FunctionSpaces.evaluate Method
julia
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.
source
Mantis.FunctionSpaces.evaluate Method
julia
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 type TI is an vector- like object with integer type elements. See the documentation of space or Indices for more details.

source
Mantis.FunctionSpaces.extract_bspline_to_section_space Method
julia
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

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.

source
Mantis.FunctionSpaces.extract_gtbspline_to_bspline Method
julia
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. See ExtractionOperator for the details.
source
Mantis.FunctionSpaces.extract_monomial_to_bernstein Method
julia
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
source
Mantis.FunctionSpaces.extract_scalar_polar_splines_to_tensorproduct Function
julia
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.

source
Mantis.FunctionSpaces.extract_vector_polar_splines_to_tensorproduct Function
julia
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.
source
Mantis.FunctionSpaces.get_Blk Method
julia
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 Ωₖ.
source
Mantis.FunctionSpaces.get_active_objects_and_nested_domains Method
julia
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
julia
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.

source
Mantis.FunctionSpaces.get_basis_children Method
julia
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.
source
Mantis.FunctionSpaces.get_basis_indices Method
julia
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 type TI is an vector-like object with integer type elements. See the documentation of space or Indices for more details.

Exceptions

  • Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for space, and there is no specific get_basis_indicesmethod forspace either.
source
Mantis.FunctionSpaces.get_basis_parents Method
julia
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.
source
Mantis.FunctionSpaces.get_basis_permutation Function
julia
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 type TJ is a vector-like object with integer type elements. See the documentation of space or Indices for more details.

Exceptions

  • Error "no field 'extraction_op'": This error is thrown if no extraction operator is defined for space, and there is no specific get_basis_indicesmethod forspace either.
source
Mantis.FunctionSpaces.get_bisected_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_bisected_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_bisected_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_bisected_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_cart_num_elements Method
julia
get_cart_num_elements(space::TensorProductSpace)

See Geometry.get_cart_num_elements.

source
Mantis.FunctionSpaces.get_child_basis_coefficients Method
julia
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, where T is a subtype of AbstractTwoScaleOperator.

Returns

  • ::Vector{Float64}: A vector containing the coefficients of the fine basis after subdivision.
source
Mantis.FunctionSpaces.get_child_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_child_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_child_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_child_space Method
julia
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.
source
Mantis.FunctionSpaces.get_component_spaces Method
julia
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.
source
Mantis.FunctionSpaces.get_constituent_basis_id Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_basis_indices Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_element_id Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_evaluation_points Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_evaluations Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_extraction Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_local_basis Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_manifold_dim Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_manifold_indices Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_num_basis Method
julia
get_constituent_num_basis(space::TensorProductSpace)

Returns a tuple corresponding to the constituent-wise number of basis functions — or dimension.

source
Mantis.FunctionSpaces.get_constituent_num_basis Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_polynomial_degree Method
julia
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.

source
Mantis.FunctionSpaces.get_constituent_space Method
julia
get_constituent_space(space::TensorProductSpace, space_id::Int)

Returns the constituent space numbered space_id of the tensor product space.

source
Mantis.FunctionSpaces.get_constituent_support Method
julia
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.

source
Mantis.FunctionSpaces.get_contained_knot_vector Method
julia
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 between boundary_breakpoints.
source
Mantis.FunctionSpaces.get_derivative_space Method
julia
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.
source
Mantis.FunctionSpaces.get_derivative_space Method
julia
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.
source
Mantis.FunctionSpaces.get_derivative_space Method
julia
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.
source
Mantis.FunctionSpaces.get_derivative_space Method
julia
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.
source
Mantis.FunctionSpaces.get_derivative_space Method
julia
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.
source
Mantis.FunctionSpaces.get_dof_partition Method
julia
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.
source
Mantis.FunctionSpaces.get_dorfler_marking Method
julia
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 least dorfler_parameter*100% of the highest
julia
error.
source
Mantis.FunctionSpaces.get_element_ancestor Method
julia
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.
source
Mantis.FunctionSpaces.get_element_children Method
julia
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.
source
Mantis.FunctionSpaces.get_element_lengths Method
julia
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.
source
Mantis.FunctionSpaces.get_element_measure Method
julia
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.
source
Mantis.FunctionSpaces.get_element_parent Method
julia
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.
source
Mantis.FunctionSpaces.get_element_vertices Method
julia
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)).
source
Mantis.FunctionSpaces.get_extraction Function
julia
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 specific get_extractionmethod forspace either.
source
Mantis.FunctionSpaces.get_extraction_coefficients Function
julia
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 specific get_extraction_coefficientsmethod forspace either.
source
Mantis.FunctionSpaces.get_extraction_operator Method
julia
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.
source
Mantis.FunctionSpaces.get_finer_canonical_space Method
julia
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.
source
Mantis.FunctionSpaces.get_first_knot_index Method
julia
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.
source
Mantis.FunctionSpaces.get_geometry Method
julia
get_geometry(space::AbstractFESpace)

Get the geometry underlying the given space.

Arguments

  • space::AbstractFESpace: A finite element space.

Returns

  • ::AbstractGeometry: The underlying geometry.
source
Mantis.FunctionSpaces.get_global_element_id Method
julia
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.
source
Mantis.FunctionSpaces.get_global_subdiv_matrix Method
julia
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.
source
Mantis.FunctionSpaces.get_greville_points Method
julia
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.
source
Mantis.FunctionSpaces.get_greville_points Method
julia
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 containing BSplineSpaces.

Returns

  • ::NTuple{manifold_dim, Vector{Float64}}: A tuple of vectors containing the Greville points for each dimension of the tensor product space.
source
Mantis.FunctionSpaces.get_interaction_box Method
julia
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 βᵢ.
source
Mantis.FunctionSpaces.get_knot_multiplicity Method
julia
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 to knot_index.
source
Mantis.FunctionSpaces.get_knot_value Method
julia
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 to knot_index.
source
Mantis.FunctionSpaces.get_knot_vector Method
julia
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.
source
Mantis.FunctionSpaces.get_knot_vector_length Method
julia
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.
source
Mantis.FunctionSpaces.get_last_knot_index Method
julia
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.
source
Mantis.FunctionSpaces.get_lchain_corner Method
julia
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.
source
Mantis.FunctionSpaces.get_lin_num_elements Method
julia
get_lin_num_elements(space::TensorProductSpace)

See Geometry.get_lin_num_elements.

source
Mantis.FunctionSpaces.get_local_basis Method
julia
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. See get_derivative_idx for more details on the order in which the derivatives are stored.
source
Mantis.FunctionSpaces.get_local_knot_vector Method
julia
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 by basis_id.
source
Mantis.FunctionSpaces.get_local_pairs Method
julia
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.

source
Mantis.FunctionSpaces.get_local_subdiv_matrix Method
julia
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.
source
Mantis.FunctionSpaces.get_max_local_dim Method
julia
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).
source
Mantis.FunctionSpaces.get_multilevel_extraction Method
julia
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 in multilevel_elements.

  • multilevel_basis_indices::Vector{Vector{Int}}: indices of active basis in multilevel_elements.

source
Mantis.FunctionSpaces.get_multilevel_information Method
julia
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.
source
Mantis.FunctionSpaces.get_multiplicity Method
julia
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.
source
Mantis.FunctionSpaces.get_multiplicity_vector Method
julia
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.
source
Mantis.FunctionSpaces.get_num_basis Method
julia
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 specific get_num_basismethod forspace either.
source
Mantis.FunctionSpaces.get_num_basis Method
julia
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 specific get_num_basismethod forspace either.
source
Mantis.FunctionSpaces.get_num_elements Method
julia
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.
source
Mantis.FunctionSpaces.get_num_elements_per_patch Method
julia
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.
source
Mantis.FunctionSpaces.get_num_spaces Method
julia
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.

source
Mantis.FunctionSpaces.get_padding_per_level Method
julia
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.
source
Mantis.FunctionSpaces.get_parametric_geometry Method
julia
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.
source
Mantis.FunctionSpaces.get_parent_function Method
julia
get_parent_function(space::HierarchicalFiniteElementSpace, level::Int, βᵢ::Int)

Returns the first basis function of βᵢ.

Returns

  • Int: The id of the parent basis function.
source
Mantis.FunctionSpaces.get_parent_space Method
julia
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.
source
Mantis.FunctionSpaces.get_patch_and_local_element_id Method
julia
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 ID

  • local_element_id::Int: The local element ID.

source
Mantis.FunctionSpaces.get_patch_id Method
julia
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.
source
Mantis.FunctionSpaces.get_polynomial_degree Method
julia
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.
source
Mantis.FunctionSpaces.get_polynomial_degree Method
julia
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.

source
Mantis.FunctionSpaces.get_polynomials Method
julia
get_polynomials(space::BSplineSpace)

Returns the reference Bernstein polynomials of space.

Arguments

  • space::BSplineSpace: A univariate B-Spline function space.

Returns

  • ::Bernstein: Bernstein polynomials.
source
Mantis.FunctionSpaces.get_support Method
julia
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.
source
Mantis.FunctionSpaces.gexp_representation Method
julia
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.
source
Mantis.FunctionSpaces.has_minimal_intersection Method
julia
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.
source
Mantis.FunctionSpaces.has_shortest_chain Method
julia
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.
source
Mantis.FunctionSpaces.initiate_pairs Method
julia
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.

source
Mantis.FunctionSpaces.is_problematic Method
julia
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.
source
Mantis.FunctionSpaces.is_resolved Method
julia
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.
source
Mantis.FunctionSpaces.refine_mesh! Method
julia
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 at level.
source
Mantis.FunctionSpaces.refine_mesh! Method
julia
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.
source
Mantis.FunctionSpaces.refine_polar_geometry_data Method
julia
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.

source
Mantis.FunctionSpaces.single_knot_insertion_oslo Method
julia
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 that get_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.
source
Mantis.FunctionSpaces.subdivide_breakpoints Method
julia
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.
source
Mantis.FunctionSpaces.subdivide_geometry Method
julia
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 of parent_geo.
source
Mantis.FunctionSpaces.subdivide_knot_vector Method
julia
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.
source
Mantis.FunctionSpaces.subdivide_multiplicity_vector Function
julia
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.
source
Mantis.FunctionSpaces.subdivide_space Function
julia
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.
source
Mantis.FunctionSpaces.subdivide_space Method
julia
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.
source
Mantis.FunctionSpaces.tcheb_representation Method
julia
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.
source
Mantis.FunctionSpaces.truncate_refinement_matrix! Method
julia
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.
source
Mantis.FunctionSpaces.update_basis! Method
julia
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.
source
Mantis.FunctionSpaces.update_space! Method
julia
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!.

source
Mantis.FunctionSpaces.update_space_with_lchains! Method
julia
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.
source