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
Vector

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(std::reference_wrapper<const TestFunction<FES>> v) constexpr
Constructs a linear form defined on some finite element space.

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 getVector() -> VectorType& override
Gets the reference to the (local) associated vector to the LinearForm.
auto getVector() const -> const VectorType& override
Gets the reference to the (local) associated vector to the LinearForm.
auto getTestFunction() const -> const TestFunction<FES>& override
Gets the test function argument associated to this linear form.
auto from(const LinearFormIntegratorBaseType& lfi) -> LinearForm& virtual
Builds the linear form the given LinearFormIntegratorBase instance.
auto add(const LinearFormIntegratorBaseType& lfi) -> LinearForm& virtual
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>
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) virtual

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) virtual

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.