Skip to content

Geometry

Mantis' Geometry module contains all functionality related to geometry.

Geometry

An (n,m) geometry Φ is a collection of L mappings {Φi}i=1L that map the canonical n-dimensional domain, Ω0:=[0,1]n into L n-dimensional simply connected subdomains, Ωi1 with i=1,,L, of Rm. Moreover, i=1LΩi1= and using Core: Argument Ωi1Ωj1Ωi1Ωj1 with i,j=1,,L.

Note that

Φi(ξ1,,ξn)=(x1,,xm),

and we use Φi,j=xj to mean the j-th component of the mapping Φ of element i.

Tensor Product Geometry

Given an (n1,m1) geometry Φ1 of L1 mappings and an (n2,m2) geometry Φ2 of L2 mappings, i.e.,

Φi1:[0,1]n1Ωi1Rm1,i=1,,L1

and

Φi2:[0,1]n2Ωi2Rm2,i=1,,L2

the tensor product geometry Φ:=Φ1Φ2 is an (n1+n2,m1+m2) geometry made up of a collection of L1L2 mappings Φk

Φk=L1(j1)+I:[0,1]n1×[0,1]n2Ωk=Ωi1×Ωj2Rm1+m2,i=1,,L1, and j=1,,L2.

Specifically, we have

