LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF > Class Template Referencefinal

Class for local quadrature based computation of element matrix for Lagrangian finite elements and a weighted \(L^2\) inner product. More...

#include <lf/fe/fe.h>

Public Types

using Scalar
 type of returned element matrix
 
using ElemMat = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>
 

Public Member Functions

 MassElementMatrixProvider (std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space, REACTION_COEFF gamma)
 Constructor: cell-independent precomputations.
 
bool isActive (const lf::mesh::Entity &) const
 All cells are considered active.
 
ElemMat Eval (const lf::mesh::Entity &cell) const
 main routine for the computation of element matrices
 
 ~MassElementMatrixProvider ()=default
 
 MassElementMatrixProvider (const MassElementMatrixProvider &)=delete
 standard constructors
 
 MassElementMatrixProvider (MassElementMatrixProvider &&) noexcept=default
 
MassElementMatrixProvideroperator= (const MassElementMatrixProvider &)=delete
 
MassElementMatrixProvideroperator= (MassElementMatrixProvider &&)=delete
 

Private Attributes

std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space_
 
quad::QuadRuleCache qr_cache_
 
functors providing coefficient functions
REACTION_COEFF gamma_
 

Detailed Description

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
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.

Template Parameters
SCALARscalar type of the FiniteElementSpace. Must be a field type such as double or std::complex<double>
REACTION_COEFFa MeshFunction that defines the reaction coefficient \( \mathbf{\gamma} \). It should be either scalar- or matrix-valued.
Note
This class complies with the type requirements for the template argument ENTITY_MATRIX_PROVIDER of the function lf::assemble::AssembleMatrixLocally().

The element matrix corresponds to the (local) bilinear form

\[ (u,v) \mapsto\int\limits_{K}\gamma(\mathbf{x})u\,\overline{v}\,\mathrm{d}\mathbf{x} \;, \]

with reaction coefficient \(\gamma\), see also Example 2.8.3.29

Template parameter requirement

Note
If you intend to use this matrix provider with FE Spaces from lf::uscalfe please consider switching to lf::uscalfe::MassEdgeMatrixProvider provided there, as it is specifically optimized for uniform FE Spaces.

Definition at line 256 of file loc_comp_ellbvp.h.

Member Typedef Documentation

◆ ElemMat

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
using lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::ElemMat = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>

Definition at line 264 of file loc_comp_ellbvp.h.

◆ Scalar

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
using lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::Scalar
Initial value:
typename decltype(mesh::utils::MeshFunctionReturnType<REACTION_COEFF>() *
Eigen::Matrix<SCALAR, Eigen::Dynamic, 1>())::Scalar
typename decltype(mesh::utils::MeshFunctionReturnType< REACTION_COEFF >() * Eigen::Matrix< SCALAR, Eigen::Dynamic, 1 >())::Scalar Scalar
type of returned element matrix

type of returned element matrix

Definition at line 261 of file loc_comp_ellbvp.h.

Constructor & Destructor Documentation

◆ MassElementMatrixProvider() [1/3]

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::MassElementMatrixProvider ( const MassElementMatrixProvider< SCALAR, REACTION_COEFF > & )
delete

standard constructors

◆ MassElementMatrixProvider() [2/3]

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::MassElementMatrixProvider ( MassElementMatrixProvider< SCALAR, REACTION_COEFF > && )
defaultnoexcept

◆ MassElementMatrixProvider() [3/3]

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::MassElementMatrixProvider ( std::shared_ptr< const ScalarFESpace< SCALAR > > fe_space,
REACTION_COEFF gamma )

Constructor: cell-independent precomputations.

Parameters
fe_spacecollection of specifications for scalar-valued parametric reference elements
gammamesh function providing scalar-valued diffusion coefficient
See also
LocCompLagrFEPreprocessor::LocCompLagrFEPreprocessor()

This constructor uses local quadature rules with double the degree of exactness as the polynomial degree of the finite element space.

Definition at line 342 of file loc_comp_ellbvp.h.

◆ ~MassElementMatrixProvider()

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::~MassElementMatrixProvider ( )
default

destructor

Member Function Documentation

◆ Eval()

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::ElemMat lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::Eval ( const lf::mesh::Entity & cell) const

main routine for the computation of element matrices

Parameters
cellreference to the (triangular or quadrilateral) cell for which the element matrix should be computed.
Returns
a small dense, containing the element matrix.

Actual computation of the element matrix based on numerical quadrature and mapping techniques. The order of the quadrature rule is tied to the polynomial degree of the underlying finite element spaces: for polynomial degree p a quadrature rule is chosen that is exact for polynomials o degree 2p.

Throws an assertion in case the finite element specification is missing for the type of the cell.

Definition at line 351 of file loc_comp_ellbvp.h.

References lf::geometry::Geometry::DimGlobal(), lf::geometry::Geometry::DimLocal(), lf::mesh::Entity::Geometry(), lf::geometry::Geometry::Global(), lf::geometry::Geometry::IntegrationElement(), lf::fe::MassElementMatrixProviderLogger(), lf::base::RefEl::NodeCoords(), lf::quad::QuadRule::NumPoints(), lf::quad::QuadRule::Points(), lf::mesh::Entity::RefEl(), and lf::quad::QuadRule::Weights().

◆ isActive()

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
bool lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::isActive ( const lf::mesh::Entity & ) const
inline

All cells are considered active.

Definition at line 295 of file loc_comp_ellbvp.h.

◆ operator=() [1/2]

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
MassElementMatrixProvider & lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::operator= ( const MassElementMatrixProvider< SCALAR, REACTION_COEFF > & )
delete

◆ operator=() [2/2]

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
MassElementMatrixProvider & lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::operator= ( MassElementMatrixProvider< SCALAR, REACTION_COEFF > && )
delete

Member Data Documentation

◆ fe_space_

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
std::shared_ptr<const ScalarFESpace<SCALAR> > lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::fe_space_
private

FE Space

Definition at line 325 of file loc_comp_ellbvp.h.

◆ gamma_

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
REACTION_COEFF lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::gamma_
private

Reaction coefficient

Definition at line 321 of file loc_comp_ellbvp.h.

◆ qr_cache_

template<base::Scalar SCALAR, mesh::utils::MeshFunction REACTION_COEFF>
quad::QuadRuleCache lf::fe::MassElementMatrixProvider< SCALAR, REACTION_COEFF >::qr_cache_
private

Definition at line 327 of file loc_comp_ellbvp.h.


The documentation for this class was generated from the following file: