LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Implementing Classes
EntityMatrixProvider

Detailed Description

Provides the local element matrix for a mesh entity.

Description

An EntityMatrixProvider is an object that provides a local element matrix for a given mesh entity. EntityMatrixProvider's are mostly used together with lf::assemble::AssembleMatrixLocally to assemble a sparse system matrix.

Requirements

The type EMP satisfies the Concept EntityMatrixProvider if given

the following expressions are valid:

expression return type semantics
emp.isActive(e) bool Defines whether the entity e is taken into account by the assembly routine.
emp.Eval(e) Eigen::Matrix<SCALAR, ROWS, COLS> Returns the local element matrix for mesh entity e. Is only called if emp.isActive(e)==true.

Typical class definition

class ElemMatProvider {
public:
// Constructor can be used to pass data required for local computations
ElemMatProvider() = default;
// Select cells taken into account during cell-oriented assembly
virtual bool isActive(const lf::mesh::Entity& cell);
// Compute element matrix for a cell, here a fixed-size matrix
Eigen::Matrix<double, 3, 3> Eval(const lf::mesh::Entity& cell);
};
Interface class representing a topological entity in a cellular complex
Definition: entity.h:39
Note
returning a matix object through Eval() may sacrifice efficiency because it may entail additional allocation of dynamic memory. However, this design was chosen for the sake of readability of the code and in order to avoid nasty memory access errors that often occur when passing a matrix by reference.

Usage scenarios

The concept of a EntityMatrixProvider is widely used in the lf::assemble and lf::uscalfe modules:

Implementations

Examples for classes implementing the concept EntityMatrixProvider are lf::uscalfe::LinearFELaplaceElementMatrix and lf::uscalfe::ReactionDiffusionElementMatrixProvider

See also

Implementing Classes

class  lf::fe::DiffusionElementMatrixProvider< SCALAR, DIFF_COEFF >
 Class for computing element matrices for general scalar-valued finite elements and homogeneous 2nd-order elliptic bilinear forms. More...
 
class  lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >
 Class for local quadrature based computation of element matrix for Lagrangian finite elements and a weighted \(L^2\) inner product. More...
 
class  lf::fe::MassEdgeMatrixProvider< SCALAR, COEFF, EDGESELECTOR >
 Quadrature-based computation of local mass matrix for an edge. More...
 
class  lf::uscalfe::LinearFELaplaceElementMatrix
 Computing the element matrix for the (negative) Laplacian and linear finite elements. More...
 
class  lf::uscalfe::ReactionDiffusionElementMatrixProvider< SCALAR, DIFF_COEFF, REACTION_COEFF >
 Class for local quadrature based computations for Lagrangian finite elements and second-order scalar elliptic BVPs. More...
 
class  lf::uscalfe::MassEdgeMatrixProvider< SCALAR, COEFF, EDGESELECTOR >
 Quadrature-based computation of local mass matrix for an edge. More...