template<class FES, class Vector>
Rodin::Variational::LinearForm class

Represents a linear form on some finite element space.

Template parameters
FES Type of finite element space

Represents a linear form defined over some finite element space.

Represents a linear form $ \ell : V_h \rightarrow \mathbb{R} $ on a given finite element space $ V_h $ .

An object of type LinearForm represents a linear map

\[ \begin{aligned} L : V &\rightarrow \mathbb{R}\\ v &\mapsto L(v) \end{aligned} \]

where $ V $ is a finite element space.

A linear form can be specified by from one or more LinearFormIntegratorBase instances.

Base classes

template<class Vector>
class LinearFormBase<Vector>
Base class for linear form objects.

Constructors, destructors, conversion operators

LinearForm(const TestFunction<FES>& v) constexpr
Constructs a LinearForm with a reference to a TestFunction and a default constructed vector owned by the LinearForm instance.
LinearForm(const TestFunction<FES>& v, Vector& vec) constexpr
Constructs a LinearForm with a reference to a TestFunction and an non-owned vector.
LinearForm(const TestFunction<FES>& v, Vector&& vec) constexpr
Constructs a LinearForm with a reference to a TestFunction and an owned vector.

Public functions

auto operator()(const GridFunction<FES>& u) const -> ScalarType constexpr
Evaluates the linear form at the function $ u $ .
void assemble() override
Assembles the linear form.
auto getTestFunction() const -> const TestFunction<FES>& override
Gets the test function argument associated to this linear form.
auto from(const LinearFormIntegratorBaseType& lfi) -> LinearForm&
Builds the linear form the given LinearFormIntegratorBase instance.
auto add(const LinearFormIntegratorBaseType& lfi) -> LinearForm&
Builds the linear form the given LinearFormIntegratorBase instance.
auto copy() const -> LinearForm* override noexcept
Copies the object and returns a non-owning pointer to the copied object.

Function documentation

template<class FES, class Vector>
Rodin::Variational::LinearForm<FES, Vector>::LinearForm(const TestFunction<FES>& v) constexpr

Constructs a LinearForm with a reference to a TestFunction and a default constructed vector owned by the LinearForm instance.

Parameters
in Reference to a TestFunction

template<class FES, class Vector>
Rodin::Variational::LinearForm<FES, Vector>::LinearForm(const TestFunction<FES>& v, Vector& vec) constexpr

Constructs a LinearForm with a reference to a TestFunction and an non-owned vector.

Parameters
in Reference to a TestFunction
vec in Reference to a vector

template<class FES, class Vector>
Rodin::Variational::LinearForm<FES, Vector>::LinearForm(const TestFunction<FES>& v, Vector&& vec) constexpr

Constructs a LinearForm with a reference to a TestFunction and an owned vector.

Parameters
in Reference to a TestFunction
vec in Vector which will be owned by the LinearForm

template<class FES, class Vector>
ScalarType Rodin::Variational::LinearForm<FES, Vector>::operator()(const GridFunction<FES>& u) const constexpr

Evaluates the linear form at the function $ u $ .

Returns The value which the linear form takes at $ u $ .

Given a grid function $ u $ , this function will compute the action of the linear mapping $ L(u) $ .

template<class FES, class Vector>
void Rodin::Variational::LinearForm<FES, Vector>::assemble() override

Assembles the linear form.

This method will assemble the underlying vector associated the linear form.

template<class FES, class Vector>
LinearForm& Rodin::Variational::LinearForm<FES, Vector>::from(const LinearFormIntegratorBaseType& lfi)

Builds the linear form the given LinearFormIntegratorBase instance.

Parameters
lfi in Integrator which will be used to build the linear form.
Returns Reference to this (for method chaining)

template<class FES, class Vector>
LinearForm& Rodin::Variational::LinearForm<FES, Vector>::add(const LinearFormIntegratorBaseType& lfi)

Builds the linear form the given LinearFormIntegratorBase instance.

Parameters
lfi in Integrator which will be used to build the linear form.
Returns Reference to this (for method chaining)

template<class FES, class Vector>
LinearForm* Rodin::Variational::LinearForm<FES, Vector>::copy() const override noexcept

Copies the object and returns a non-owning pointer to the copied object.

Returns Non-owning pointer to the copied object.