Rodin::Variational::Integrator class

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: $ b_i = \int_K f \psi_i \, dx $
  • Bilinear Integrators: Compute contributions to the system matrix
    • Example: $ A_{ij} = \int_K \nabla \phi_j \cdot \nabla \psi_i \, dx $

Role in Assembly

During the assembly process:

  1. Integrators are iterated over mesh elements
  2. Local contributions are computed using numerical quadrature
  3. Local contributions are mapped to global indices
  4. 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 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) -> 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

enum class Rodin::Variational::Integrator::Type

Enumeration of integrator types.

Enumerators
Linear

Linear form integrator (load vector)

Bilinear

Bilinear form integrator (system matrix)

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, 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 $ x + y $ 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_t) whenever the degree the integrand actually has is not the degree inference can see.

Integrator& Rodin::Variational::Integrator::setOrder(size_t order)

Sets a constant integration order.

Parameters
order in Integration order to use on every polytope

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

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.

Type Rodin::Variational::Integrator::getType() const pure virtual

Gets the type of this integrator.

Returns Type indicating whether this is a linear or bilinear integrator

Integrator* Rodin::Variational::Integrator::copy() const override noexcept

Creates a copy of this integrator.

Returns Pointer to newly allocated copy