template<class Scalar>
Rodin::Variational::P0Element class

Degree 0 Lagrange element.

Template parameters
Scalar Type of scalar range (e.g., Real, Complex)

Piecewise constant (degree 0) scalar Lagrange element.

The P0Element represents a piecewise constant finite element with:

  • DOF count: 1 per element (located at barycenter)
  • Basis function: $ \phi(x) = 1 $ for all $ x $ in element
  • Derivatives: $ \nabla \phi = 0 $ (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 RangeType = Scalar
Type of range.

Public functions

auto getCount() const -> size_t constexpr
Gets the number of degrees of freedom in the finite element.

Function documentation

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