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.
Derived classes
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class Number, class Derived>class BilinearFormIntegratorBase
- Abstract base class for bilinear form integrators.
-
template<class Number>class LinearFormIntegratorBase
- Base class for linear form integrators.
-
template<class FES, class Data>class QuadratureRule<GridFunction<FES, Data>>
- Integration of a scalar grid function over a mesh region.
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 automatic) -> 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 getOrder() const -> const OrderType& noexcept
- Gets the configured order rule for delegation to another integrator. An empty callable preserves inference; a nonempty callable preserves constant or per-polytope order selection without resolving it early.
- 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 automatic)
Restores order inference from the integrand.
| Parameters | |
|---|---|
| automatic | Tag selecting automatic quadrature-order inference. |
| Returns | Reference to this object after the operation. |
This is the default: the order is derived per polytope from the polynomial degrees of the finite elements living on it, and is therefore right exactly when the integrand's degree is the sum of those degrees — when nothing else in the expression contributes any.
A coefficient does contribute. Where it can report its degree that is accounted for; where it cannot, inference undercounts and the form is under-integrated, and this happens whether or not the integrand is polynomial. A mass form weighted by a lambda returning is cubic in a first-order basis, but the lambda reports nothing, so inference sees the basis alone and asks for a quadratic rule. The integrand is a polynomial and the answer is still wrong.
State the order with setOrder(size_
Integrator& Rodin:: Variational:: Integrator:: setOrder(size_t order)
Sets a constant integration order.
| Parameters | |
|---|---|
| order in | Integration order to use on every polytope |
| Returns | Reference to this object after the operation. |
The order is the degree the quadrature rule must integrate exactly, so this is how a caller says what its integrand actually needs: the degree of a polynomial integrand that inference cannot see in full, or, for an integrand that is not polynomial at all, the accuracy being asked for.
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 |
| Returns | Reference to this object after the operation. |
On an integrator the order is the degree of the quadrature rule, not the polynomial degree of an expression. Set it whenever the degree inference can see is not the degree the integrand has: a coefficient that reports no degree undercounts a polynomial integrand, and one that is not polynomial at all — a level set composed with a mesh lookup, say — has no degree to infer, so the inferred order is meaningless and typically too low in both cases.
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. |
const OrderType& Rodin:: Variational:: Integrator:: getOrder() const noexcept
Gets the configured order rule for delegation to another integrator. An empty callable preserves inference; a nonempty callable preserves constant or per-polytope order selection without resolving it early.
| Returns | Reference to the configured order rule; an empty rule selects integrand-based inference. |
|---|
Integrator* Rodin:: Variational:: Integrator:: copy() const override noexcept
Creates a copy of this integrator.
| Returns | Pointer to newly allocated copy |
|---|