#include <Rodin/Variational/P0/P0Element.h>
template<class Scalar>
P0Element class
Degree 0 Lagrange element.
| Template parameters | |
|---|---|
| Scalar | Type of scalar range (e.g., Real, Complex) |
Piecewise constant (degree 0) scalar Lagrange element.
| Specialization | Description |
|---|---|
| P0Element<Scalar> | Scalar-valued discontinuous piecewise constant element. |
| P0Element<SpatialVector<Scalar>> | Vector-valued discontinuous piecewise constant element. |
The P0Element represents a piecewise constant finite element with:
- DOF count: 1 per element (located at barycenter)
- Basis function: for all in element
- Derivatives: (constant function has zero gradient)
P0 elements are discontinuous across element interfaces, making them suitable for DG methods, flux computations, and element-wise constant approximations.
Base classes
-
template<class Derived>class FiniteElementBase<P0Element<Scalar>>
- Base class for finite elements.
Public types
- class BasisFunction
- Represents the constant basis function of a P0 scalar element.
- class LinearForm
- Represents a linear form of a P0 scalar element.
- using Parent = FiniteElementBase<P0Element<Scalar>>
- Parent class.
- using ScalarType = Scalar
- Scalar value type.
- using RangeType = Scalar
- Type of range.
Constructors, destructors, conversion operators
Public functions
- auto operator=(const P0Element& other) -> P0Element& defaulted constexpr
- Assigns the scalar basis and matrix component dimensions.
- auto operator=(P0Element&& other) -> P0Element& defaulted constexpr
- Assigns the scalar basis and matrix component dimensions.
- auto getCount() const -> size_t constexpr
- Gets the number of degrees of freedom in the finite element.
-
auto getNode(size_t i) const -> const Math::
SpatialVector<Real>& - Gets the node of a local degree of freedom.
- auto getLinearForm(size_t local) const -> LinearForm constexpr
- Gets the degree-of-freedom functional of a local degree of freedom.
- auto getBasis(size_t local) const -> BasisFunction constexpr
- Gets the basis function of a local degree of freedom.
- auto getOrder() const -> size_t constexpr
- Returns the polynomial order.
Function documentation
template<class Scalar>
Rodin:: Variational:: P0Element<Scalar>:: P0Element(Geometry:: Polytope:: Type geometry) constexpr
Constructs the P0Element from the given arguments.
| Parameters | |
|---|---|
| geometry | Reference geometry. |
template<class Scalar>
size_t Rodin:: Variational:: P0Element<Scalar>:: getCount() const constexpr
Gets the number of degrees of freedom in the finite element.
| Returns | Number of degrees of freedom |
|---|
template<class Scalar>
const Math:: SpatialVector<Real>& Rodin:: Variational:: P0Element<Scalar>:: getNode(size_t i) const
Gets the node of a local degree of freedom.
| Parameters | |
|---|---|
| i | Index of the requested entry. |
| Returns | The node of a local degree of freedom. |
template<class Scalar>
LinearForm Rodin:: Variational:: P0Element<Scalar>:: getLinearForm(size_t local) const constexpr
Gets the degree-of-freedom functional of a local degree of freedom.
| Parameters | |
|---|---|
| local | Local degree-of-freedom index; unused by this constant element. |
| Returns | The degree-of-freedom functional of a local degree of freedom. |
template<class Scalar>
BasisFunction Rodin:: Variational:: P0Element<Scalar>:: getBasis(size_t local) const constexpr
Gets the basis function of a local degree of freedom.
| Parameters | |
|---|---|
| local | Local degree-of-freedom index; unused by this constant element. |
| Returns | Value of the selected local basis function at the evaluation point. |
template<class Scalar>
size_t Rodin:: Variational:: P0Element<Scalar>:: getOrder() const constexpr
Returns the polynomial order.
| Returns | Polynomial order of the finite element. |
|---|