LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Hierarchic Finite Elements of arbitrary degree on quadrilaterals. More...
#include <lf/fe/fe.h>
Public Member Functions | |
FeHierarchicQuad (const FeHierarchicQuad &)=default | |
FeHierarchicQuad (FeHierarchicQuad &&) noexcept=default | |
FeHierarchicQuad & | operator= (const FeHierarchicQuad &)=default |
FeHierarchicQuad & | operator= (FeHierarchicQuad &&) noexcept=default |
~FeHierarchicQuad () override=default | |
FeHierarchicQuad (unsigned interior_degree, std::array< unsigned, 4 > edge_degrees, const quad::QuadRuleCache &qr_cache, nonstd::span< const lf::mesh::Orientation > rel_orient) | |
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... | |
lf::base::size_type | NumRefShapeFunctions () const override |
The local shape functions. More... | |
lf::base::size_type | NumRefShapeFunctions (dim_t codim) const override |
One shape function for each vertex, p-1 shape functions on the edges and (p-1)^2 shape functions on the quadrilateral. More... | |
lf::base::size_type | NumRefShapeFunctions (dim_t codim, sub_idx_t subidx) const override |
One shape function for each vertex, p-1 shape functions on the edges and (p-1)^2 shape functions on the quadrilateral. More... | |
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 |
Evaluation nodes are the vertices, the points of a quadrature rule on each edge and the points of a quadrature rule on the interior of the quadrilateral. More... | |
lf::base::size_type | NumEvaluationNodes () const override |
Tell the number of evaluation (interpolation) nodes. More... | |
Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > | NodalValuesToDofs (const Eigen::Matrix< SCALAR, 1, Eigen::Dynamic > &nodevals) const override |
Computes the linear combination of reference shape functions matching function values at evaluation nodes. More... | |
![]() | |
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... | |
Private Attributes | |
unsigned | interior_degree_ |
std::array< unsigned, 4 > | edge_degrees_ |
std::array< const quad::QuadRule *, 4 > | qr_dual_edge_ |
FeHierarchicSegment< SCALAR > | fe1d_ |
nonstd::span< const lf::mesh::Orientation > | rel_orient_ |
Additional Inherited Members | |
![]() | |
using | Scalar = SCALAR |
The underlying scalar type. More... | |
![]() | |
ScalarReferenceFiniteElement ()=default | |
ScalarReferenceFiniteElement (const ScalarReferenceFiniteElement &)=default | |
ScalarReferenceFiniteElement (ScalarReferenceFiniteElement &&) noexcept=default | |
ScalarReferenceFiniteElement & | operator= (const ScalarReferenceFiniteElement &)=default |
ScalarReferenceFiniteElement & | operator= (ScalarReferenceFiniteElement &&) noexcept=default |
![]() | |
template<class SCALAR > | |
void | PrintInfo (std::ostream &o, const ScalarReferenceFiniteElement< SCALAR > &srfe, unsigned int ctrl=0) |
Print information about a ScalarReferenceFiniteElement to the given stream. More... | |
template<typename SCALAR > | |
std::ostream & | operator<< (std::ostream &o, const ScalarReferenceFiniteElement< SCALAR > &fe_desc) |
Stream output operator: just calls the ScalarReferenceFiniteElement::print() method. More... | |
Hierarchic Finite Elements of arbitrary degree on quadrilaterals.
The basis functions on the quadrilateral has a tensor product structure and can thus be represented by products of basis functions on segments. The basis functions are therefore given by
\[ \widehat{b^{\square}}^{ij}(\widehat{x}, \widehat{y}) = \widehat{b}^i(\widehat{x})\widehat{b}^j(\widehat{y}) \]
where \(\widehat{b}^i(\widehat{x})\) and \(\widehat{b}^j(\widehat{y})\) are the basis functions on a segment.
The dual basis is therefore also quite simple, as we can recycle the one from the segments by first applying the dual basis along the \(x\)-axis and then apply the dual basis to the resulting 1d function.
Definition at line 1089 of file hierarchic_fe.h.
|
default |
|
defaultnoexcept |
|
overridedefault |
|
inline |
Definition at line 1097 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, and lf::base::RefEl::kSegment().
|
inlineoverridevirtual |
Request the maximal polynomial degree of the basis functions in this finite element.
Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1127 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, and lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs().
|
inlineoverridevirtual |
Evaluation of all reference shape functions in a number of points.
refcoords | coordinates 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 |
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.
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 1196 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, lf::fe::FeHierarchicQuad< SCALAR >::fe1d_, lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_, lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions(), lf::mesh::positive, and lf::fe::FeHierarchicQuad< SCALAR >::rel_orient_.
|
inlineoverridevirtual |
Evaluation nodes are the vertices, the points of a quadrature rule on each edge and the points of a quadrature rule on the interior of the quadrilateral.
Returns reference coordinates of "evaluation nodes" for evaluation of parametric degrees of freedom, nodal interpolation in the simplest case.
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.
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.
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\).
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 1399 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, lf::fe::FeHierarchicQuad< SCALAR >::fe1d_, lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_, lf::mesh::positive, lf::fe::FeHierarchicQuad< SCALAR >::qr_dual_edge_, and lf::fe::FeHierarchicQuad< SCALAR >::rel_orient_.
|
inlineoverridevirtual |
Computation of the gradients of all reference shape functions in a number of points.
refcoords | coordinates of N points in the reference cell passed as columns of a matrix of size dim x N. |
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.
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 1282 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, lf::fe::FeHierarchicQuad< SCALAR >::fe1d_, lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_, lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions(), lf::mesh::positive, and lf::fe::FeHierarchicQuad< SCALAR >::rel_orient_.
|
inlineoverridevirtual |
Computes the linear combination of reference shape functions matching function values at evaluation nodes.
nodvals | row vector of function values at evaluation nodes The length of this vector must agree with NumEvaluationNodes(). |
If the evaluation nodes are interpolation nodes, that is, if the set of reference shape functions forms a cardinal basis with respect to these nodes, then we have NumEvaluationNodes() == NumRefShapeFunctions() and the linear mapping realized by NodalValuesToDofs() is the identity mapping.
If the vector of values at the evaluation nodes agrees with a vector of function values of a linear combination of reference shape functions at the evaluation nodes, then this method must return the very coefficients of the linear combination.
Reimplemented from lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1491 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::Degree(), lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, lf::fe::FeHierarchicQuad< SCALAR >::fe1d_, lf::fe::ilegendre_dx(), lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_, lf::fe::legendre_dx(), lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions(), lf::mesh::positive, lf::fe::FeHierarchicQuad< SCALAR >::qr_dual_edge_, and lf::fe::FeHierarchicQuad< SCALAR >::rel_orient_.
|
inlineoverridevirtual |
Tell the number of evaluation (interpolation) nodes.
Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1477 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, lf::fe::FeHierarchicQuad< SCALAR >::fe1d_, lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_, and lf::fe::FeHierarchicQuad< SCALAR >::qr_dual_edge_.
|
inlineoverridevirtual |
The local shape functions.
Total number of reference shape functions associated with the reference cell.
Reimplemented from lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1136 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions().
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::EvalReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::GradientsReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs(), and lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions().
|
inlineoverridevirtual |
One shape function for each vertex, p-1 shape functions on the edges and (p-1)^2 shape functions on the quadrilateral.
The number of interior reference shape functions for sub-entities of a particular co-dimension.
codim | co-dimension of the subentity |
Reimplemented from lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1147 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, and lf::fe::FeHierarchicQuad< SCALAR >::interior_degree_.
|
inlineoverridevirtual |
One shape function for each vertex, p-1 shape functions on the edges and (p-1)^2 shape functions on the quadrilateral.
The number of interior reference shape functions for every sub-entity.
codim | do-dimension of the subentity |
subidx | local index of the sub-entity |
Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1176 of file hierarchic_fe.h.
References lf::fe::FeHierarchicQuad< SCALAR >::edge_degrees_, and lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions().
|
default |
|
defaultnoexcept |
|
inlineoverridevirtual |
Tells the type of reference cell underlying the parametric finite element.
Implements lf::fe::ScalarReferenceFiniteElement< SCALAR >.
Definition at line 1123 of file hierarchic_fe.h.
References lf::base::RefEl::kQuad().
|
private |
Definition at line 1618 of file hierarchic_fe.h.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::Degree(), lf::fe::FeHierarchicQuad< SCALAR >::EvalReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::EvaluationNodes(), lf::fe::FeHierarchicQuad< SCALAR >::FeHierarchicQuad(), lf::fe::FeHierarchicQuad< SCALAR >::GradientsReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs(), lf::fe::FeHierarchicQuad< SCALAR >::NumEvaluationNodes(), and lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions().
|
private |
Definition at line 1621 of file hierarchic_fe.h.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::EvalReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::EvaluationNodes(), lf::fe::FeHierarchicQuad< SCALAR >::GradientsReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs(), and lf::fe::FeHierarchicQuad< SCALAR >::NumEvaluationNodes().
|
private |
Definition at line 1617 of file hierarchic_fe.h.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::Degree(), lf::fe::FeHierarchicQuad< SCALAR >::EvalReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::EvaluationNodes(), lf::fe::FeHierarchicQuad< SCALAR >::GradientsReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs(), lf::fe::FeHierarchicQuad< SCALAR >::NumEvaluationNodes(), and lf::fe::FeHierarchicQuad< SCALAR >::NumRefShapeFunctions().
|
private |
Definition at line 1619 of file hierarchic_fe.h.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::EvaluationNodes(), lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs(), and lf::fe::FeHierarchicQuad< SCALAR >::NumEvaluationNodes().
|
private |
Definition at line 1622 of file hierarchic_fe.h.
Referenced by lf::fe::FeHierarchicQuad< SCALAR >::EvalReferenceShapeFunctions(), lf::fe::FeHierarchicQuad< SCALAR >::EvaluationNodes(), lf::fe::FeHierarchicQuad< SCALAR >::GradientsReferenceShapeFunctions(), and lf::fe::FeHierarchicQuad< SCALAR >::NodalValuesToDofs().