Interpolations
Type definitions
Interpolations are subtypes of Interpolation{dim, shape, order}
, i.e. they are parametrized by the (reference element) dimension, reference shape and order.
Fallback methods applicable for all subtypes of Interpolation
Ferrite.getdim
— MethodFerrite.getdim(::Interpolation)
Return the dimension of the reference element for a given 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.value
— MethodFerrite.value(ip::Interpolation, ξ::Vec)
Return a vector, of length getnbasefunctions(ip::Interpolation)
, with the value of each shape functions of ip
, evaluated in the reference coordinate ξ
. This calls Ferrite.value(ip::Interpolation, i::Int, ξ::Vec)
, where i
is the shape function number, which each concrete interpolation should implement.
Ferrite.derivative
— MethodFerrite.derivative(ip::Interpolation, ξ::Vec)
Return a vector, of length getnbasefunctions(ip::Interpolation)
, with the derivative (w.r.t. the reference coordinate) of each shape functions of ip
, evaluated in the reference coordinate ξ
. This uses automatic differentiation and uses ip
s implementation of Ferrite.value(ip::Interpolation, i::Int, ξ::Vec)
.
Ferrite.boundarydof_indices
— Functionboundarydof_indices(::Type{<:BoundaryIndex})
Helper function to generically dispatch on the correct dof sets of a boundary entity.
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.value
— Methodvalue(ip::Interpolation, i::Int, ξ::Vec)
Evaluates the i
'th basis 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.
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.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.
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.
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.
Ferrite.celldof_interior_indices
— Methodcelldof_interior_indices(ip::Interpolation)
Tuple containing the dof indices associated with the interior of the cell.
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.
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.