MFEM v4.7.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::NodalFiniteElement Class Reference

Class for standard nodal finite elements. More...

#include <fe_base.hpp>

Inheritance diagram for mfem::NodalFiniteElement:
[legend]
Collaboration diagram for mfem::NodalFiniteElement:
[legend]

Public Member Functions

 NodalFiniteElement (int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
 Construct NodalFiniteElement with given.
 
const DofToQuadGetDofToQuad (const IntegrationRule &ir, DofToQuad::Mode mode) const override
 Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mode.
 
void GetLocalInterpolation (ElementTransformation &Trans, DenseMatrix &I) const override
 Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base geometry under the given transformation.
 
void GetLocalRestriction (ElementTransformation &Trans, DenseMatrix &R) const override
 Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.
 
void GetTransferMatrix (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const override
 Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this finite element.
 
void Project (Coefficient &coeff, ElementTransformation &Trans, Vector &dofs) const override
 Given a coefficient and a transformation, compute its projection (approximation) in the local finite dimensional space in terms of the degrees of freedom.
 
void Project (VectorCoefficient &vc, ElementTransformation &Trans, Vector &dofs) const override
 Given a vector coefficient and a transformation, compute its projection (approximation) in the local finite dimensional space in terms of the degrees of freedom. (VectorFiniteElements)
 
void ProjectMatrixCoefficient (MatrixCoefficient &mc, ElementTransformation &T, Vector &dofs) const override
 Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local finite dimensional space in terms of the degrees of freedom. For VectorFiniteElements, the rows of the coefficient are projected in the vector space.
 
void Project (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &I) const override
 Compute the embedding/projection matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.
 
void ProjectGrad (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &grad) const override
 Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
 
void ProjectDiv (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &div) const override
 Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
 
const Array< int > & GetLexicographicOrdering () const
 Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/dofs/basis functions.
 
- Public Member Functions inherited from mfem::ScalarFiniteElement
 ScalarFiniteElement (int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
 Construct ScalarFiniteElement with given.
 
virtual void SetMapType (int M)
 Set the FiniteElement::MapType of the element to either VALUE or INTEGRAL. Also sets the FiniteElement::DerivType to GRAD if the FiniteElement::MapType is VALUE.
 
void NodalLocalInterpolation (ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
 Get the matrix I that defines nodal interpolation between this element and the refined element fine_fe.
 
void ScalarLocalInterpolation (ElementTransformation &Trans, DenseMatrix &I, const ScalarFiniteElement &fine_fe) const
 Get matrix I "Interpolation" defined through local L2-projection in the space defined by the fine_fe.
 
void ScalarLocalL2Restriction (ElementTransformation &Trans, DenseMatrix &R, const ScalarFiniteElement &coarse_fe) const
 Get restriction matrix R defined through local L2-projection in the space defined by the coarse_fe.
 
- Public Member Functions inherited from mfem::FiniteElement
 FiniteElement (int D, Geometry::Type G, int Do, int O, int F=FunctionSpace::Pk)
 Construct FiniteElement with given.
 
int GetDim () const
 Returns the reference space dimension for the finite element.
 
int GetRangeDim () const
 Returns the vector dimension for vector-valued finite elements, which is also the dimension of the interpolation operation.
 
int GetCurlDim () const
 Returns the dimension of the curl for vector-valued finite elements.
 
Geometry::Type GetGeomType () const
 Returns the Geometry::Type of the reference element.
 
int GetDof () const
 Returns the number of degrees of freedom in the finite element.
 
int GetOrder () const
 Returns the order of the finite element. In the case of anisotropic orders, returns the maximum order.
 
bool HasAnisotropicOrders () const
 Returns true if the FiniteElement basis may be using different orders/degrees in different spatial directions.
 
const int * GetAnisotropicOrders () const
 Returns an array containing the anisotropic orders/degrees.
 
int Space () const
 Returns the type of FunctionSpace on the element.
 
int GetRangeType () const
 Returns the FiniteElement::RangeType of the element, one of {SCALAR, VECTOR}.
 
int GetDerivRangeType () const
 Returns the FiniteElement::RangeType of the element derivative, either SCALAR or VECTOR.
 
int GetMapType () const
 Returns the FiniteElement::MapType of the element describing how reference functions are mapped to physical space, one of {VALUE, INTEGRAL H_DIV, H_CURL}.
 
int GetDerivType () const
 Returns the FiniteElement::DerivType of the element describing the spatial derivative method implemented, one of {NONE, GRAD, DIV, CURL}.
 
int GetDerivMapType () const
 Returns the FiniteElement::DerivType of the element describing how reference function derivatives are mapped to physical space, one of {VALUE, INTEGRAL, H_DIV, H_CURL}.
 
virtual void CalcShape (const IntegrationPoint &ip, Vector &shape) const =0
 Evaluate the values of all shape functions of a scalar finite element in reference space at the given point ip.
 
void CalcPhysShape (ElementTransformation &Trans, Vector &shape) const
 Evaluate the values of all shape functions of a scalar finite element in physical space at the point described by Trans.
 
virtual void CalcDShape (const IntegrationPoint &ip, DenseMatrix &dshape) const =0
 Evaluate the gradients of all shape functions of a scalar finite element in reference space at the given point ip.
 
void CalcPhysDShape (ElementTransformation &Trans, DenseMatrix &dshape) const
 Evaluate the gradients of all shape functions of a scalar finite element in physical space at the point described by Trans.
 
const IntegrationRuleGetNodes () const
 Get a const reference to the nodes of the element.
 
virtual void CalcVShape (const IntegrationPoint &ip, DenseMatrix &shape) const
 Evaluate the values of all shape functions of a vector finite element in reference space at the given point ip.
 
virtual void CalcVShape (ElementTransformation &Trans, DenseMatrix &shape) const
 Evaluate the values of all shape functions of a vector finite element in physical space at the point described by Trans.
 
void CalcPhysVShape (ElementTransformation &Trans, DenseMatrix &shape) const
 Equivalent to the CalcVShape() method with the same arguments.
 
virtual void CalcDivShape (const IntegrationPoint &ip, Vector &divshape) const
 Evaluate the divergence of all shape functions of a vector finite element in reference space at the given point ip.
 
void CalcPhysDivShape (ElementTransformation &Trans, Vector &divshape) const
 Evaluate the divergence of all shape functions of a vector finite element in physical space at the point described by Trans.
 
virtual void CalcCurlShape (const IntegrationPoint &ip, DenseMatrix &curl_shape) const
 Evaluate the curl of all shape functions of a vector finite element in reference space at the given point ip.
 
virtual void CalcPhysCurlShape (ElementTransformation &Trans, DenseMatrix &curl_shape) const
 Evaluate the curl of all shape functions of a vector finite element in physical space at the point described by Trans.
 
virtual void GetFaceDofs (int face, int **dofs, int *ndofs) const
 Get the dofs associated with the given face. *dofs is set to an internal array of the local dofc on the face, while *ndofs is set to the number of dofs on that face.
 
virtual void CalcHessian (const IntegrationPoint &ip, DenseMatrix &Hessian) const
 Evaluate the Hessians of all shape functions of a scalar finite element in reference space at the given point ip.
 
virtual void CalcPhysHessian (ElementTransformation &Trans, DenseMatrix &Hessian) const
 Evaluate the Hessian of all shape functions of a scalar finite element in reference space at the given point ip.
 
virtual void CalcPhysLaplacian (ElementTransformation &Trans, Vector &Laplacian) const
 Evaluate the Laplacian of all shape functions of a scalar finite element in reference space at the given point ip.
 
virtual void CalcPhysLinLaplacian (ElementTransformation &Trans, Vector &Laplacian) const
 
virtual void ProjectFromNodes (Vector &vc, ElementTransformation &Trans, Vector &dofs) const
 Given a vector of values at the finite element nodes and a transformation, compute its projection (approximation) in the local finite dimensional space in terms of the degrees of freedom. Valid for VectorFiniteElements.
 
virtual void ProjectDelta (int vertex, Vector &dofs) const
 Project a delta function centered on the given vertex in the local finite dimensional space represented by the dofs.
 
virtual void ProjectCurl (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
 Compute the discrete curl matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.
 
virtual void GetFaceMap (const int face_id, Array< int > &face_map) const
 Return the mapping from lexicographic face DOFs to lexicographic element DOFs for the given local face face_id.
 
virtual const StatelessDofTransformationGetDofTransformation () const
 Return a DoF transformation object for this particular type of basis.
 
virtual ~FiniteElement ()
 Deconstruct the FiniteElement.
 

Protected Member Functions

void ProjectCurl_2D (const FiniteElement &fe, ElementTransformation &Trans, DenseMatrix &curl) const
 

Protected Attributes

Array< int > lex_ordering
 
- Protected Attributes inherited from mfem::FiniteElement
int dim
 Dimension of reference space.
 
int vdim
 Vector dimension of vector-valued basis functions.
 
int cdim
 Dimension of curl for vector-valued basis functions.
 
Geometry::Type geom_type
 Geometry::Type of the reference element.
 
int func_space
 
int range_type
 
int map_type
 
int deriv_type
 
int deriv_range_type
 
int deriv_map_type
 
int dof
 Number of degrees of freedom.
 
int order
 Order/degree of the shape functions.
 
int orders [Geometry::MaxDim]
 Anisotropic orders.
 
IntegrationRule Nodes
 
DenseMatrix vshape
 
Array< DofToQuad * > dof2quad_array
 Container for all DofToQuad objects created by the FiniteElement.
 

Additional Inherited Members

- Public Types inherited from mfem::FiniteElement
enum  RangeType { UNKNOWN_RANGE_TYPE = -1 , SCALAR , VECTOR }
 Enumeration for range_type and deriv_range_type. More...
 
enum  MapType {
  UNKNOWN_MAP_TYPE = -1 , VALUE , INTEGRAL , H_DIV ,
  H_CURL
}
 Enumeration for MapType: defines how reference functions are mapped to physical space. More...
 
enum  DerivType { NONE , GRAD , DIV , CURL }
 Enumeration for DerivType: defines which derivative method is implemented. More...
 
- Static Public Member Functions inherited from mfem::FiniteElement
static bool IsClosedType (int b_type)
 Return true if the BasisType of b_type is closed (has Quadrature1D points on the boundary).
 
static bool IsOpenType (int b_type)
 Return true if the BasisType of b_type is open (doesn't have Quadrature1D points on the boundary).
 
static int VerifyClosed (int b_type)
 Ensure that the BasisType of b_type is closed (has Quadrature1D points on the boundary).
 
static int VerifyOpen (int b_type)
 Ensure that the BasisType of b_type is open (doesn't have Quadrature1D points on the boundary).
 
static int VerifyNodal (int b_type)
 Ensure that the BasisType of b_type nodal (satisfies the interpolation property).
 
- Static Protected Member Functions inherited from mfem::ScalarFiniteElement
static const ScalarFiniteElementCheckScalarFE (const FiniteElement &fe)
 

Detailed Description

Class for standard nodal finite elements.

Definition at line 714 of file fe_base.hpp.

Constructor & Destructor Documentation

◆ NodalFiniteElement()

mfem::NodalFiniteElement::NodalFiniteElement ( int D,
Geometry::Type G,
int Do,
int O,
int F = FunctionSpace::Pk )
inline

Construct NodalFiniteElement with given.

Parameters
DReference space dimension
GGeometry type (of type Geometry::Type)
DoNumber of degrees of freedom in the FiniteElement
OOrder/degree of the FiniteElement
FFunctionSpace type of the FiniteElement

Definition at line 733 of file fe_base.hpp.

Member Function Documentation

◆ GetDofToQuad()

const DofToQuad & mfem::NodalFiniteElement::GetDofToQuad ( const IntegrationRule & ir,
DofToQuad::Mode mode ) const
overridevirtual

Return a DofToQuad structure corresponding to the given IntegrationRule using the given DofToQuad::Mode.

See the documentation for DofToQuad for more details.

Reimplemented from mfem::FiniteElement.

Reimplemented in mfem::NodalTensorFiniteElement.

Definition at line 703 of file fe_base.cpp.

◆ GetLexicographicOrdering()

const Array< int > & mfem::NodalFiniteElement::GetLexicographicOrdering ( ) const
inline

Get an Array<int> that maps lexicographically ordered indices to the indices of the respective nodes/dofs/basis functions.

Lexicographic ordering of nodes is defined in terms of reference-space coordinates (x,y,z). Lexicographically ordered nodes are listed first in order of increasing x-coordinate, and then in order of increasing y-coordinate, and finally in order of increasing z-coordinate.

For example, the six nodes of a quadratic triangle are lexicographically ordered as follows:

5 |\ 3 4 | \ 0-1-2

The resulting array may be empty if the DOFs are already ordered lexicographically, or if the finite element does not support creating this permutation. The array returned is the same as the array given by TensorBasisElement::GetDofMap, but it is also available for non-tensor elements.

Definition at line 795 of file fe_base.hpp.

◆ GetLocalInterpolation()

void mfem::NodalFiniteElement::GetLocalInterpolation ( ElementTransformation & Trans,
DenseMatrix & I ) const
inlineoverridevirtual

Return the local interpolation matrix I (Dof x Dof) where the fine element is the image of the base geometry under the given transformation.

Reimplemented from mfem::FiniteElement.

Definition at line 740 of file fe_base.hpp.

◆ GetLocalRestriction()

void mfem::NodalFiniteElement::GetLocalRestriction ( ElementTransformation & Trans,
DenseMatrix & R ) const
overridevirtual

Return a local restriction matrix R (Dof x Dof) mapping fine dofs to coarse dofs.

The fine element is the image of the base geometry under the given transformation, Trans.

The assumption in this method is that a subset of the coarse dofs can be expressed only in terms of the dofs of the given fine element.

Rows in R corresponding to coarse dofs that cannot be expressed in terms of the fine dofs will be marked as invalid by setting the first entry (column 0) in the row to infinity().

This method assumes that the dimensions of R are set before it is called.

Reimplemented from mfem::FiniteElement.

Definition at line 764 of file fe_base.cpp.

◆ GetTransferMatrix()

void mfem::NodalFiniteElement::GetTransferMatrix ( const FiniteElement & fe,
ElementTransformation & Trans,
DenseMatrix & I ) const
inlineoverridevirtual

Return interpolation matrix, I, which maps dofs from a coarse element, fe, to the fine dofs on this finite element.

Trans represents the mapping from the reference element of this element into a subset of the reference space of the element fe, thus allowing the "coarse" FiniteElement to be different from the "fine" FiniteElement as when h-refinement is combined with p-refinement or p-derefinement. It is assumed that both finite elements use the same FiniteElement::MapType.

Reimplemented from mfem::FiniteElement.

Reimplemented in mfem::NodalTensorFiniteElement.

Definition at line 747 of file fe_base.hpp.

◆ Project() [1/3]

void mfem::NodalFiniteElement::Project ( Coefficient & coeff,
ElementTransformation & Trans,
Vector & dofs ) const
overridevirtual

Given a coefficient and a transformation, compute its projection (approximation) in the local finite dimensional space in terms of the degrees of freedom.

The approximation used to project is usually local interpolation of degrees of freedom. The derived class could use other methods not implemented yet, e.g. local L2 projection.

Reimplemented from mfem::FiniteElement.

Definition at line 796 of file fe_base.cpp.

◆ Project() [2/3]

void mfem::NodalFiniteElement::Project ( const FiniteElement & fe,
ElementTransformation & Trans,
DenseMatrix & I ) const
overridevirtual

Compute the embedding/projection matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the projection depends on it.

Reimplemented from mfem::FiniteElement.

Definition at line 857 of file fe_base.cpp.

◆ Project() [3/3]

void mfem::NodalFiniteElement::Project ( VectorCoefficient & vc,
ElementTransformation & Trans,
Vector & dofs ) const
overridevirtual

Given a vector coefficient and a transformation, compute its projection (approximation) in the local finite dimensional space in terms of the degrees of freedom. (VectorFiniteElements)

The approximation used to project is usually local interpolation of degrees of freedom. The derived class could use other methods not implemented yet, e.g. local L2 projection.

Reimplemented from mfem::FiniteElement.

Definition at line 813 of file fe_base.cpp.

◆ ProjectCurl_2D()

void mfem::NodalFiniteElement::ProjectCurl_2D ( const FiniteElement & fe,
ElementTransformation & Trans,
DenseMatrix & curl ) const
protected

Definition at line 724 of file fe_base.cpp.

◆ ProjectDiv()

void mfem::NodalFiniteElement::ProjectDiv ( const FiniteElement & fe,
ElementTransformation & Trans,
DenseMatrix & div ) const
overridevirtual

Compute the discrete divergence matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.

Reimplemented from mfem::FiniteElement.

Definition at line 945 of file fe_base.cpp.

◆ ProjectGrad()

void mfem::NodalFiniteElement::ProjectGrad ( const FiniteElement & fe,
ElementTransformation & Trans,
DenseMatrix & grad ) const
overridevirtual

Compute the discrete gradient matrix from the given FiniteElement onto 'this' FiniteElement. The ElementTransformation is included to support cases when the matrix depends on it.

Reimplemented from mfem::FiniteElement.

Definition at line 916 of file fe_base.cpp.

◆ ProjectMatrixCoefficient()

void mfem::NodalFiniteElement::ProjectMatrixCoefficient ( MatrixCoefficient & mc,
ElementTransformation & T,
Vector & dofs ) const
overridevirtual

Given a matrix coefficient and a transformation, compute an approximation ("projection") in the local finite dimensional space in terms of the degrees of freedom. For VectorFiniteElements, the rows of the coefficient are projected in the vector space.

Reimplemented from mfem::FiniteElement.

Definition at line 835 of file fe_base.cpp.

Member Data Documentation

◆ lex_ordering

Array<int> mfem::NodalFiniteElement::lex_ordering
protected

Definition at line 720 of file fe_base.hpp.


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