Interpolations
Type definitions
Interpolations are subtypes of Interpolation{shape, order}
, i.e. they are parametrized by the reference element and its characteristic order.
Fallback methods applicable for all subtypes of Interpolation
Ferrite.getrefshape
— MethodFerrite.getrefshape(::Interpolation)::AbstractRefShape
Return the reference element shape of the interpolation.
Ferrite.getorder
— MethodFerrite.getorder(::Interpolation)
Return order of the interpolation.
Ferrite.reference_shape_gradient
— Methodreference_shape_gradient(ip::Interpolation, ξ::Vec, i::Int)
Evaluate the gradient of the i
th shape function of the interpolation ip
in reference coordinate ξ
.
Ferrite.reference_shape_gradient_and_value
— Methodreference_shape_gradient_and_value(ip::Interpolation, ξ::Vec, i::Int)
Optimized version combining the evaluation Ferrite.reference_shape_value(::Interpolation)
and Ferrite.reference_shape_gradient(::Interpolation)
.
Ferrite.reference_shape_hessian_gradient_and_value
— Methodreference_shape_hessian_gradient_and_value(ip::Interpolation, ξ::Vec, i::Int)
Optimized version combining the evaluation Ferrite.reference_shape_value(::Interpolation)
, Ferrite.reference_shape_gradient(::Interpolation)
, and the gradient of the latter.
Ferrite.boundarydof_indices
— Functionboundarydof_indices(::Type{<:BoundaryIndex})
Helper function to generically dispatch on the correct dof sets of a boundary entity.
Ferrite.dirichlet_boundarydof_indices
— Functiondirichlet_boundarydof_indices(::Type{<:BoundaryIndex})
Helper function to generically dispatch on the correct dof sets of a boundary entity. Used internally in ConstraintHandler
and defaults to boundarydof_indices(ip::Interpolation)
for continuous interpolation.
Ferrite.reference_shape_values!
— Functionreference_shape_values!(values::AbstractArray{T}, ip::Interpolation, ξ::Vec)
Evaluate all shape functions of ip
at once at the reference point ξ
and store them in values
.
Ferrite.reference_shape_gradients!
— Functionreference_shape_gradients!(gradients::AbstractArray, ip::Interpolation, ξ::Vec)
Evaluate all shape function gradients of ip
at once at the reference point ξ
and store them in gradients
.
Ferrite.reference_shape_gradients_and_values!
— Functionreference_shape_gradients_and_values!(gradients::AbstractArray, values::AbstractArray, ip::Interpolation, ξ::Vec)
Evaluate all shape function gradients and values of ip
at once at the reference point ξ
and store them in values
.
Ferrite.reference_shape_hessians_gradients_and_values!
— Functionreference_shape_hessians_gradients_and_values!(hessians::AbstractVector, gradients::AbstractVector, values::AbstractVector, ip::Interpolation, ξ::Vec)
Evaluate all shape function hessians, gradients and values of ip
at once at the reference point ξ
and store them in hessians
, gradients
, and values
.
Ferrite.shape_value_type
— Methodshape_value_type(ip::Interpolation, ::Type{T}) where T<:Number
Return the type of shape_value(ip::Interpolation, ξ::Vec, ib::Int)
.
Required methods to implement for all subtypes of Interpolation
to define a new finite element
Depending on the dimension of the reference element the following functions have to be implemented
Ferrite.reference_shape_value
— Methodreference_shape_value(ip::Interpolation, ξ::Vec, i::Int)
Evaluate the value of the i
th shape function of the interpolation ip
at a point ξ
on the reference element. The index i
must match the index in vertices(::Interpolation)
, faces(::Interpolation)
and edges(::Interpolation)
.
For nodal interpolations the indices also must match the indices of reference_coordinates(::Interpolation)
.
Ferrite.vertexdof_indices
— Methodvertexdof_indices(ip::Interpolation)
A tuple containing tuples of local dof indices for the respective vertex in local enumeration on a cell defined by vertices(::Cell)
. The vertex enumeration must match the vertex enumeration of the corresponding geometrical cell.
The dofs appearing in the tuple must be continuous and increasing! The first dof must be the 1, as vertex dofs are enumerated first.
Ferrite.dirichlet_vertexdof_indices
— Methoddirichlet_vertexdof_indices(ip::Interpolation)
A tuple containing tuples of local dof indices for the respective vertex in local enumeration on a cell defined by vertices(::Cell)
. The vertex enumeration must match the vertex enumeration of the corresponding geometrical cell. Used internally in ConstraintHandler
and defaults to vertexdof_indices(ip::Interpolation)
for continuous interpolation.
The dofs appearing in the tuple must be continuous and increasing! The first dof must be the 1, as vertex dofs are enumerated first.
Ferrite.facedof_indices
— Methodfacedof_indices(ip::Interpolation)
A tuple containing tuples of all local dof indices for the respective face in local enumeration on a cell defined by faces(::Cell)
. The face enumeration must match the face enumeration of the corresponding geometrical cell.
Ferrite.dirichlet_facedof_indices
— Methoddirichlet_facedof_indices(ip::Interpolation)
A tuple containing tuples of all local dof indices for the respective face in local enumeration on a cell defined by faces(::Cell)
. The face enumeration must match the face enumeration of the corresponding geometrical cell. Used internally in ConstraintHandler
and defaults to facedof_indices(ip::Interpolation)
for continuous interpolation.
Ferrite.facedof_interior_indices
— Methodfacedof_interior_indices(ip::Interpolation)
A tuple containing tuples of the local dof indices on the interior of the respective face in local enumeration on a cell defined by faces(::Cell)
. The face enumeration must match the face enumeration of the corresponding geometrical cell. Note that the vertex and edge dofs are included here.
The dofs appearing in the tuple must be continuous and increasing! The first dof must be the computed via "last edge interior dof index + 1", if face dofs exist.
Ferrite.edgedof_indices
— Methodedgedof_indices(ip::Interpolation)
A tuple containing tuples of local dof indices for the respective edge in local enumeration on a cell defined by edges(::Cell)
. The edge enumeration must match the edge enumeration of the corresponding geometrical cell.
The dofs are guaranteed to be aligned with the local ordering of the entities on the oriented edge. Here the first entries are the vertex dofs, followed by the edge interior dofs.
Ferrite.dirichlet_edgedof_indices
— Methoddirichlet_edgedof_indices(ip::Interpolation)
A tuple containing tuples of local dof indices for the respective edge in local enumeration on a cell defined by edges(::Cell)
. The edge enumeration must match the edge enumeration of the corresponding geometrical cell. Used internally in ConstraintHandler
and defaults to edgedof_indices(ip::Interpolation)
for continuous interpolation.
The dofs are guaranteed to be aligned with the local ordering of the entities on the oriented edge. Here the first entries are the vertex dofs, followed by the edge interior dofs.
Ferrite.edgedof_interior_indices
— Methodedgedof_interior_indices(ip::Interpolation)
A tuple containing tuples of the local dof indices on the interior of the respective edge in local enumeration on a cell defined by edges(::Cell)
. The edge enumeration must match the edge enumeration of the corresponding geometrical cell. Note that the vertex dofs are included here.
The dofs appearing in the tuple must be continuous and increasing! The first dof must be computed via "last vertex dof index + 1", if edge dofs exist.
Ferrite.volumedof_interior_indices
— Methodvolumedof_interior_indices(ip::Interpolation)
Tuple containing the dof indices associated with the interior of a volume.
The dofs appearing in the tuple must be continuous and increasing, volumedofs are enumerated last.
Ferrite.getnbasefunctions
— MethodFerrite.getnbasefunctions(ip::Interpolation)
Return the number of base functions for the interpolation ip
.
Ferrite.reference_coordinates
— Methodreference_coordinates(ip::Interpolation)
Returns a vector of coordinates with length getnbasefunctions(::Interpolation)
and indices corresponding to the indices of a dof in vertices
, faces
and edges
.
Only required for nodal interpolations.
TODO: Separate nodal and non-nodal interpolations.
Ferrite.is_discontinuous
— Methodis_discontinuous(::Interpolation)
is_discontinuous(::Type{<:Interpolation})
Checks whether the interpolation is discontinuous (i.e. DiscontinuousLagrange
)
Ferrite.adjust_dofs_during_distribution
— Methodadjust_dofs_during_distribution(::Interpolation)
This function must return true
if the dofs should be adjusted (i.e. permuted) during dof distribution. This is in contrast to i) adjusting the dofs during reinit!
in the assembly loop, or ii) not adjusting at all (which is not needed for low order interpolations, generally).
Ferrite.mapping_type
— Functionmapping_type(ip::Interpolation)
Get the type of mapping from the reference cell to the real cell for an interpolation ip
. Subtypes of ScalarInterpolation
and VectorizedInterpolation
return IdentityMapping()
, but other non-scalar interpolations may request different mapping types.
for all entities which exist on that reference element. The dof functions default to having no dofs defined on a specific entity. Hence, not overloading of the dof functions will result in an element with zero dofs. Also, it should always be double checked that everything is consistent as specified in the docstring of the corresponding function, as inconsistent implementations can lead to bugs which are really difficult to track down.