![]() |
LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Local computations are essential for efficient finite element methods (FEM). LehrFEM++ uses a local indexing scheme to map local shape functions to global degrees of freedom (DOFs). In LehrFEM++, this is done through objects of the type lf::assemble::DofHandler
. This quick reference provides an overview of DOF handlers and indexing conventions in LehrFEM++. The assembly quick reference page provides more information on (local) assembly using DOF handlers.
The local shape functions of every cell (co-dimension-0 entity) are arranged according to the increasing dimension of the geometric entities they are associated with:
DOFs associated with lower-dimensional entities (e.g., points and edges) are numbered first, followed by higher-dimensional ones (cells). Within each category, entities are numbered according to their intrinsic indexing as returned by the Index()
function. This is also illustrated in Lecture Document Figure 140 and Lecture Document Figure 141.
LehrFEM++ provides two implementations of DOF handlers:
lf::assemble::DynamicFEDofHandler
: Allows for a variable number of local DOFs for each entity (e.g. for hp-FEM, see Lecture Document Paragraph 2.7.4.16)lf::assemble::UniformFEDofHandler
: Assigns the same number of DOFs to each entity of a given type (uniform FE space).A DynamicFEDofHandler
can be initialized with a function that returns the number of DOFs associated with a given entity.
For example, in a second-order Lagrange FE space (as shown in the code above):
LehrFEM++ follows the convention of numbering global DOFs according to the following rule:
\[ \text{POINT} \rightarrow \text{SEGMENT} \rightarrow \text{TRIA/QUAD} \]
Index()
function.The key methods provided by the DofHandler
interface are:
NumDofs()
: Returns the total number of global DOFs. See also Lecture Document Paragraph 2.7.4.13.NumLocalDofs(const lf::mesh::Entity &)
: Returns the number of DOFs associated with a particular geometric entity. See also Lecture Document Paragraph 2.7.4.13.GlobalDofIndices(const lf::mesh::Entity &)
: Returns the global indices of DOFs associated with a given entity. See also Lecture Document Paragraph 2.7.4.13.NumInteriorDofs(const lf::mesh::Entity &)
: Specifies how many DOFs are associated with an entity’s interior. See also Lecture Document Paragraph 2.7.4.13.An example of using a DofHandler to print information about local-to-global mappings in LehrFEM++: