LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Public Member Functions | List of all members
projects::dpg::FeDiscontinuousO0Tria< SCALAR > Class Template Referencefinal

Discontinuous constant finite element on a triangular reference element. More...

Inheritance diagram for projects::dpg::FeDiscontinuousO0Tria< SCALAR >:
lf::fe::ScalarReferenceFiniteElement< SCALAR >

Public Member Functions

 FeDiscontinuousO0Tria (const FeDiscontinuousO0Tria &)=default
 
 FeDiscontinuousO0Tria (FeDiscontinuousO0Tria &&) noexcept=default
 
FeDiscontinuousO0Triaoperator= (const FeDiscontinuousO0Tria &)=default
 
FeDiscontinuousO0Triaoperator= (FeDiscontinuousO0Tria &&) noexcept=default
 
 FeDiscontinuousO0Tria ()=default
 
 ~FeDiscontinuousO0Tria () override=default
 
lf::base::RefEl RefEl () const override
 Tells the type of reference cell underlying the parametric finite element. More...
 
unsigned Degree () const override
 Request the maximal polynomial degree of the basis functions in this finite element. More...
 
size_type NumRefShapeFunctions () const override
 Total number of reference shape functions associated with the reference cell. More...
 
size_type NumRefShapeFunctions (dim_t codim) const override
 
size_type NumRefShapeFunctions (dim_t codim, sub_idx_t) const override
 
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > EvalReferenceShapeFunctions (const Eigen::MatrixXd &refcoords) const override
 Evaluation of all reference shape functions in a number of points. More...
 
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > GradientsReferenceShapeFunctions (const Eigen::MatrixXd &refcoords) const override
 Computation of the gradients of all reference shape functions in a number of points. More...
 
Eigen::MatrixXd EvaluationNodes () const override
 Only evaluation node is the barycenter of the reference triangle. More...
 
size_type NumEvaluationNodes () const override
 One evaluation node. More...
 
- Public Member Functions inherited from lf::fe::ScalarReferenceFiniteElement< SCALAR >
virtual ~ScalarReferenceFiniteElement ()=default
 
virtual base::RefEl RefEl () const =0
 Tells the type of reference cell underlying the parametric finite element. More...
 
virtual unsigned int Degree () const =0
 Request the maximal polynomial degree of the basis functions in this finite element. More...
 
dim_t Dimension () const
 Returns the spatial dimension of the reference cell. More...
 
virtual size_type NumRefShapeFunctions () const
 Total number of reference shape functions associated with the reference cell. More...
 
virtual size_type NumRefShapeFunctions (dim_t codim) const
 The number of interior reference shape functions for sub-entities of a particular co-dimension. More...
 
virtual size_type NumRefShapeFunctions (dim_t codim, sub_idx_t subidx) const =0
 The number of interior reference shape functions for every sub-entity. More...
 
virtual Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > EvalReferenceShapeFunctions (const Eigen::MatrixXd &refcoords) const =0
 Evaluation of all reference shape functions in a number of points. More...
 
virtual Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > GradientsReferenceShapeFunctions (const Eigen::MatrixXd &refcoords) const =0
 Computation of the gradients of all reference shape functions in a number of points. More...
 
virtual Eigen::MatrixXd EvaluationNodes () const =0
 Returns reference coordinates of "evaluation nodes" for evaluation of parametric degrees of freedom, nodal interpolation in the simplest case. More...
 
virtual size_type NumEvaluationNodes () const =0
 Tell the number of evaluation (interpolation) nodes. More...
 
virtual Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > NodalValuesToDofs (const Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > &nodvals) const
 Computes the linear combination of reference shape functions matching function values at evaluation nodes. More...
 

Additional Inherited Members

- Public Types inherited from lf::fe::ScalarReferenceFiniteElement< SCALAR >
using Scalar = SCALAR
 The underlying scalar type. More...
 
- Protected Member Functions inherited from lf::fe::ScalarReferenceFiniteElement< SCALAR >
 ScalarReferenceFiniteElement ()=default
 
 ScalarReferenceFiniteElement (const ScalarReferenceFiniteElement &)=default
 
 ScalarReferenceFiniteElement (ScalarReferenceFiniteElement &&) noexcept=default
 
ScalarReferenceFiniteElementoperator= (const ScalarReferenceFiniteElement &)=default
 
ScalarReferenceFiniteElementoperator= (ScalarReferenceFiniteElement &&) noexcept=default
 

Detailed Description

template<typename SCALAR>
class projects::dpg::FeDiscontinuousO0Tria< SCALAR >

Discontinuous constant finite element on a triangular reference element.

This is a specialization of lf::fe::ScalarReferenceFiniteElement. Refer to its documentation.

The only reference shape function is constant and associated with the barycenter of the reference triangle, it is an interior shape function.

Definition at line 33 of file discontinuous_fe_constant.h.

Constructor & Destructor Documentation

◆ FeDiscontinuousO0Tria() [1/3]

template<typename SCALAR >
projects::dpg::FeDiscontinuousO0Tria< SCALAR >::FeDiscontinuousO0Tria ( const FeDiscontinuousO0Tria< SCALAR > &  )
default

◆ FeDiscontinuousO0Tria() [2/3]

template<typename SCALAR >
projects::dpg::FeDiscontinuousO0Tria< SCALAR >::FeDiscontinuousO0Tria ( FeDiscontinuousO0Tria< SCALAR > &&  )
defaultnoexcept

◆ FeDiscontinuousO0Tria() [3/3]

template<typename SCALAR >
projects::dpg::FeDiscontinuousO0Tria< SCALAR >::FeDiscontinuousO0Tria ( )
default

◆ ~FeDiscontinuousO0Tria()

template<typename SCALAR >
projects::dpg::FeDiscontinuousO0Tria< SCALAR >::~FeDiscontinuousO0Tria ( )
overridedefault

Member Function Documentation

◆ Degree()

template<typename SCALAR >
unsigned projects::dpg::FeDiscontinuousO0Tria< SCALAR >::Degree ( ) const
inlineoverridevirtual

Request the maximal polynomial degree of the basis functions in this finite element.

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 47 of file discontinuous_fe_constant.h.

◆ EvalReferenceShapeFunctions()

template<typename SCALAR >
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > projects::dpg::FeDiscontinuousO0Tria< SCALAR >::EvalReferenceShapeFunctions ( const Eigen::MatrixXd &  refcoords) const
inlineoverridevirtual

Evaluation of all reference shape functions in a number of points.

Parameters
refcoordscoordinates of N points in the reference cell passed as columns of a matrix of size dim x N, where dim is the dimension of the reference element, that is =0 for points, =1 for edges, =2 for triangles and quadrilaterals
Returns
An Eigen Matrix of size NumRefShapeFunctions() x refcoords.cols() which contains the shape functions evaluated at every quadrature point.

Concerning the numbering of local shape functions, please consult the documentation of lf::assemble::DofHandler or the documentation of the class.

Note
shape functions are assumed to be real-valued.

Example: Triangular Linear Lagrangian finite elements

There are three reference shape functions \(\hat{b}^1,\hat{b}^2,\hat{b}^3\) associated with the vertices of the reference triangle. Let us assume that the refcoords argument is a 2x2 matrix \([\mathbf{x}_1\;\mathbf{x}_2]\), which corresponds to passing the coordinates of two points in the reference triangle. Then this method will return a 3x2 matrix:

\[ \begin{pmatrix}\hat{b}^1(\mathbf{x}_1) & \hat{b}^1(\mathbf{x}_2) \\ \hat{b}^2(\mathbf{x}_1) & \hat{b}^2(\mathbf{x}_2) \\ \hat{b}^3(\mathbf{x}_1)\ & \hat{b}^3(\mathbf{x}_2) \end{pmatrix} \]

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 72 of file discontinuous_fe_constant.h.

◆ EvaluationNodes()

template<typename SCALAR >
Eigen::MatrixXd projects::dpg::FeDiscontinuousO0Tria< SCALAR >::EvaluationNodes ( ) const
inlineoverridevirtual

Only evaluation node is the barycenter of the reference triangle.

Returns reference coordinates of "evaluation nodes" for evaluation of parametric degrees of freedom, nodal interpolation in the simplest case.

Returns
A d x N matrix, where d is the dimension of the reference cell, and N the number of interpolation nodes. The columns of this matrix contain their reference coordinates.

Every parametric scalar finite element implicitly defines a local interpolation operator by duality with the reference shape functions. This interpolation operator can be realized through evaluations at certain evaluation nodes, which are provided by this method.

Unisolvence

The evaluation points must satisfy the following requirement: If the values of a function belonging to the span of the reference shape functions are known in the evaluation nodes, then this function is uniquely determined. This entails that the number of evaluation nodes must be at least as big as the number of reference shape functions.

Note
It is not required that any vector a values at evaluation nodes can be produced by a suitable linear combination of reference shape functions. For instance, this will not be possible, if there are more evaluation points than reference shape functions. If both sets have the same size, however, the interpolation problem has a solution for any vector of values at the evluation points.

Example: Principal lattice