ΦL1(j1)+i,l(ξ1,,ξn):={Φi,l1(ξ1,,ξn1),if ln1Φj,ln12(ξn1+1,,ξn1+n2),if n1<ln1+n2,i=1,,L1,j=1,,L2, and l=1,,m1+m2.

The Jacobian of this geometry

Jl,vk:=Φk,lξv

is given by

ΦL1(j1)+i,lξv(ξ1,,ξn):={Φi,l1ξv(ξ1,,ξn1),if ln1, and vm1Φj,ln12ξum1(ξn1+1,,ξn1+n2),if n1<ln1+n2, and m1<vm1+m20otherwise,i=1,,L1,j=1,,L2, and l=1,,m1+m2.

Evaluation

Given the NTuple ξ of n Vectors, ξi, i=1,,n, each containing mi unidimensional coordinates ξji, i=1,,n and j=1,mi, the tensor product geometry is evaluated at the element element_idx and at the i=1nmi tensor product points Vk=j1+i=2n(ji1)l=1i1ml=(ξj11,,ξjnn), with ji=1,,mi.

The output is a matrix, X of dimensions (i=1nmi)×m (the number of tensor product points where the geometry is evaluated in element element_idx, and the dimension of the embedding space to where the canonical element is mapped into. Specifically:

Xk,l=Φr,l(ξj11,,ξjnn),

where r= element_idx, and k=j1+i=2n(ji1)l=1i1ml, as before.

Jacobian

Given the NTuple ξ of n Vectors, ξi, i=1,,n, each containing mi unidimensional coordinates ξji, i=1,,n and j=1,mi, evaluates the Jacobian of the tensor product geometry at the element element_idx and at the i=1nmi tensor product points Vk=j1+i=2n(ji1)l=1i1ml=(ξj11,,ξjnn), with ji=1,,mi.

The output is a matrix, J of dimensions (i=1nmi)×m×n (the number of tensor product points where the geometry is evaluated in element element_idx, the dimension of the embedding space to where the canonical element is mapped into, and the dimension of the canonical element, which is the same as the dimension of the element's manifold). Specifically:

Jk,l,s=Φr,lξs(ξj11,,ξjnn),

where r=element_idx, and k=j1+i=2n(ji1)l=1i1ml, as before.

All docstrings from Mantis.Geometry

Mantis.Geometry Module
julia
module Geometry

Contains all geometry structure definitions and related methods.

source
Mantis.Geometry.AbstractEvaluationMask Type
julia
AbstractEvaluationMask{manifold_dim}

Supertype for all evaluation maskes. An evaluation mask describes how to map from a set of evaluation points on a manifold to a set of evaluation points on a base mesh. This is useful for example when evaluating a function on a finer mesh than the one used for integration.

source
Mantis.Geometry.AffineEvaluationMask Type
julia
AffineEvaluationMask{manifold_dim, num_elements, num_elements_base, M, T, S}

Given an object with d-dimensional elements 1:n, we construct:

  • A new object with d-dimensional elements 1:m

  • A function E: {1:m} -> {1:n} such that if E(i) = j, then the i-th element is nested

inside the j-th element

  • A data structure F: {1:m} -> (x, c) \in [0,1]^{2d} such that, after rescaling the j-th

element to a unit cell, a point y inside the i-th element can be located inside the j-th element as: x + c * y. The tuple (E, F) defines an evaluation mask.

Fields

  • element_id_map::M: The mapping from the evaluation elements to the base elements.

  • translations::Vector{T}: The translations from base to evaluation elements.

  • scalings::Vector{S}: The scalings of evalution elements relative to the base elements.

source
Mantis.Geometry.CartesianGeometry Type
julia
CartesianGeometry{manifold_dim, image_dim, num_patches, T, CI} <: AbstractGeometry{
    manifold_dim, image_dim, num_patches
}

A structure representing a Cartesian grid geometry in manifold_dim dimensions. Can have multiple patches, even though each patch is still a Cartesian grid. Note that the patches are not required to have a matching grid.

Fields

  • breakpoints::T: A tuple of vectors defining the grid points in each dimension.

  • cart_num_elements::CI: A (tuple of) CartesianIndices representing the indices of elements in the grid for each patch.

Constructors

  • CartesianGeometry( breakpoints::T ) where { manifold_dim, num_patches, NT <: Number, T <: NTuple{num_patches, NTuple{manifold_dim, AbstractVector{NT}}}, }: General constructor.

  • CartesianGeometry( breakpoints::NTuple{manifold_dim, AbstractVector{NT}} ) where {manifold_dim, NT <: Number}: Single-patch convenience constructor.

source
Mantis.Geometry.DiscreteGeometry Type
julia
DiscreteGeometry{manifold_dim, image_dim, num_patches, F} <: AbstractGeometry{
    manifold_dim, image_dim, num_patches
}

A geometry defined in terms of an evaluable_function over a given number of elements and manifold dimension.

Fields

  • evaluable_function::F: Function that, given an element_id and local coordinates xi, returns values and derivatives in the same nested format as a finite element space (see FunctionSpaces). In particular, the output structure must be compatible with FunctionSpaces.AbstractFESpace so that geometry evaluations and Jacobians can be computed element-wise.

  • num_elements::Int: Total number of elements in the discrete geometry.

Type parameters

  • manifold_dim: Dimension of the reference (parametric) domain.

  • image_dim: Dimension of the physical embedding space.

  • num_patches: Number of patches of the geometry.

  • F: The type of the evaluable function.

source
Mantis.Geometry.MaskedGeometry Type
julia
MaskedGeometry{manifold_dim, G, M}

A masked geometry obtained by a pseudo-refinement of another geometry. The geometry base_geometry is the original geometry and it is composed with the evaluation mask eval_mask.

Fields

  • base_geometry::G: The base geometry.

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

source
Mantis.Geometry.TensorProductGeometry Type
julia
TensorProductGeometry{
	manifold_dim, image_dim, num_patches, num_geometries, T, CI, LI
} <: AbstractGeometry{manifold_dim, image_dim, num_patches}

A geometry build by tensoring multiple constituent geometries.

Fields

  • geometries::T: Tuple of constituent geometries.

  • cart_num_elements::CI: A collection of Cartesian indices representing the

julia
multi-dimensional positions of each tensor product element. Useful to convert from
linear to Cartesian indexing.
  • lin_num_elements::LI: A collection of linear indices representing the global indexing of
julia
each tensor product element. Useful to convert from Cartesian to linear indexing.
  • num_elements_per_patch::NTuple{num_patches, Int}: The number of elements on each patch.
source
Mantis.Geometry.UnstructuredGeometry Type
julia
UnstructuredGeometry{manifold_dim, image_dim, num_patches, GP} <: AbstractGeometry{
    manifold_dim, image_dim, num_patches
}

A geometry consisting of multiple patches, each with its own geometry.

Avoid heterogeneous inputs.

While the constructors allow different types of geometries, it is strongly recommended to use only a few different types. Failing to do so can cause type instabilities and therefore a significant performance penalty.

Fields

  • geometry_per_patch::NTuple{GP, num_patches}: The geometries for each patch.

  • num_elements::Int: The total number of elements in the geometry.

  • num_elements_per_patch::NTuple{num_patches, Int}: The number of elments per patch.

source
Mantis.Geometry.compose_evaluation_masks Method
julia
compose_evaluation_masks(
	eval_mask_1::AffineEvaluationMask{manifold_dim, num_elements, num_elements_base_1},
	eval_mask_2::AffineEvaluationMask{
		manifold_dim, num_elements_base_1, num_elements_base_2
	},
)

Compose two evaluation maskes.

Arguments

  • eval_mask_1::AffineEvaluationMask: The first evaluation mask.

  • eval_mask_2::AffineEvaluationMask: The second evaluation mask

Returns

  • eval_mask::AffineEvaluationMask: The composed evaluation mask (E_2\circ E_1), such that

the evaluation elements are nested inside the base elements of the second evaluation mask.

source
Mantis.Geometry.create_cartesian_box Method
julia
create_cartesian_box(
    starting_points::NTuple{manifold_dim, Float64},
    box_sizes::NTuple{manifold_dim, Float64},
    num_elements::NTuple{manifold_dim, Int},
) where {manifold_dim}

Create a Cartesian box geometry with manifold_dim dimensions, starting at starting_points and with box_sizes and num_elements defining the size of the box.

Arguments

  • starting_points::NTuple{manifold_dim, Float64}: The starting points of the box.

  • box_sizes::NTuple{manifold_dim, Float64}: The size of the box.

  • num_elements::NTuple{manifold_dim, Int}: The number of elements in each dimension.

Output

  • ::CartesianGeometry{manifold_dim}: The Cartesian box geometry.
source
Mantis.Geometry.create_curvilinear_square Method
julia
create_curvilinear_square(
    starting_points::NTuple{2, Float64},
    box_sizes::NTuple{2, Float64},
    num_elements::NTuple{2, Int};
    c::Float64=0.1,
)

Create a single-patch curvilinear square geometry with num_elements elements in each direction and a c parameter to change the deformation of the mapping. Not that the mapping becomes singular with c = 0.3.

Arguments

  • num_elements::NTuple{2,Int}: The number of elements in each direction.

  • c::Float64 = 0.1: The c parameter.

Output

  • geometry::MappedGeometry{2, 2, 1}: The curvilinear square geometry.
source
Mantis.Geometry.evaluate Method
julia
evaluate(mapping::Mapping, x::Matrix{Float64})

Evaluates the mappping of the points x from the parametric space to physical space.

Arguments

  • mapping::Mapping: The mapping defining the transformation of the points x.

  • x::Matrix{Float64}: The points in parametric space to be mapped.

Returns

  • ::Matrix{Float64}: The mapped points in physical space. The size of the matrix is (num_points, image_dim), where num_points is the number of rows in x and image_dim is the dimension of the mapped points.
source
Mantis.Geometry.evaluate Method
julia
evaluate(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Computes the coordinates of the physical points, given the canonical points xi, on the element identified by element_id of a given geometry.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being evaluated.

  • element_id::Int: The global element id.

  • xi::Points.AbstractPoints{manifold_dim}: The points in the canonical domain at which to evaluate the geometry.

Returns

  • ::Matrix{Float64}: The physical coordinates of xi on element element_id. The size of the matrix is (num_eval_points, image_dim).

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_base_element Method
julia
get_base_element(eval_mask::AffineEvaluationMask, element_id::Int)

Get the base element index.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The element index.

Returns

  • element_id_base::Int: The base element index.
source
Mantis.Geometry.get_cart_num_elements Function
julia
get_cart_num_elements(geometry::CartesianGeometry, patch_id::Int=1)

Returns a CartesianIndices iterator of all elements in the patch indicated by patch_id.

source
Mantis.Geometry.get_cart_num_elements Method
julia
get_cart_num_elements(geometry::TensorProductGeometry)

Returns a CartesianIndices iterator of all elements in the geometry.

source
Mantis.Geometry.get_element_ids Method
julia
get_element_ids(eval_mask::AffineEvaluationMask, element_id_base::Int)

Get the element indices corresponding to a base element.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id_base::Int: The base element index.

Returns

  • element_ids::Vector{Int}: The element indices.
source
Mantis.Geometry.get_element_lengths Method
julia
get_element_lengths(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}, element_id::Int,
) where {manifold_dim, image_dim, num_patches}

Computes the length, in each manifold dimension, of the element given by element_id in geometry.

Arguments

  • 'geometry::AbstractGeometry': The geometry being used.

  • 'element_id::Int': Index of the element being considered.

Returns

  • '<:NTuple{manifold_dim, Number}': The element's lengths.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_element_measure Method
julia
get_element_measure(geometry::AbstractGeometry, element_id::Int)

Computes the measure of the element given by element_id in geometry.

Arguments

  • 'geometry::AbstractGeometry': The geometry being used.

  • 'element_id::Int': Index of the element being considered.

Returns

  • '<:Number': The measure of the element.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_element_vertices Method
julia
get_element_vertices(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}, element_id::Int,
) where {manifold_dim, image_dim, num_patches}

Computes the vertices, in each manifold dimension, of the element given by element_id in geometry.

Arguments

  • 'geometry::AbstractGeometry': The geometry being used.

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

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_geometry Method
julia
get_geometry(geometry::AbstractGeometry, patch_id::Int)

Get (or create) the physical geometry on a specific patch.

Arguments

  • geometry::AbstractGeometry: The multi-patch geometry.

  • patch_id::Int: The patch ID.

Returns

  • <:AbstractGeometry{manifold_dim, image_dim, 1}: The geometry on the specified patch.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_global_element_id Method
julia
get_global_element_id(geometry::AbstractGeometry, patch_id::Int, local_element_id::Int)

Get the global element ID for the specified constituent patch ID and local element ID.

Arguments

  • geometry::AbstractGeometry: A (multi-)patch geometry.

  • patch_id::Int: The constituent patch ID.

  • local_element_id::Int: The local element ID.

Returns

  • ::Int: The global element ID.
source
Mantis.Geometry.get_image_dim Method
julia
get_image_dim(::AbstractGeometry{manifold_dim, image_dim, num_patches})

Returns the dimensions of the image manifold of a given geometry.

Arguments

  • ::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being used.

Returns

  • ::Int: The image manifold dimension.
source
Mantis.Geometry.get_image_dim Method
julia
get_image_dim(mapping::Mapping{manifold_dim, image_dim})

Returns the dimension of the image manifold of the mapping.

Arguments

  • ::Mapping{manifold_dim, image_dim}: The mapping structure.

Returns

  • ::Int: The dimension of the image manifold.
source
Mantis.Geometry.get_lin_num_elements Function
julia
get_lin_num_elements(geometry::CartesianGeometry, patch_id::Int=1)

Returns a LinearIndices iterator of all elements in the patch indicated by patch_id.

source
Mantis.Geometry.get_lin_num_elements Method
julia
get_lin_num_elements(geometry::TensorProductGeometry)

Returns a LinearIndices iterator of all elements in the geometry.

source
Mantis.Geometry.get_manifold_dim Method
julia
get_manifold_dim(eval_mask::AbstractEvaluationMask)

Get the dimension of the manifold.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

Returns

  • manifold_dim::Int: The dimension of the manifold.
source
Mantis.Geometry.get_manifold_dim Method
julia
get_manifold_dim(::AbstractGeometry{manifold_dim, image_dim, num_patches})

Returns the dimensions of the domain manifold of a given geometry.

Arguments

  • ::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being used.

Returns

  • ::Int: The domain manifold dimension.
source
Mantis.Geometry.get_manifold_dim Method
julia
get_manifold_dim(mapping::Mapping{manifold_dim, image_dim})

Returns the dimension of the domain manifold of the mapping.

Arguments

  • ::Mapping{manifold_dim, image_dim}: The mapping structure.

Returns

  • ::Int: The dimension of the domain manifold.
source
Mantis.Geometry.get_measure_scale Method
julia
get_measure_scale(eval_mask::AffineEvaluationMask, element_id::Int)

Get the product of the scaling of the element.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The element index.

Returns

  • scaling::Float64: The scaling.
source
Mantis.Geometry.get_num_elements Method
julia
get_num_elements(eval_mask::AbstractEvaluationMask)

Get the number of elements in the evaluation mask.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

Returns

  • num_elements::Int: The number of elements.
source
Mantis.Geometry.get_num_elements Method
julia
get_num_elements(geometry::AbstractGeometry)
get_num_elements(geometry::AbstractGeometry, patch_id::Int)

Returns the number of elements in geometry. If a patch_id is given, return the number of elements in the patch.

Arguments

  • geometry::AbstractGeometry: The geometry being used.

Returns

  • ::Int: The number of elements in the geometry.

Notes

This method is used as a fallback and assumes that the number of elements (per patch) are explicitly stored.

Exceptions

  • Error "no field 'num_elements'": This error is thrown if the number of elements is not stored in a field called num_elementsand if no specificget_num_elementsmethod is defined for the givengeometry.

  • Error "no field 'num_elements_per_patch'": This error is thrown if the number of elements per patch is not stored in a field called num_elements_per_patchand if no specificget_num_elements_per_patch- orget_num_elements-method (withpatch_idargument) is defined for the givengeometry.

source
Mantis.Geometry.get_num_elements_base Method
julia
get_num_elements_base(eval_mask::AbstractEvaluationMask)

Get the number of elements in the base mesh.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

Returns

  • num_elements_base::Int: The number of elements in the base mesh.
source
Mantis.Geometry.get_num_elements_per_patch Method
julia
get_num_elements_per_patch(geometry::AbstractGeometry)

Returns the number of elements in each patch of geometry.

Arguments

  • geometry::AbstractGeometry: The geometry being used.

Returns

  • ::NTuple{num_patches, Int}: The number of elements per patch in the geometry.

Notes

This method is used as a fallback if there isn't a more specific method to be used. The latter should only be implemented explicitly if necessary.

Exceptions

  • Error "no field 'num_elements_per_patch'": This error is thrown if the number of elements per patch is not stored in a field called num_elements_per_patchand if no specificget_num_elements_per_patchmethod is defined for the givengeometry.
source
Mantis.Geometry.get_num_patches Method
julia
get_num_patches(::AbstractGeometry{manifold_dim, image_dim, num_patches})

Returns the number of patches in a given geometry.

Arguments

  • ::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being used.

Returns

  • ::Int: The number of patches in the geometry.
source
Mantis.Geometry.get_parametric_geometry Method
julia
get_parametric_geometry(geometry::AbstractGeometry, patch_id::Int)

Finds the parametric geometry of the patch given by patch_id in geometry. If no patch_id is given, the parametric geometry of the whole geometry is returned.

Arguments

  • 'geometry::AbstractGeometry': The (physical) geometry being used.

  • 'patch_id::Int': (Optional) ID of the patch to get the parametric geometry for.

Returns

  • '<:CartesianGeometry': The (patch-wise) parametric geometry.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.get_patch_and_local_element_id Method
julia
get_patch_and_local_element_id(geometry::AbstractGeometry, element_id::Int)

Get the constituent patch ID and local element ID for the specified global element ID.

Arguments

  • geometry::AbstractGeometry: The multi-patch geometry.

  • element_id::Int: The global element ID.

Returns

  • patch_id::Int: The patch ID

  • local_element_id::Int: The local element ID.

Exceptions

  • ArgumentError: This error is thrown if the given element_id is larger than the total number of elements found in the geometry.

  • Error "no field 'num_elements'": This error is thrown if the number of elements is not stored in a field called num_elementsand if no specificget_num_elementsmethod is defined for the givengeometry.

  • Error "no field 'num_elements_per_patch'": This error is thrown if the number of elements per patch is not stored in a field called num_elements_per_patchand if no specificget_num_elements-method (withpatch_idargument) is defined for the givengeometry.

source
Mantis.Geometry.get_patch_id Method
julia
get_patch_id(geometry::AbstractGeometry, element_id::Int)

Get the ID of the patch to which the specified global element belongs.

Arguments

  • geometry::AbstractGeometry: The (multi-patch) geometry.

  • element_id::Int: The global element ID.

Returns

  • patch_id::Int: ID of the patch to which the element belongs.

Exceptions

  • ArgumentError: This error is thrown if the given element_id is larger than the total number of elements found in the geometry.

  • Error "no field 'num_elements'": This error is thrown if the number of elements is not stored in a field called num_elementsand if no specificget_num_elementsmethod is defined for the givengeometry.

  • Error "no field 'num_elements_per_patch'": This error is thrown if the number of elements per patch is not stored in a field called num_elements_per_patchand if no specificget_num_elements-method (withpatch_idargument) is defined for the givengeometry.

source
Mantis.Geometry.get_scaling Method
julia
get_scaling(eval_mask::AffineEvaluationMask, element_id::Int)

Get the scaling of the element.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The element index.

Returns

  • scaling<:NTuple{manifold_dim, Real}: The scaling.
source
Mantis.Geometry.get_translation Method
julia
get_translation(eval_mask::AffineEvaluationMask, element_id::Int)

Get the translation of the element.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The element index.

Returns

  • translation<:NTuple{manifold_dim, Real}: The translation.
source
Mantis.Geometry.hessian Method
julia
hessian(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Computes the hessian at the physical points, given the canonical points xi, on the element identified by element_id of a given geometry.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being used.

  • element_id::Int: The global element id.

  • xi::Points.AbstractPoints{manifold_dim}: The points in the canonical domain to evaluate the hessian at.

Returns

  • ::Vector{NTuple{image_dim, SMatrix{manifold_dim, manifold_dim}}: The hessian at the physical points corresponding to the canonical points xi on element element_id. The length of the vector equals the number of evaluation points. Per points, there are image_dim many hessian metrices, hence the tuple.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.inv_metric Method
julia
inv_metric(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Returns the inverse metric, the metric and its determinant.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry.

  • element_id::Int: Global element id.

  • xi::Points.AbstractPoints{manifold_dim}: Evaluation points in the canonical domain.

Returns

  • ::Vector{SMatrix{manifold_dim, manifold_dim}}: Inverse metric tensor per evaluation point.

  • g::Vector{SMatrix{manifold_dim, manifold_dim}}: Metric tensor per evaluation point.

  • sqrt_g::Vector{Float64}: Square-root of the determinant of the metric per evaluation point.

source
Mantis.Geometry.jacobian Method
julia
jacobian(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Computes the jacobian at the physical points, given the canonical points xi, on the element identified by element_id of a given geometry.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry being used.

  • element_id::Int: The global element id.

  • xi::Points.AbstractPoints{manifold_dim}: The points in the canonical domain to evaluate the jacobian at.

Returns

  • ::Vector{SMatrix{image_dim, manifold_dim, Float64}}: The jacobian at the physical points corresponding to the canonical points xi on element element_id. The length of the vector equals the number of evaluation points.

Notes

There is no generic fallback for this method. It should be implemented for each concrete geometry type.

source
Mantis.Geometry.metric Method
julia
metric(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Returns the metric and its determinant.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry.

  • element_id::Int: Global element id.

  • xi::Points.AbstractPoints{manifold_dim}: Evaluation points in the canonical domain.

Returns

  • g::Vector{SMatrix{manifold_dim, manifold_dim}}: Metric tensor per evaluation point.

  • sqrt_g::Vector{Float64}: Square-root of the determinant of the metric per evaluation point.

source
Mantis.Geometry.metric_derivatives Method
julia
metric_derivatives(
    geometry::AbstractGeometry{manifold_dim, image_dim, num_patches},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim},
) where {manifold_dim, image_dim, num_patches}

Returns the inverse metric, the metric and its determinant.

Arguments

  • geometry::AbstractGeometry{manifold_dim, image_dim, num_patches}: The geometry.

  • element_id::Int: Global element id.

  • xi::Points.AbstractPoints{manifold_dim}: Evaluation points in the canonical domain.

Returns

  • J::Vector{SMatrix{image_dim, manifold_dim}}: Jacobian per point.

  • inv_g::Vector{SMatrix{manifold_dim, manifold_dim}}: Inverse metric tensor per point.

  • g::Vector{SMatrix{manifold_dim, manifold_dim}}: Metric tensor per point.

  • sqrt_g::Vector{Float64}: Square-root of the determinant of the metric per point.

  • dgdxs::NTuple{manifold_dim, Vector{SMatrix{manifold_dim, manifold_dim}}}: Derivative of the metric tensor per direction in manifold_dim.

  • dinv_g_dxs::NTuple{manifold_dim, Vector{SMatrix{manifold_dim, manifold_dim}}}: Derivative of the inverse metric tensor per direction in manifold_dim.

  • dsqrt_g_dxs::NTuple{manifold_dim, Vector{Float64}: Derivative of the square-root of the determinant of the metric tensor per direction in manifold_dim.

  • Hs::Vector{NTuple{image_dim, SMatrix{manifold_dim, manifold_dim}}}: Hessians per point.

source
Mantis.Geometry.subdivide_evaluation_mask Method
julia
subdivide_evaluation_mask(eval_mask, nsubd; elements_to_exclude)

Create a hierarchical evaluation mask by subdividing the i-th element of the evaluation mesh into nsubd[i][j] elements in the j-th direction. The elements_to_exclude argument is a vector of element indices to exclude from the mesh.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

  • nsubd::Vector{NTuple{manifold_dim, Int}}: The number of subdivisions in each direction.

  • elements_to_exclude::AbstractVector{Int}: The elements to exclude.

Returns

  • subdiv_eval_mask::AbstractEvaluationMask: The subdivided evaluation mask.
source
Mantis.Geometry.subdivide_evaluation_mask Method
julia
subdivide_evaluation_mask(eval_mask, nsubd; elements_to_exclude)

Create a hierarchical evaluation mask by subdividing the i-th element of the evaluation mesh into nsubd[i][j] elements in the j-th direction. The elements_to_exclude argument is a vector of element indices to exclude from the mesh.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

  • nsubd::Int: The number of subdivisions for each element.

  • elements_to_exclude::AbstractVector{Int}: The elements to exclude.

Returns

  • subdiv_eval_mask::AbstractEvaluationMask: The subdivided evaluation mask.
source
Mantis.Geometry.subdivide_evaluation_mask Method
julia
subdivide_evaluation_mask(eval_mask, nsubd; elements_to_exclude)

Create a hierarchical evaluation mask by subdividing the i-th element of the evaluation mesh into nsubd[i][j] elements in the j-th direction. The elements_to_exclude argument is a vector of element indices to exclude from the mesh.

Arguments

  • eval_mask::AbstractEvaluationMask: The evaluation mask.

  • nsubd::Vector{Int}: The number of subdivisions for each element.

  • elements_to_exclude::Vector{Int}: The elements to exclude.

Returns

  • subdiv_eval_mask::AbstractEvaluationMask: The subdivided evaluation mask.
source
Mantis.Geometry.transform_element_vertices Method
julia
transform_element_vertices(
    eval_mask::AbstractEvaluationMask{manifold_dim},
    element_vertices_base::NTuple{T},
    element_id::Int,
) where {manifold_dim, T <: AbstractVector}

Transforms the element_vertices_base, corresponding to the element vertices at the base element of element_id, according to the transformation of eval_mask.

Arguments

  • eval_mask::AbstractEvaluationMask{manifold_dim}: The evaluation mask.

  • element_vertices_base::NTuple{T}: The element vertices of the base geometry, evaluated

julia
at the base element corresponding to `element_id`.
  • element_id::Int: The element of evaluation mask.

Returns

  • element_vertices::NTuple{T}: The transformed element vertices corresponding to
julia
`element_id`.
source
Mantis.Geometry.transform_evaluation_points Method
julia
transform_evaluation_points(
    eval_mask::AffineEvaluationMask{manifold_dim, num_elements, num_elements_base},
    element_id::Int,
	xi::Points.AbstractPoints{manifold_dim}
)

Evaluate the mapping from the evaluation mask to the base.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The evaluation element index.

  • xi::Points.AbstractPoints{manifold_dim}: The canonical points for the evaluation mask.

Returns

  • element_id_base::Int: The element index in the range geometry.

  • xi_base::NTuple{manifold_dim, T}: The canonical points for the base.

  • scaling::NTuple{manifold_dim, Float64}: The scaling of the element.

source
Mantis.Geometry.transform_evaluation_points Method
julia
transform_evaluation_points(
    eval_mask::AffineEvaluationMask{manifold_dim, num_elements, num_elements_base},
    element_id::Int,
    xi::Points.AbstractPoints{manifold_dim}
)

Evaluate the mapping from the evaluation mask to the base.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

  • element_id::Int: The evaluation element index.

  • xi::Points.AbstractPointsP{manifold_dim}: The canonical points for the evaluation mask.

Returns

  • element_id_base::Int: The element index in the range geometry.

  • xi_base:Points.AbstractPoints{manifold_dim}: The canonical points for the base.

  • scaling::NTuple{manifold_dim, Float64}: The scaling of the element.

source
Mantis.Geometry.trim_evaluation_mask Method
julia
trim_evaluation_mask(
    eval_mask::AffineEvaluationMask{manifold_dim, num_elements, num_elements_base},
    elements_to_exclude::AbstractVector{Int}
)

Trim the evaluation mask by excluding elements.

Arguments

  • eval_mask::AffineEvaluationMask: The evaluation mask.

Returns

  • eval_mask::AffineEvaluationMask: The trimmed evaluation mask.
source
Mantis.Geometry.trivial_evaluation_mask Method
julia
trivial_evaluation_mask(manifold_dim::Int, num_elements::Int)

Create a trivial evaluation mask.

Arguments

  • manifold_dim::Int: The dimension of the manifold.

  • num_elements::Int: The number of elements.

Returns

  • eval_mask::AffineEvaluationMask: The trivial evaluation mask.
source