#include <Rodin/Variational/P1/P1Element.h>
template<class Scalar>
P1Element class
Degree 1 Lagrange element.
| Template parameters | |
|---|---|
| Scalar | Type of scalar range (e.g., Real, Complex) |
Continuous piecewise linear (degree 1) scalar Lagrange element.
| Specialization | Description |
|---|---|
| P1Element<Scalar> | Scalar-valued continuous piecewise linear element. |
| P1Element<SpatialVector<Scalar>> | Vector-valued continuous piecewise linear element. |
The P1Element provides a first-order finite element with:
- DOF count: One per vertex ( total)
- Basis functions: Linear functions satisfying
- Gradient: Constant on each element,
- 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 .
Base classes
-
template<class Derived>class FiniteElementBase<P1Element<Scalar>>
- Base class for finite elements.
Public types
- class BasisFunction
- Represents a piecewise linear basis function of a P1 scalar element.
- class LinearForm
- Represents a linear form of a P1 scalar element.
- using Parent = FiniteElementBase<P1Element<Scalar>>
- Parent class.
- using ScalarType = Scalar
- Scalar value type.
- using RangeType = ScalarType
- Type of range.
Constructors, destructors, conversion operators
Public functions
- 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 getOrder() const -> size_t
- Returns the polynomial order.
- auto getFactorOrder() const -> size_t constexpr
- Degree of each simplex, tensor, or collapsed-coordinate factor.
-
template<class Archive>void serialize(Archive& ar, const unsigned int version)
- Serializes the object through a Boost archive.
Function documentation
template<class Scalar>
Rodin:: Variational:: P1Element<Scalar>:: P1Element(Geometry:: Polytope:: Type geometry) constexpr
Constructs the P1Element from the given arguments.
| Parameters | |
|---|---|
| geometry | Reference geometry. |
template<class Scalar>
size_t Rodin:: Variational:: P1Element<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:: SpatialPoint& Rodin:: Variational:: P1Element<Scalar>:: 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. |
template<class Scalar>
const LinearForm& Rodin:: Variational:: P1Element<Scalar>:: 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. |
template<class Scalar>
const BasisFunction& Rodin:: Variational:: P1Element<Scalar>:: 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. |
template<class Scalar>
size_t Rodin:: Variational:: P1Element<Scalar>:: getOrder() const
Returns the polynomial order.
| Returns | Polynomial order of the finite element. |
|---|
template<class Scalar>
size_t Rodin:: Variational:: P1Element<Scalar>:: getFactorOrder() const constexpr
Degree of each simplex, tensor, or collapsed-coordinate factor.
| Returns | The factor order. |
|---|
template<class Scalar>
template<class Archive>
void Rodin:: Variational:: P1Element<Scalar>:: 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. |