P0Element.h file
P0 (piecewise constant) finite element implementation.
This file provides the P0Element class template for piecewise constant finite elements. P0 elements have:
- One degree of freedom per element (at the barycenter)
- Constant basis function:
- Zero gradient:
Supported Specializations
Scalar P0Element<Scalar>:
- Works with Real and Complex scalar types
- Single DOF at element barycenter
- Constant value throughout element
Vector P0Element<Math::Vector<Scalar>>:
- Component-wise constant vector fields
- DOFs per element (one per vector component)
- Basis functions: where
Usage Example
using namespace Rodin::Variational; // Scalar P0 element (real or complex) RealP0Element p0_real(Polytope::Type::Triangle); ComplexP0Element p0_complex(Polytope::Type::Triangle); // Vector P0 element (2D) VectorP0Element p0_vec(2, Polytope::Type::Triangle); // 2 DOFs
P0 elements are commonly used in discontinuous Galerkin (DG) methods, mixed finite element formulations, and as test spaces for finite volume schemes.
Namespaces
- namespace Rodin
- The Rodin library for Shape and Topology Optimization.
- namespace Rodin::FormLanguage
- Module for writing high level abstract expressions.
- namespace Rodin::Variational
- Module which provides the necessary tools for constructing variational problems.
Classes
-
template<class Scalar>class Rodin::Variational::P0Element
- Degree 0 Lagrange element.
- class Rodin::Variational::P0Element::LinearForm
- Represents a linear form of a P0 scalar element.
- class Rodin::Variational::P0Element::BasisFunction
- Represents the constant basis function of a P0 scalar element.
-
template<size_t Order>class Rodin::Variational::P0Element::BasisFunction::DerivativeFunction
- Represents a derivative of the P0 basis function (always zero).
-
template<class Scalar>class Rodin::Variational::P0Element<Math::Vector<Scalar>>
- Piecewise constant (degree 0) vector Lagrange element.
- class Rodin::Variational::P0Element<Math::Vector<Scalar>>::LinearForm
- Represents a linear form (evaluation functional) for vector P0 elements.
- class Rodin::Variational::P0Element<Math::Vector<Scalar>>::BasisFunction
- Represents a piecewise constant vector basis function.
-
template<size_t Order>class Rodin::Variational::P0Element<Math::Vector<Scalar>>::BasisFunction::DerivativeFunction
- Represents a derivative of the vector P0 basis function (always zero).