P1Element

Degree 1 Lagrange element.

Defined in Rodin/Variational/P1/P1Element.h

template <
  class Scalar>
class P1Element;
Template parameters
Scalar Type of scalar range (e.g., Real, Complex)

Continuous piecewise linear (degree 1) scalar Lagrange element.

SpecializationDescription
Math::SpatialMatrix<Scalar>
Full specialization
template <
  class Scalar>
class P1Element<
  Math::SpatialMatrix< Scalar >> final;
Matrix-valued reference element built from scalar nodal functionals.
Math::SpatialVector<Scalar>
Full specialization
template <
  class Scalar>
class P1Element<
  Math::SpatialVector< Scalar >> final;
Continuous piecewise linear (degree 1) vector Lagrange element.

The P1Element provides a first-order finite element with:

  • DOF count: One per vertex ( $ n_v $ total)
  • Basis functions: Nodal functions satisfying $ \phi_i(x_j) = \delta_{ij} $
  • Gradient: Constant on simplices; generally variable on other geometries
  • Continuity: Global C⁰ continuity across element interfaces

P1 elements provide first-order convergence and are the standard choice for elliptic PDEs like Poisson's equation $ -\Delta u = f $ .

Direct inheritance by class family
↓
P1Element

Inherits from

Base classResponsibility
LagrangeFiniteElementBase<…>public
Full type
LagrangeFiniteElementBase< P1Element< Scalar > >
Common reference-space properties of Lagrange element families.

Inherited interface

Declared inMembers
FiniteElementBase
4 members
LagrangeFiniteElementBase
1 members

Public types

class LinearForm
Represents a linear form of a P1 scalar element.
class BasisFunction
Represents a piecewise linear basis function of a P1 scalar element.
using Parent = LagrangeFiniteElementBase<P1Element<Scalar>>
Parent class.
using ScalarType = Scalar
Scalar value type.
using RangeType = ScalarType
Type of range.
using Tabulation = ReferenceTabulation<Scalar>
Reference values and derivatives in this element's vertex order.

Constructors, destructors, conversion operators

P1Element(Geometry::Polytope::Type geometry) constexpr
Constructs the P1Element from the given arguments.
P1Element(const P1Element& other) constexpr
Copy constructor.
P1Element(P1Element&& other) constexpr
Move constructor.

Public functions

auto getTabulation(const QF::QuadratureFormula& formula) const -> const Tabulation&
Reuses the element's own basis at quadrature reference samples.
auto findTabulation(const QF::QuadratureFormula& formula) const -> Optional<std::reference_wrapper<const Tabulation>>
Borrows an existing table without reading its source formula.
auto operator=(const P1Element& other) -> P1Element& constexpr
Copy assignment.
auto operator=(P1Element&& other) -> P1Element& constexpr
Move assignment.
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::SpatialPoint& constexpr
Gets the node of a local degree of freedom.
auto getLinearForm(size_t i) const -> const LinearForm&
Gets the degree-of-freedom functional of a local degree of freedom.
auto getBasis(size_t i) const -> const BasisFunction&
Gets the basis function of a local degree of freedom.
auto getDegree() const -> Optional<size_t> constexpr
Returns a total polynomial degree bound for the reference basis.
auto getDegree(std::initializer_list<size_t> directions) const -> Optional<size_t>
Returns a degree bound in selected reference coordinates.
auto getOrder() const -> size_t constexpr
Returns the finite-element family index.
template<class Archive>
void serialize(Archive& ar, const unsigned int version)
Serializes the object through a Boost archive.

Function documentation

P1Element(Geometry::Polytope::Type geometry) constexpr

Constructs the P1Element from the given arguments.

Parameters
geometry Reference geometry.

P1Element(const P1Element& other) constexpr

Copy constructor.

Parameters
other Object to copy from.

P1Element(P1Element&& other) constexpr

Move constructor.

Parameters
other Object to move from.

const Tabulation& getTabulation(const QF::QuadratureFormula& formula) const

Reuses the element's own basis at quadrature reference samples.

Parameters
formula Persistent immutable reference samples.
Returns A table borrowed until a later insertion evicts its slot.

The canonical reference store is shared across cells on this thread. Tensor-product, wedge and rational pyramid basis formulas are retained; no H1 basis or coefficient-order conversion is performed.

Optional<std::reference_wrapper<const Tabulation>> findTabulation(const QF::QuadratureFormula& formula) const

Borrows an existing table without reading its source formula.

Parameters
formula Persistent formula defining the samples.
Returns The matching table on this thread, or no value after eviction.

P1Element& operator=(const P1Element& other) constexpr

Copy assignment.

Parameters
other Object to copy from.
Returns Reference to this object after the operation.

P1Element& operator=(P1Element&& other) constexpr

Move assignment.

Parameters
other Object to move from.
Returns Reference to this object after the operation.

size_t getCount() const constexpr

Gets the number of degrees of freedom in the finite element.

Returns Number of degrees of freedom

const Math::SpatialPoint& getNode(size_t i) const constexpr

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.

const LinearForm& getLinearForm(size_t i) const

Gets the degree-of-freedom functional of a local degree of freedom.

Parameters
i Index of the requested entry.
Returns The degree-of-freedom functional of a local degree of freedom.

const BasisFunction& getBasis(size_t i) const

Gets the basis function of a local degree of freedom.

Parameters
i Local basis-function index.
Returns Value of the selected local basis function at the evaluation point.

Optional<size_t> getDegree() const constexpr

Returns a total polynomial degree bound for the reference basis.

Returns A total degree bound, or no polynomial bound for rational pyramids.

Optional<size_t> getDegree(std::initializer_list<size_t> directions) const

Returns a degree bound in selected reference coordinates.

Parameters
directions Reference-coordinate indices; duplicates are ignored.
Returns The bound, or no value for invalid or unsupported selections.

size_t getOrder() const constexpr

Returns the finite-element family index.

Returns The family index, independently of the reference geometry.

template<class Scalar> template<class Archive>
void serialize(Archive& ar, const unsigned int version)

Serializes the object through a Boost archive.

Parameters
ar Serialization archive.
version Boost.Serialization class version; unused by this implementation.