Forms
All docstrings from Mantis.Forms
Mantis.Forms Module
module FormsContains all definitions of forms, including form fields, form spaces, and form expressions.
sourceMantis.Forms.:∧ Type
∧Symbolic wrapper for the wedge operator. The unicode character command is \wedge. See Wedge for the details.
Mantis.Forms.AbstractForm Type
AbstractForm{manifold_dim, form_rank, expression_rank}Supertype for all form expressions representing differential forms.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: Rank of the differential form.expression_rank: Rank of the expression. Expressions without basis forms have rank 0, with one single set of basis forms have rank 1, with two sets of basis forms have rank- Higher ranks are not possible.
Mantis.Forms.AbstractFormField Type
AbstractFormField{manifold_dim, form_rank} = AbstractForm{manifold_dim, form_rank, 0}Alias for AbstractForms with expression rank 0, that is, a form without a basis. See AbstractForm for more details.
Mantis.Forms.AbstractFormSpace Type
AbstractFormSpace{manifold_dim, form_rank} = AbstractForm{manifold_dim, form_rank, 1}Alias for AbstractForms with expression rank 1, that is, a form with a basis. See AbstractForm for more details.
Mantis.Forms.AbstractRealValuedOperator Type
AbstractRealValuedOperator{manifold_dim}Supertype for all real-valued operators defined over a manifold.
Type parameters
manifold_dim: Dimension of the manifold.
Mantis.Forms.AnalyticalFormField Type
AnalyticalFormField{manifold_dim, form_rank, G, E} <:
AbstractFormField{manifold_dim, form_rank}Represents an analytical differential form field.
Fields
geometry::G: The geometry associated with this field.expression::E: The expression defining the form field.label::AbstractString: Label for the form field.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: Rank of the differential form.G: Type of the geometry.E: Type of the expression.
Inner Constructors
AnalyticalFormField(form_rank::Int, expression::E, geometry::G, label::AbstractString): General constructor for analytical form fields.
Mantis.Forms.BinaryFormTransformation Type
BinaryFormTransformation{manifold_dim, form_rank, F1, F2, T} <: AbstractForm
Structure holding the necessary information to evaluate a binary, algebraic transformation acting on two differential form expressions.
Fields
form_1::F1: The first differential form expression.form_2::F2: The second differential form expression.transformation::T: The transformation to apply to the differential forms.label::AbstractString: The label to associate to the resulting differential form.
Type parameters
manifold_dim::Int: The dimension of the manifold where the form expressions are defined.form_rank::Int: The rank of both differential form expressions.expression_rank::Int: The expression rank of both differential form expressions.F1 <: AbstractForm{manifold_dim, form_rank, expression_rank}: The type of the first form expression.F2 <: AbstractForm{manifold_dim, form_rank, expression_rank}: The type of the second form expression.T <: Function: The type of the algebraic transformation.
Inner constructors
BinaryFormTransformation(form_1::F1, form_2::F2, transformation::T, label::AbstractString): General constructor.Base.:+(form_1::F1, form_2::F2): Alias for the sum of two differential form expressions.Base.:-(form_1::F1, form_2::F2): Alias for the difference of two differential form expressions.
Mantis.Forms.BinaryOperatorTransformation Type
BinaryOperatorTransformation{manifold_dim, O1, O2, T} <: AbstractRealValuedOperator
Structure holding the necessary information to evaluate a binary, algebraic transformation acting on two real-valued operators.
Warning
The basis underlying each operator must compatible, this is checked. If not compatible an ArgumentError is thrown.
Fields
operator_1::O1: The first real-valued operator.operator_2::O2: The second real-valued operator.transformation::T: The transformation to apply to the operators.
Type parameters
manifold_dim::Int: The dimension of the manifold where the operators are defined.O1 <: AbstractRealValuedOperator{manifold_dim}: The type of the first operator.O2 <: AbstractRealValuedOperator{manifold_dim}: The type of the second operator.T <: Function: The type of the algebraic transformation.
Inner constructors
BinaryOperatorTransformation(operator_1::O1, operator_2::O2, transformation::T ): General constructor.Base.:+(operator_1::O1, operator_1::O2): Alias for the sum of two operators.Base.:-(operator_1::O1, operator_2::O2): Alias for the difference of two operators.
Mantis.Forms.CoDifferential Type
CoDifferential{manifold_dim, form_rank, expression_rank, F} <:
AbstractForm{manifold_dim, form_rank, expression_rank}Represents the codifferential of an AbstractForm.
Fields
form::AbstractForm{manifold_dim, form_rank, expression_rank, G}: The form to which the codifferential is applied.label::AbstractString: The codifferential label. This is a concatenation of"d*"with the label ofform.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: The form rank of the codifferential. If the form rank offormiskthenform_rankisk-1.expression_rank: Rank of the expression. Expressions without basis forms have rank 0, with one single set of basis forms have rank 1, with two sets of basis forms have rank- Higher ranks are not possible.
G <: Geometry.AbstractGeometry{manifold_dim}: Type of the underlying geometry.F <: Forms.AbstractForm{manifold_dim, form_rank+1, expression_rank, G}: The type ofform.
Inner Constructors
CoDifferential(form::F): General constructor.
Mantis.Forms.ExteriorDerivative Type
ExteriorDerivative{manifold_dim, form_rank, expression_rank, F} <:
AbstractForm{manifold_dim, form_rank, expression_rank}Represents the exterior derivative of an AbstractForm.
Fields
form::AbstractForm{manifold_dim, form_rank, expression_rank}: The form to which the exterior derivative is applied.label::AbstractString: The exterior derivative label. This is a concatenation of"d"with the label ofform.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: The form rank of the exterior derivative. If the form rank offormiskthenform_rankisk+1.expression_rank: Rank of the expression. Expressions without basis forms have rank 0, with one single set of basis forms have rank 1, with two sets of basis forms have rank- Higher ranks are not possible.
F <: Forms.AbstractForm{manifold_dim, form_rank - 1, expression_rank}: The type ofform.
Inner Constructors
ExteriorDerivative(form::F): General constructor.
Mantis.Forms.FormField Type
FormField{manifold_dim, form_rank, FS} <: AbstractFormField{manifold_dim, form_rank}Represents a differential form field.
Fields
form_space::FS: The form space associated with this field.coefficients::Vector{Float64}: Coefficients of the form field.label::AbstractString: Label for the form field.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: Rank of the differential form.FS: Type of the form space.
Inner Constructors
FormField(form_space::FS, coefficients::Vector{Int}, label::AbstractString): General constructor for form fields.FormField(form_space::FS, label::AbstractString): Constructor with zero coefficients.
Mantis.Forms.FormSpace Type
FormSpace{manifold_dim, form_rank, F} <: AbstractFormSpace{manifold_dim, form_rank}Concrete implementation of a function space for differential forms.
Fields
fem_space::F: The finite element space(s) used for the form componentslabel::AbstractString: Label for the form space
Type parameters
manifold_dim: Dimension of the manifoldform_rank: Rank of the differential formF: Type of the finite element space
Inner Constructors
FormSpace(form_rank::Int,fem_space::F, label::AbstractString): Constructor for differential form spaces.
Mantis.Forms.Hodge Type
Hodge{manifold_dim, form_rank, expression_rank, F} <:
AbstractForm{manifold_dim, form_rank, expression_rank}Represents the hodge star of an AbstractForm.
Fields
form::AbstractForm{manifold_dim, form_rank, expression_rank}: The form to which the hodge star is applied.label::AbstractString: The hodge star label. This is a concatenation of"★"with the label ofform.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: The form rank of the hodge star. If the form rank offormiskthenform_rankismanifold_dim - k.expression_rank: Rank of the expression. Expressions without basis forms have rank 0, with one single set of basis forms have rank 1, with two sets of basis forms have rank- Higher ranks are not possible.
F <: Forms.AbstractForm{manifold_dim, manifold_dim-form_rank, expression_rank,}: The type ofform.
Inner Constructors
Hodge(form::F): General constructor.
Mantis.Forms.Integral Type
Integral{manifold_dim, F, Q} <: AbstractRealValuedOperator{manifold_dim}Structure representing the integral of a form over a manifold.
Fields
form::F: The form expression to be integrated.quad_rule::Quadrature.AbstractGlobalQuadratureRule{manifold_dim}: The quadrature rule used for the integral.
Type Parameters
manifold_dim::Int: The dimension of the manifold.F: The type of the form expression.
Inner Constructors
Integral(form::AbstractForm{manifold_dim}): General constructor.
Outer Constructors
∫: Symbolic wrapper for the integral operator.
Mantis.Forms.Sharp Type
Sharp{manifold_dim, F}Represents the sharp operator, which converts a differential 1-form into a vector field.
Fields
form::F: The differential 1-form to be converted into a vector field.
Type Parameters
manifold_dim: The dimension of the manifold.F: The type of the differential 1-form.
Inner Constructors
Sharp(form::F): General constructor.
Mantis.Forms.UnaryFormTransformation Type
UnaryFormTransformation{manifold_dim, form_rank, expression_rank, F, T} <: AbstractForm
Structure holding the necessary information to evaluate a unary, algebraic transformation of a differential form expression.
Fields
form::F: The differential form expression to which the transformation is applied.transformation::T: The transformation function to apply to the form.label::AbstractString: The label to associate with the resulting transformed form.
Type parameters
manifold_dim::Int: The dimension of the manifold where the form is defined.form_rank::Int: The rank of the differential form.expression_rank::Int: The rank of the expression.F <: AbstractForm{manifold_dim, form_rank, expression_rank}: The type of the original form expression .T <: Function: The type of the algebraic transformation.
Inner constructors
UnaryFormTransformation(form::F, transformation::T, label::String): General constructor.Base.:-(form::AbstractForm): Alias for the additive inverse of a
differential form expression .
Base.:*(factor::Number, form::AbstractForm): Alias for the multiplication of a differential form expression with a constant factor.
Mantis.Forms.UnaryOperatorTransformation Type
UnaryOperatorTransformation{manifold_dim, O, T} <: AbstractRealValuedOperator
Structure holding the necessary information to evaluate a unary, algebraic transformation of a AbstractRealValuedOperator.
Fields
operator::O: The operator to which the transformation is applied.transformation::T: The transformation to apply to the operator.
Type parameters
manifold_dim::Int: The dimension of the manifold where the operator is defined.O <: AbstractRealValuedOperator{manifold_dim}: Type of the original real-valued operator.T <: Function: Function defining the algebraic transformation.
Inner constructors
UnaryOperatorTransformation(operator::O, transformation::T): General constructor.Base.:*(factor::Number, operator::AbstractRealValuedOperator): Alias for the multiplication of a real-valued operator with a constant factor.Base.:-(operator::AbstractRealValuedOperator): Alias for the additive inverse of a real-valued operator.
Mantis.Forms.Wedge Type
Wedge{manifold_dim, form_rank, expression_rank, F1, F2} <:
AbstractForm{manifold_dim, form_rank, expression_rank}Represents the wedge between two differential forms.
Fields
form_1 <: AbstractForm{manifold_dim, form_rank_1, expression_rank_1, G}: The first form.form_2 <: AbstractForm{manifold_dim, form_rank_2, expression_rank_2, G}: The second form.label :: AbstractString: A label for the wedge.
Type parameters
manifold_dim: Dimension of the manifold.form_rank: The form rank of the wedge: equal toform_rank_1 + form_rank_2.expression_rank: Rank of the expression. Expressions without basis forms have rank 0, with one single set of basis forms have rank 1, with two sets of basis forms have rank- Higher ranks are not possible.
F1 <: Forms.AbstractForm: The type ofform_1.F2 <: Forms.AbstractForm: The type ofform_2.
Inner Constructors
Wedge(form_1::F1, form_2::F2): General constructor.
Mantis.Forms.d Type
dSymbolic wrapper for the exterior derivative operator. See ExteriorDerivative for the details.
Mantis.Forms.∫ Type
∫Symbolic wrapper for the integral operator. The unicode character command is \int. See Integral for the details.
Mantis.Forms.★ Type
★Symbolic wrapper for the hodge star operator. The unicode character command is \bigstar. See Hodge for the details.
Mantis.Forms.♯ Type
♯Symbolic wrapper for the sharp operator. The unicode character command is \sharp. See Sharp for the details.
Mantis.Forms._evaluate_form_in_canonical_coordinates Method
_evaluate_form_in_canonical_coordinates(
form_space::FormSpace{manifold_dim, form_rank},
element_idx::Int,
xi::Points.AbstractPoints{manifold_dim},
nderivatives::Int,
) where {manifold_dim, form_rank}Evaluate the form basis functions and their arbitrary derivatives in canonical coordinates.
Arguments
form_space::FormSpace{manifold_dim, form_rank}: The form space.element_idx::Int: Index of the element where the evaluation is performed.xi::Points.AbstractPoints{manifold_dim}: Canonical points for evaluation.
Returns
local_form_basis::Vector{Vector{Vector{Matrix{Float64}}}}: The basis functions evaluated at the canonical coordinates of the element.::Vector{Vector{Int}}: The basis functions evaluated at the canonical coordinates of the element.
Mantis.Forms._pullback_to_canonical_coordinates Method
_pullback_to_canonical_coordinates(
geometry::Geometry.AbstractGeometry{manifold_dim},
form_evaluations::Vector{Vector{Vector{Matrix{Float64}}}},
element_idx::Int,
form_rank::Int,
) where {manifold_dim}Pullback the basis functions to the canonical coordinates of the element.
Arguments
geometry::Geometry.AbstractGeometry{manifold_dim}: The geometry of the form space.form_evaluations::Vector{Vector{Vector{Matrix{Float64}}}}: The basis functions evaluated at the parametric coordinates.element_idx::Int: Index of the element to evaluate.form_rank::Int: Rank of the form.
Returns
form_evaluations::Vector{Vector{Vector{Matrix{Float64}}}}: The form evaluations pulled-back to canonical coordinates.
Mantis.Forms.create_curvilinear_tensor_product_bspline_de_rham_complex Method
create_curvilinear_tensor_product_bspline_de_rham_complex(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::NTuple{manifold_dim, F},
regularities::NTuple{manifold_dim, Int},
) where {manifold_dim, F <: FunctionSpaces.AbstractCanonicalSpace}Create a tensor-product B-spline de Rham complex on a crazy mesh.
Arguments
starting_points::NTuple{manifold_dim, Float64}: the starting points of the domain.box_sizes::NTuple{manifold_dim, Float64}: the sizes of the domain.num_elements::NTuple{manifold_dim, Int}: the number of elements in each direction.section_spaces::NTuple{manifold_dim, F}: the section spaces.regularities::NTuple{manifold_dim, Int}: the regularities of the B-spline spaces.
Returns
Vector{AbstractFormSpace}: themanifold_dim+1form spaces of the complex.
Mantis.Forms.create_curvilinear_tensor_product_bspline_de_rham_complex Method
create_curvilinear_tensor_product_bspline_de_rham_complex(
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},
) where {manifold_dim}Create a tensor-product B-spline de Rham complex on a crazy geometry.
Arguments
starting_points::NTuple{manifold_dim, Float64}: the starting points of the domain.box_sizes::NTuple{manifold_dim, Float64}: the sizes of the domain.num_elements::NTuple{manifold_dim, Int}: the number of elements in each direction.degrees::NTuple{manifold_dim, Int}: the degrees of the B-spline spaces.regularities::NTuple{manifold_dim, Int}: the regularities of the B-spline spaces.
Returns
Vector{AbstractFormSpace}: themanifold_dim+1form spaces of the complex.
Mantis.Forms.create_hierarchical_de_rham_complex Method
create_hierarchical_de_rham_complex(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::NTuple{manifold_dim, F},
regularities::NTuple{manifold_dim, Int},
num_subdivisions::NTuple{manifold_dim, Int},
truncate::Bool,
simplified::Bool,
geometry::G,
) where {
manifold_dim,
F <: FunctionSpaces.AbstractCanonicalSpace,
G <: Geometry.AbstractGeometry{manifold_dim},
}Construct a hierarchical discrete de Rham complex of finite element spaces over a tensor-product geometry, equivalent to a Cartesian grid, in manifold_dim dimensions.
This routine initializes, for each form degree k = 0,…,manifold_dim, a hierarchical B-spline space of differential k‑forms without refinement.
See also create_tensor_product_bspline_de_rham_complex and FunctionSpaces.HierarchicalFiniteElementSpace.
Returns
- A tuple with the
manifold_dim + 1spaces that form the de Rham complex.
Mantis.Forms.create_polar_spline_de_rham_complex Method
create_polar_spline_de_rham_complex(
num_elements::NTuple{2, Int},
degrees::NTuple{2, Int},
regularities::NTuple{2, Int},
R::Float64;
refine::Bool=false,
geom_coeffs_tp::Union{Nothing, Array{Float64,3}}=nothing
)Create a polar B-spline de Rham complex.
Arguments
num_elements::NTuple{2, Int}: the number of elements in each direction.degrees::NTuple{2, Int}: the degrees of the B-spline spaces.regularities::NTuple{2, Int}: the regularities of the B-spline spaces.R::Float64: the radius of the domain.refine::Bool=false: whether to refine the domain.geom_coeffs_tp::Union{Nothing, Array{Float64,3}}=nothing: the geometry coefficients.
Returns
::Vector{AbstractFormSpace}: the 3 form spaces of the complex.::Vector{NTuple{N,SparseMatrixCSC{Float64,Int}} where {N}}: the global extraction operators.::NTuple{2, Array{Float64,3}}: the geometry coefficients for the underlying tensor-product B-spline spaces.
Mantis.Forms.create_polar_spline_de_rham_complex Method
create_polar_spline_de_rham_complex(
num_elements::NTuple{2, Int},
section_spaces::F,
regularities::NTuple{2, Int},
R::Float64;
refine::Bool=false,
geom_coeffs_tp::Union{Nothing, Array{Float64,3}}=nothing
) where {F <: NTuple{2, FunctionSpaces.AbstractCanonicalSpace}}Create a polar B-spline de Rham complex.
Arguments
num_elements::NTuple{2, Int}: the number of elements in each direction.section_spaces::F: the section spaces.regularities::NTuple{2, Int}: the regularities of the B-spline spaces.R::Float64: the radius of the domain.refine::Bool=false: whether to refine the domain.geom_coeffs_tp::Union{Nothing, Array{Float64,3}}=nothing: the geometry coefficients.
Returns
::Vector{AbstractFormSpace}: the 3 form spaces of the complex.::Vector{NTuple{N,SparseMatrixCSC{Float64,Int}} where {N}}: the global extraction operators.::NTuple{2, Array{Float64,3}}: the geometry coefficients for the underlying tensor-product B-spline spaces.
Mantis.Forms.create_tensor_product_bspline_de_rham_complex Method
create_tensor_product_bspline_de_rham_complex(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::NTuple{manifold_dim, F},
regularities::NTuple{manifold_dim, Int},
geometry::G,
) where {
manifold_dim,
F <: FunctionSpaces.AbstractCanonicalSpace,
G <: Geometry.AbstractGeometry{manifold_dim},
}Create a tensor-product B-spline de Rham complex.
Arguments
starting_points::NTuple{manifold_dim, Float64}: the starting points of the domain.box_sizes::NTuple{manifold_dim, Float64}: the sizes of the domain.num_elements::NTuple{manifold_dim, Int}: the number of elements in each direction.section_spaces::NTuple{manifold_dim, F}: the section spaces.regularities::NTuple{manifold_dim, Int}: the regularities of the B-spline spaces.geometry::G: the geometry of the domain.
Returns
::Tuple{<:AbstractFormSpace{manifold_dim, form_rank}}: Tuple with the form spaces of the complex, for eachform_rankfrom0tomanifold_dim+1.
Mantis.Forms.create_tensor_product_bspline_de_rham_complex Method
create_tensor_product_bspline_de_rham_complex(
starting_points::NTuple{manifold_dim, Float64},
box_sizes::NTuple{manifold_dim, Float64},
num_elements::NTuple{manifold_dim, Int},
section_spaces::NTuple{manifold_dim, F},
regularities::NTuple{manifold_dim, Int},
mapping::M,
) where {
manifold_dim,
F <: FunctionSpaces.AbstractCanonicalSpace,
M <: Geometry.AbstractMapping{manifold_dim},
}Create a tensor-product B-spline de Rham complex.
Arguments
starting_points::NTuple{manifold_dim, Float64}: the starting points of the domain.box_sizes::NTuple{manifold_dim, Float64}: the sizes of the domain.num_elements::NTuple{manifold_dim, Int}: the number of elements in each direction.section_spaces::NTuple{manifold_dim, F}: the section spaces.regularities::NTuple{manifold_dim, Int}: the regularities of the B-spline spaces.mapping::M: the mapping that applied to be base geometry.
Returns
::Tuple{<:AbstractFormSpace{manifold_dim, form_rank}}: Tuple with the form spaces of the complex, for eachform_rankfrom0tomanifold_dim+1.
Mantis.Forms.create_tensor_product_bspline_de_rham_complex Method
create_tensor_product_bspline_de_rham_complex(
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},
) where {manifold_dim}Create a tensor-product B-spline de Rham complex.
Arguments
starting_points::NTuple{manifold_dim, Float64}: the starting points of the domain.box_sizes::NTuple{manifold_dim, Float64}: the sizes of the domain.num_elements::NTuple{manifold_dim, Int}: the number of elements in each direction.degrees::NTuple{manifold_dim, Int}: the degrees of the B-spline spaces.regularities::NTuple{manifold_dim, Int}: the regularities of the B-spline spaces.
Returns
Vector{AbstractFormSpace}: themanifold_dim+1form spaces of the complex.
Mantis.Forms.evaluate Method
evaluate(
form_field::FormField{manifold_dim, form_rank, FS},
element_idx::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {
manifold_dim,
form_rank,
FS <: AbstractFormSpace{manifold_dim, form_rank},
}Evaluates a differential form field at given canonical points xi mapped to the parametric element given by element_idx.
Arguments
form::FS: The differential form field.element_idx::Int: The parametric element identifier.xi::NTuple{manifold_dim, Vector{Float64}: The set of canonical points.
Returns
Vector{Vector{Float64}}: Vector of length equal to the number of components of the form, where each entry is aVector{Float64}of lengthn_evaluation_points.Vector{Vector{Int}}: This vector is always[[1]]because form fields have no basis.
Mantis.Forms.evaluate Method
evaluate(
integral::Integral{manifold_dim, F, Q},
global_element_id::Int,
) where {
manifold_dim,
form_rank,
expression_rank,
F <: AbstractForm{manifold_dim, form_rank, expression_rank},
}Evaluates the integral of a form over a given global element using a specified quadrature rule.
Arguments
integral::Integral{manifold_dim, F, Q}: The integral operator to evaluate.global_element_id::Int: The global element over which to evaluate the integral.
Returns
integral_eval::Vector{Float64}: The evaluated integral.integral_indices::Vector{Vector{Int}}: The indices of the evaluated integral. The length of the outer vector depends on theexpression_rankof the form expression.
Mantis.Forms.evaluate Method
evaluate(
form_space::FormSpace{manifold_dim, form_rank},
element_idx::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, form_rank}Evaluate the basis functions of a differential form space at given canonical points xi mapped to the parametric element given by element_idx.
Arguments
form_space::FormSpace{manifold_dim, form_rank, G}: The differential form space.element_idx::Int: The parametric element identifier.xi::NTuple{manifold_dim, Vector{Float64}: The set of canonical points.
Returns
Vector{Matrix{Float64}}: Vector of length equal to the number of components of the form, where each entry is aMatrix{Float64}of size(n_evaluation_points, n_basis_functions)form_basis_indices::Vector{Vector{Int}}: The basis function indices evaluated at the canonical coordinates of the element.
Mantis.Forms.evaluate Method
evaluate(
form_field::AnalyticalFormField{manifold_dim},
element_idx::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim}Evaluates a differential form field at given canonical points xi mapped to the parametric element given by element_idx.
Arguments
form::FS: The analytical, differential form field.element_idx::Int: The parametric element identifier.xi::NTuple{manifold_dim, Vector{Float64}: The set of canonical points.
Returns
Vector{Vector{Float64}}: Vector of length equal to the number of components of the form, where each entry is aVector{Float64}of lengthn_evaluation_points.Vector{Vector{Int}}: This vector is always[[1]]because form fields have no basis.
Mantis.Forms.evaluate Method
evaluate(
ext_der::ExteriorDerivative{manifold_dim},
element_id::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim}Computes the exterior derivative at the element given by element_id, and canonical points xi.
Arguments
ext_der::ExteriorDerivative{manifold_dim}: The exterior derivative structure.element_id::Int: The element identifier.xi::Points.AbstractPoints{manifold_dim}: The set of canonical points.
Returns
::Vector{Array{Float64, expression_rank + 1}}: The evaluated exterior derivative. The number of entries in theVectorisbinomial(manifold_dim, form_rank). The size of theArrayis(num_eval_points, num_basis), wherenum_eval_points = Points.get_num_points(xi)andnum_basisis the number of basis functions used to represent theformonelement_id― forexpression_rank = 0the innerArrayis equivalent to aVector.
Mantis.Forms.evaluate Method
evaluate(
hodge::Hodge{manifold_dim},
element_id::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim}Computes the hodge star at the element given by element_id, and canonical points xi.
Arguments
hodge::Hodge{manifold_dim}: The hodge star structure.element_id::Int: The element identifier.xi::NTuple{manifold_dim, Vector{Float64}: The set of canonical points.
Returns
::Vector{Array{Float64, expression_rank + 1}}: The evaluated hodge star. The number of entries in theVectorisbinomial(manifold_dim, manifold_dim - form_rank). The size of theArrayis(num_eval_points, num_basis), wherenum_eval_points = Points.get_num_points(xi)andnum_basisis the number of basis functions used to represent theformonelement_id― forexpression_rank = 0the innerArrayis equivalent to aVector.
Mantis.Forms.evaluate Method
evaluate(
sharp::Sharp{manifold_dim}, element_id::Int, xi::Points.AbstractPoints{manifold_dim}
) where {manifold_dim}Evaluates the sharp operator on a differential 1-form over a specified element of a manifold, converting the form into a vector field. Note that both the 1-form and the vector-field are defined in reference, curvilinear coordinates.
Arguments
sharp::Sharp{manifold_dim}: The sharp structure containing the form to be evaluated.element_id::Int: The identifier of the element on which the sharp is to be evaluated.xi::Points.AbstractPoints{manifold_dim}: A tuple containing vectors of floating-point
numbers representing the coordinates at which the 1-form is evaluated. Each vector
within the tuple corresponds to a dimension of the manifold.Returns
::Vector{Matrix{Float64}}: Each component of the vector, corresponding to each ∂ᵢ, stores the sharp evaluation. The size of each matrix is (number of evaluation points)x(number of basis functions).::Vector{Vector{Int}}: Each component of the vector, corresponding to each ∂ᵢ, stores the indices of the evaluated basis functions.
Mantis.Forms.evaluate Method
evaluate(
wedge::Wedge{manifold_dim}, element_id::Int, xi::Points.AbstractPoints{manifold_dim}
) where {manifold_dim}Computes the wedge at the element given by element_id, and canonical points xi.
Arguments
wedge::Wedge: The wedge structure.element_id::Int: The element identifier.xi::Points.AbstractPoints{manifold_dim}: The canonical points used for evaluation.
Returns
wedge_eval::Vector{Array{Float64, 1 + expression_rank_1 + expression_rank_2}}: The evaluation of the wedge. The length of the vector ifbinomial(manifold_dim, form_rank).wedge_indices::Vector{Int}: The indices of the evaluated basis. The length of the vector is the sum of the number of basis functions of each form of the wedge supported at the given element.
Mantis.Forms.evaluate_pushforward Method
evaluate_pushforward(vfield::Vector{Matrix{Float64}},
jacobian::Array{Float64,3})Evaluate the pushforward of the vector field at the discrete points where it has been evaluated. The pushforward is the action of the Jacobian of the field on the field itself.
Arguments
vfield::Vector{Matrix{Float64}}: The pointwise evaluated vector field to evaluate the pushforward for.jacobian::Array{Float64,3}: The Jacobian of the vector field evaluated at the discrete points.manifold_dim::Int: The dimension of the embedding manifold.
Returns
::Vector{Matrix{Float64}}: The evaluated pushforward of the vector field at the discrete points.
Mantis.Forms.evaluate_sharp_pushforward Method
evaluate_sharp_pushforward(
form_expression::AbstractForm{manifold_dim, 1, 0},
element_id::Int,
xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim}Compute the pushforward of the sharp of a differential 1-form over a specified element of a manifold, converting the form into a vector field. Note that the output vector-field is defined in physical coordinates.
Arguments
form_expression::AbstractForm{manifold_dim, 1, G}: An expression representing the 1-form on the manifold.element_id::Int: The identifier of the element on which the sharp is to be evaluated.xi::Points.AbstractPoints{manifold_dim}: A tuple containing vectors of floating-point numbers representing the coordinates at which the 1-form is evaluated. Each vector within the tuple corresponds to a dimension of the manifold.
Returns
evaluated_pushforward::Vector{Matrix{Float64}}: Each component of the vector, stores the evaluated pushforward of the sharp of the 1-form. The size of each matrix is (number of evaluation points)x(number of basis functions).sharp_indices::Vector{Vector{Int}}: Each component of the vector, stores the indices of the evaluated basis functions.
Mantis.Forms.get_basis_index_combinations Method
get_basis_index_combinations(manifold_dim::Int, form_rank::Int)Generate all possible k-form basis index combinations.
Arguments
manifold_dim::Int: the dimension of the manifold.form_rank::Int: the rank of the form.
Returns
NTuple{binomial(manifold_dim, form_rank), Vector{Int}}: the basis index combinations.
Mantis.Forms.get_coefficients Method
get_coefficients(form_field::FormField)Returns the coefficients of the form field.
Arguments
form_field::FormField: The form field.
Returns
Vector{Float64}: The coefficients of the form field.
Mantis.Forms.get_estimated_nnz_per_elem Method
get_estimated_nnz_per_elem(form::AbstractForm)Returns the estimated number of non-zero entries per element for the given form expression.
Arguments
form::AbstractForm: The form expression.
Returns
::Int: The estimated number of non-zero entries per element.
Mantis.Forms.get_estimated_nnz_per_elem Method
get_estimated_nnz_per_elem(integral::Integral)Returns the estimated number of non-zero entries per element for the integral operator.
Arguments
integral::Integral: The integral operator.
Returns
::Int: The estimated number of non-zero entries per element associated with the integral operator.
Mantis.Forms.get_expression Method
get_expression(form_field::AnalyticalFormField)Returns the expression of the analytical form field.
Arguments
form_field::AnalyticalFormField: The analytical form field.
Returns
<:Function: The expression of the analytical form field.
Mantis.Forms.get_expression_rank Method
get_expression_rank(op::AbstractRealValuedOperator)Returns the rank of the expression associated with the given operator.
Arguments
op::AbstractRealValuedOperator: The given operator.
Returns
::Int: The rank of the expression associated with the given operator.
Mantis.Forms.get_expression_rank Method
get_expression_rank(
::AbstractForm{manifold_dim, form_rank, expression_rank}
) where {manifold_dim, form_rank, expression_rank}Returns the expression_rank of the given form.
Arguments
::FE: The form expression.
Returns
::Int: The expression rank of the form.
Mantis.Forms.get_fe_space Method
get_fe_space(form::FS) where {FS <: AbstractForm}Returns the finite element space associated with the given form. Note that this function recurses untill it finds a form (usually a FormSpace) which has an underlying finite element space.
Arguments
form_space::AbstractForm: The form space.
Returns
<:FunctionSpaces.AbstractFESpace: The finite element space.
Mantis.Forms.get_form Method
get_form(op::AbstractRealValuedOperator)Returns the form to which the given operator is applied.
Arguments
op::AbstractRealValuedOperator: The operator to which the form is applied.
Returns
<:AbstractFormExpression: The form to which the operator is applied.
Mantis.Forms.get_form Method
get_form(ext_der::ExteriorDerivative)Returns the form to which the exterior derivative is applied.
Arguments
ext_der::ExteriorDerivative: The exterior derivative.
Returns
<:AbstractForm: The form to which the exterior derivative is applied.
Mantis.Forms.get_form Method
get_form(form_expression::Hodge)Returns the form to which the hodge star is applied.
Arguments
form_expression::Hodge: The hodge star structure.
Returns
<:AbstractForm: The form to which the hodge star is applied.
Mantis.Forms.get_form Method
get_form(integral::Integral)Returns the form associated with the integral operator.
Arguments
integral::Integral: The integral operator.
Returns
<: AbstractForm: The form associated with the integral operator.
Mantis.Forms.get_form Method
get_form(sharp::Sharp)Returns the form to which the sharp is applied.
Arguments
sharp::Sharp: The sharp structure.
Returns
<:AbstractForm: The form to which the sharp is applied.
Mantis.Forms.get_form Method
get_forms(wedge::Wedge, id::Int)Returns the id-th form in the Wedge structure.
Arguments
wedge::Wedge: The wedge structure.id::Int: The id of the form to be returned.
Returns
<:AbstractForm: Theid-th form to which the wedge is applied.
Mantis.Forms.get_form Method
get_form(wedge::Wedge)Returns the form with expression rank 1 in the Wedge structure.
Arguments
wedge::Wedge: The wedge structure.
Returns
<:AbstractFormSpace: The form with expression rank 1.
Mantis.Forms.get_form_rank Method
get_form_rank(
::AbstractForm{manifold_dim, form_rank, expression_rank}
) where {manifold_dim, form_rank, expression_rank}Returns the form rank of the given form.
Arguments
::FE: The form.
Returns
::Int: The form rank of the form.
Mantis.Forms.get_form_space Method
get_form_space(form_field::FormField)Returns the form space associated with the form field.
Arguments
form_field::FormField: The form field.
Returns
<:AbstractFormSpace: The form space associated with the form field.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(form_field::AbstractFormField)Returns the list of spaces of forms of expression_rank > 0 in the tree of the expression. Since FormField has a single form of expression_rank = 0 it returns an empty Tuple.
Arguments
form_field::AbstractFormField: The AbstractFormField structure.
Returns
Tuple(<:AbstractForm): The list of forms present in the tree of the expression, in this case empty.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(form_space::AbstractFormSpace)Returns the list of spaces of forms of expression_rank > 0 in the tree of the expression. Since AbstractFormSpace has a single form of expression_rank = 1 it returns a Tuple with the space of the AbstractFormSpace.
Arguments
form_space::AbstractFormSpace: The AbstractFormSpace structure.
Returns
::Tuple(<:AbstractForm): The list of forms present in the tree of the expression, in this case the form space.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(bin_trans::BinaryFormTransformation)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the binary transformation, e.g., for (α ∧ β) + γ, it returns the spaces of α, β, and γ, if all have exprssion_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
bin_trans::BinaryFormTransformation: The binary transformation structure.
Returns
Tuple(<:AbstractForm): The list of forms present in the tree of the binary transformation.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(bin_trans::BinaryOperatorTransformation)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the binary transformation, e.g., for (α ∧ β) + γ, it returns the spaces of α, β, and γ, if all have exprssion_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
bin_trans::BinaryOperatorTransformation: The binary transformation structure.
Returns
Tuple(<:AbstractFormSpace): The list of FormSpace present in the tree of the binary transformation.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(ext_der::ExteriorDerivative)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the exterior derivative, e.g., for d((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have expression_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
ext_der::ExteriorDerivative: The exterior derivative structure.
Returns
Tuple(<:AbstractForm): The list of spaces of forms present in the tree of the exterior derivative.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(hodge::Hodge)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the Hodge, e.g., for ★((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have exprssion_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
hodge::Hodge: The Hodge structure.
Returns
Tuple(<:AbstractForm): The list of spaces forms present in the tree of the Hodge.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(integral::Integral)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the integrand of integral, e.g., for ∫c*((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have expression_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
integral::Integral: The Integral structure.
Returns
Tuple(<:AbstractForm): The list of form spaces present in the tree of the integrand of integral.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(wedge::Sharp)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the sharp operator, e.g., for ♯((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have exprssion_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
sharp::Sharp: The sharp structure.
Returns
Tuple(<:AbstractForm): The list of forms present in the tree of the sharp.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(uni_trans::UnaryFormTransformation)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the unary transformation, e.g., for c*((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have expression_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
uni_trans::UnaryFormTransformation: The unary transformation structure.
Returns
Tuple(<:AbstractForm): The list of form spaces present in the tree of the unary transformation.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(uni_trans::UnaryOperatorTransformation)Returns the spaces of forms of expression_rank > 0 appearing in the tree of the unary transformation, e.g., for c*((α ∧ β) + γ), it returns the spaces of α, β, and γ, if all have expression_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
uni_trans::UnaryOperatorTransformation: The unary transformation structure.
Returns
Tuple(<:AbstractForm): The list of form spaces present in the tree of the unary transformation.
Mantis.Forms.get_form_space_tree Method
get_form_space_tree(wedge::Wedge)Returns the spaces of the forms of expression_rank > 0 appearing in the tree of the wedge operator, e.g., for (α ∧ β) ∧ γ, it returns the spaces of α, β, and γ, if all have expression_rank > 1. If α has expression_rank = 0, it returns only the spaces of β and γ.
Arguments
wedge::Wedge: The wedge structure.
Returns
Tuple(<:AbstractForm): The list of spaces of forms present in the tree of the wedge product.
Mantis.Forms.get_forms Method
get_forms(wedge::Wedge)Returns the forms to which the wedge is applied.
Arguments
wedge::Wedge: The wedge structure.
Returns
<:AbstractForm: The first form to which the wedge is applied.<:AbstractForm: The second form to which the wedge is applied.
Mantis.Forms.get_geometry Method
get_geometry(
single_form::AbstractForm, additional_forms::AbstractForm...
)If a single form is given, returns the geometry of that form. If additional forms are given, checks if all the geometries of the different forms refer to the same object in memory, and then returns it.
Arguments
single_form::AbstractForm: The first form.additional_forms::AbstractForm...: Arbitrary number of additional forms.
Returns
<:Geometry.AbstractGeometry: The geometry of the given form(s).
Mantis.Forms.get_geometry Method
get_geometry(form::AbstractForm)Returns the geometry of the given form expression.
Arguments
form::AbstractForm: The form expression.
Returns
<:Geometry.AbstractGeometry: The geometry of the form expression.
Mantis.Forms.get_geometry Method
get_geometry(op::AbstractRealValuedOperator)Returns the geometry associated to the form to which the given operator is applied.
Arguments
op::AbstractRealValuedOperator: The operator to which the form is applied.
Returns
<:AbstractgeometryExpression: The geometry where the form in the operator is defined.
Mantis.Forms.get_geometry Method
get_geometry(ext_der::ExteriorDerivative)Returns the geometry of the form associated with the exterior derivative.
Arguments
ext_der::ExteriorDerivative: The exterior derivative.
Returns
<:Geometry.AbstractGeometry: The geometry of the form.
Mantis.Forms.get_geometry Method
get_geometry(form_expression::Hodge)Returns the geometry of form expression used in the hodge star.
Arguments
form_expression::Hodge: The hodge star structure.
Returns
<:Geometry.AbstractGeometry: The geometry of the form expression.
Mantis.Forms.get_label Method
get_label(form::AbstractForm)Returns the label of the form expression.
Arguments
form::AbstractForm: The form expression.
Returns
AbstractString: The label of the form expression.
Mantis.Forms.get_manifold_dim Method
get_manifold_dim(::AbstractForm{manifold_dim}) where {manifold_dim}Returns the manifold dimension of the given form.
Arguments
::AbstractForm{manifold_dim}: The form.
Returns
manifold_dim::Int: The manifold dimension.
Mantis.Forms.get_max_local_dim Method
get_max_local_dim(form_space::AbstractFormSpace)Compute an upper bound of the element-local dimension of form_space. Note that this is not necessarily a tight upper bound.
Arguments
form_space::AbstractFormSpace: The form space.
Returns
::Int: The element-local upper bound.
Mantis.Forms.get_num_basis Method
get_num_basis(form_space::AbstractFormSpace, element_id::Int)Returns the number of basis functions at the given element of the function space associated the given form space.
Arguments
form_space::AbstractFormSpace: The form space.
Returns
Int: The number of basis functions at the given element.
Mantis.Forms.get_num_basis Method
get_num_basis(form_space::AbstractFormSpace)Returns the number of basis functions of the function space associated with the given form space.
Arguments
form_space::AbstractFormSpace: The form space.
Returns
Int: The number of basis functions of the function space.
Mantis.Forms.get_num_coefficients Method
get_num_coefficients(form_field::FormField)Returns the number of coefficients of the form field.
Arguments
form_field::FormField: The form field.
Returns
Int: The number of coefficients (dofs) of the form field.
Mantis.Forms.get_num_elements Method
get_num_elements(form::AbstractForm)Returns the number of elements in the geometry of the given form expression.
Arguments
form::AbstractForm: The form expression.
Returns
Int: The number of elements in the geometry of the form expression.
Mantis.Forms.get_num_elements Method
get_num_elements(integral::Integral)Returns the number of elements in the geometry associated with the integral operator.
Arguments
integral::Integral: The integral operator.
Returns
::Int: The number of elements associated with the integral operator.
Mantis.Forms.get_num_evaluation_elements Method
get_num_evaluation_elements(integral::Integral)Returns the number of evaluation elements in the quadrature rule associated with the integral operator.
Arguments
integral::Integral: The integral operator.
Returns
::Int: The number of evaluation elements associated with the integral operator.
Mantis.Forms.get_quadrature_rule Method
get_quadrature_rule(integral::Integral)Returns the quadrature rule associated with the integral operator.
Arguments
integral::Integral: The integral operator.
Returns
<:Quadrature.AbstractGlobalQuadratureRule: Returns the quadrature rule associated with the integral operator.
Mantis.Forms.set_dirichlet_boundary_conditions Method
set_dirichlet_boundary_conditions(form::AbstractFormSpace, value::Float64)Creates a dictionary of Dirichlet boundary conditions for a given form space.
Arguments
form::AbstractFormSpace: The form for which to compute the boundary conditions.value::Float64: The value of the Dirichlet boundary condition.
Returns
::Dict{Int, Float64}: The dictionary of Dirichlet boundary conditions.
Mantis.Forms.trace_basis_idxs Method
trace_basis_idxs(
form::AbstractForm{manifold_dim, form_rank, expression_rank}
) where {manifold_dim, form_rank, expression_rank}Creates a list of basis function idxs which control the trace of the form on the boundary.
Arguments
form::AbstractForm: The form for which to compute the boundary conditions.
Returns
Vector{Int}: The list of basis idxs.
Mantis.Forms.update_hierarchical_de_rham_complex Method
update_hierarchical_de_rham_complex(
complex::C, H⁰::FunctionSpaces.HierarchicalFiniteElementSpace{manifold_dim}
) where {manifold_dim, num_forms, C <: NTuple{num_forms, AbstractFormSpace}}Refines each k-form space of complex, for k = 1,…,manifold_dim, according to the previously refined 0-form space H⁰.
The active hierarchical mesh is retrieved from H⁰, and the basis functions are updated independently according to the polynomial degree of each space.
See also FunctionSpaces.add_level! and FunctionSpaces.update_basis!.
Arguments
complex::C: The hierarchical B-spline de Rham complex.H⁰::FunctionSpaces.HierarchicalFiniteElementSpace{manifold_dim}: The previously refined
`0-`form space.Returns
- A tuple with the
manifold_dim + 1refined spaces that form the de Rham complex.