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.vertices
— MethodFerrite.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.
Ferrite.edges
— MethodFerrite.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.
Ferrite.faces
— MethodFerrite.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.
Ferrite.default_interpolation
— MethodFerrite.default_interpolation(::AbstractCell)::Interpolation
Returns the interpolation which defines the geometry of a given cell.
Common utilities and definitions when working with grids internally.
Ferrite.BoundaryIndex
— TypeAbstract type which is used as identifier for faces, edges and verices
Ferrite.boundaryfunction
— Methodboundaryfunction(::Type{<:BoundaryIndex})
Helper function to dispatch on the correct entity from a given boundary index.
Ferrite.get_coordinate_eltype
— MethodReturn the number type of the nodal coordinates.
Ferrite.get_coordinate_eltype
— MethodFerrite.get_coordinate_eltype(::Node)
Get the data type of the components of the nodes coordinate.
Ferrite.toglobal
— Functiontoglobal(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
).
Ferrite.sortface
— Functionsortface(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.
Ferrite.sortedge
— Functionsortedge(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.