Elements and cells

Type definitions

Elements or cells are subtypes of AbstractCell{dim,N,M}. They are parametrized by the dimension of their nodes via dim, the number of nodes N and the number of faces M.

Required methods to implement for all subtypes of AbstractCell to define a new element

Ferrite.verticesMethod
Ferrite.vertices(::AbstractCell)

Returns a tuple with the node indices (of the nodes in a grid) for each vertex in a given cell. This function induces the VertexIndex, where the second index corresponds to the local index into this tuple.

source
Ferrite.edgesMethod
Ferrite.edges(::AbstractCell)

Returns a tuple of 2-tuples containing the ordered node indices (of the nodes in a grid) corresponding to the vertices that define an oriented edge. This function induces the EdgeIndex, where the second index corresponds to the local index into this tuple.

Note that the vertices are sufficient to define an edge uniquely.

source
Ferrite.facesMethod
Ferrite.faces(::AbstractCell)

Returns a tuple of n-tuples containing the ordered node indices (of the nodes in a grid) corresponding to the vertices that define an oriented face. This function induces the FaceIndex, where the second index corresponds to the local index into this tuple.

Note that the vertices are sufficient to define a face uniquely.

source
Ferrite.default_interpolationMethod
Ferrite.default_interpolation(::AbstractCell)::Interpolation

Returns the interpolation which defines the geometry of a given cell.

source

Common utilities and definitions when working with grids internally.

Ferrite.boundaryfunctionMethod
boundaryfunction(::Type{<:BoundaryIndex})

Helper function to dispatch on the correct entity from a given boundary index.

source
Ferrite.toglobalFunction
toglobal(grid::AbstractGrid, vertexidx::VertexIndex) -> Int
toglobal(grid::AbstractGrid, vertexidx::Vector{VertexIndex}) -> Vector{Int}

This function takes the local vertex representation (a VertexIndex) and looks up the unique global id (an Int).

source
Ferrite.sortfaceFunction
sortface(face::Tuple{Int,Int}) 
sortface(face::Tuple{Int,Int,Int})
sortface(face::Tuple{Int,Int,Int,Int})

Returns the unique representation of a face. Here the unique representation is the sorted node index tuple. Note that in 3D we only need indices to uniquely identify a face, so the unique representation is always a tuple length 3.

source
Ferrite.sortedgeFunction
sortedge(edge::Tuple{Int,Int})

Returns the unique representation of an edge and its orientation. Here the unique representation is the sorted node index tuple. The orientation is true if the edge is not flipped, where it is false if the edge is flipped.

source