Integrator class
#include <Rodin/Variational/Integrator.h>
Abstract base class for integrators in variational formulations.
The Integrator class provides a common interface for all types of integrators used in finite element assembly. Integrators compute local (element-level) contributions that are then assembled into global matrices and vectors.
Integrator Types
There are two main types of integrators:
- Linear Integrators: Compute contributions to the load vector (RHS)
- Example:
- Bilinear Integrators: Compute contributions to the system matrix
- Example:
Role in Assembly
During the assembly process:
- Integrators are iterated over mesh elements
- Local contributions are computed using numerical quadrature
- Local contributions are mapped to global indices
- Global matrix/vector is updated with local contributions
Base classes
- class Base
- Base class for all objects in Rodin's FormLanguage system.
Public types
- enum class Type { Linear, Bilinear }
- Enumeration of integrator types.
-
using Parent = FormLanguage::
Base - Parent class type.
-
using OrderType = std::function<size_t(const Geometry::
Polytope&)> - Virtual destructor.
Constructors, destructors, conversion operators
- Integrator() defaulted
- Default constructor.
- Integrator(const Integrator& other)
- Copy constructor.
- Integrator(Integrator&& other)
- Move constructor.
Public functions
- auto setOrder(std::nullopt_t) -> Integrator&
- Restores order inference from the integrand.
- auto setOrder(size_t order) -> Integrator&
- Sets a constant integration order.
- auto setOrder(OrderType order) -> Integrator&
- Sets a rule computing the integration order per polytope.
-
auto getOrder(const Geometry::
Polytope& polytope) const -> Optional<size_t> - The integration order to use on a polytope.
- auto getType() const -> Type pure virtual
- Gets the type of this integrator.
- auto copy() const -> Integrator* override noexcept
- Creates a copy of this integrator.
Enum documentation
Typedef documentation
using Rodin:: Variational:: Integrator:: OrderType = std::function<size_t(const Geometry:: Polytope&)>
Virtual destructor.
Rule giving the integration order to use on a polytope.
Function documentation
Rodin:: Variational:: Integrator:: Integrator(const Integrator& other)
Copy constructor.
| Parameters | |
|---|---|
| other in | Integrator to copy |
Rodin:: Variational:: Integrator:: Integrator(Integrator&& other)
Move constructor.
| Parameters | |
|---|---|
| other in | Integrator to move |
Integrator& Rodin:: Variational:: Integrator:: setOrder(std::nullopt_t)
Restores order inference from the integrand.
This is the default: the order is derived per polytope from the polynomial degrees of the finite elements living on it. Correct whenever the integrand is polynomial.
Integrator& Rodin:: Variational:: Integrator:: setOrder(size_t order)
Sets a constant integration order.
| Parameters | |
|---|---|
| order in | Integration order to use on every polytope |
Note that the inferred order is a function of the polytope, so a constant is only equivalent to inference on a mesh whose elements all share one degree; prefer setOrder(OrderType) otherwise.
Integrator& Rodin:: Variational:: Integrator:: setOrder(OrderType order)
Sets a rule computing the integration order per polytope.
| Parameters | |
|---|---|
| order in | Rule invoked with the polytope being integrated |
On an integrator the order is the degree of the quadrature rule, not the polynomial degree of an expression; the two coincide only when the integrand is polynomial. Set it explicitly whenever it is not — a coefficient composing a level set with a mesh lookup, say — since the inferred order is then meaningless and typically too low.
Optional<size_t> Rodin:: Variational:: Integrator:: getOrder(const Geometry:: Polytope& polytope) const
The integration order to use on a polytope.
| Parameters | |
|---|---|
| polytope in | Polytope being integrated |
| Returns | The order given by the rule, or an empty optional when the order is to be inferred from the integrand. |
Integrator* Rodin:: Variational:: Integrator:: copy() const override noexcept
Creates a copy of this integrator.
| Returns | Pointer to newly allocated copy |
|---|