For triangular Lagrangian finite elements of degree p the evaluation nodes, usually called "interpolation nodes" in this context, can be chosen as \(\left(\frac{j}{p},\frac{k}{p}\right),\; 0\leq j,k \leq p, j+k\leq p\).

Moment-based degrees of freedom

For some finite element spaces the interpolation functional may be defined based on integrals over edges. In this case the evaluation nodes will be quadrature nodes for the approximate evaluation of these integrals.

The quadrature rule must be exact for the polynomials contained in the local finite element spaces.

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 99 of file discontinuous_fe_constant.h.

◆ GradientsReferenceShapeFunctions()

template<typename SCALAR >
Eigen::Matrix< SCALAR, Eigen::Dynamic, Eigen::Dynamic > projects::dpg::FeDiscontinuousO0Tria< SCALAR >::GradientsReferenceShapeFunctions ( const Eigen::MatrixXd &  refcoords) const
inlineoverridevirtual

Computation of the gradients of all reference shape functions in a number of points.

Parameters
refcoordscoordinates of N points in the reference cell passed as columns of a matrix of size dim x N.
Returns
An Eigen Matrix of size NumRefShapeFunctions() x (dim * refcoords.cols()) where dim is the dimension of the reference finite element. The gradients are returned in chunks of rows of this matrix.

Concerning the numbering of local shape functions, please consult the documentation of lf::assemble::DofHandler.

Example: Triangular Linear Lagrangian finite elements

There are three reference shape functions \(\hat{b}^1,\hat{b}^2,\hat{b}^3\) associated with the vertices of the reference triangle. Let us assume that the refcoords argument is a 2x2 matrix \([\mathbf{x}_1\;\mathbf{x}_2]\), which corresponds to passing the coordinates of two points in the reference triangle. Then this method will return a 3x4 matrix:

\[ \begin{pmatrix} \grad^T\hat{b}^1(\mathbf{x}_1) & \grad^T\hat{b}^1(\mathbf{x}_2) \\ \grad^T\hat{b}^2(\mathbf{x}_1) & \grad^T\hat{b}^2(\mathbf{x}_2) \\ \grad^T\hat{b}^3(\mathbf{x}_1) & \grad^T\hat{b}^3(\mathbf{x}_2) \end{pmatrix} \]

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 85 of file discontinuous_fe_constant.h.

◆ NumEvaluationNodes()

template<typename SCALAR >
size_type projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumEvaluationNodes ( ) const
inlineoverridevirtual

One evaluation node.

Tell the number of evaluation (interpolation) nodes.

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 108 of file discontinuous_fe_constant.h.

References projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumRefShapeFunctions().

◆ NumRefShapeFunctions() [1/3]

template<typename SCALAR >
size_type projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumRefShapeFunctions ( ) const
inlineoverridevirtual

Total number of reference shape functions associated with the reference cell.

Note
the total number of shape functions is the sum of the number of interior shape functions for all sub-entities and the entity itself.

Reimplemented from lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 52 of file discontinuous_fe_constant.h.

Referenced by projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumEvaluationNodes().

◆ NumRefShapeFunctions() [2/3]

template<typename SCALAR >
size_type projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumRefShapeFunctions ( dim_t  codim) const
inlineoverridevirtual

Only one interior shape function

Reimplemented from lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 56 of file discontinuous_fe_constant.h.

◆ NumRefShapeFunctions() [3/3]

template<typename SCALAR >
size_type projects::dpg::FeDiscontinuousO0Tria< SCALAR >::NumRefShapeFunctions ( dim_t  codim,
sub_idx_t   
) const
inlineoverridevirtual

Only one interior shape function

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 62 of file discontinuous_fe_constant.h.

◆ operator=() [1/2]

template<typename SCALAR >
FeDiscontinuousO0Tria & projects::dpg::FeDiscontinuousO0Tria< SCALAR >::operator= ( const FeDiscontinuousO0Tria< SCALAR > &  )
default

◆ operator=() [2/2]

template<typename SCALAR >
FeDiscontinuousO0Tria & projects::dpg::FeDiscontinuousO0Tria< SCALAR >::operator= ( FeDiscontinuousO0Tria< SCALAR > &&  )
defaultnoexcept

◆ RefEl()

template<typename SCALAR >
lf::base::RefEl projects::dpg::FeDiscontinuousO0Tria< SCALAR >::RefEl ( ) const
inlineoverridevirtual

Tells the type of reference cell underlying the parametric finite element.

Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.

Definition at line 43 of file discontinuous_fe_constant.h.

References lf::base::RefEl::kTria().


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