#include <Rodin/Variational/TestFunction.h>
template<class FES>
TestFunction class
Represents a function which belongs to a test space.
| Template parameters | |
|---|---|
| FES | Type of finite element space |
Test function in a finite element space.
In the weak formulation of a partial differential equation, test functions (also called weighting functions) are used to convert the PDE into a variational problem. Given a finite element space , the test function is chosen from this space.
Mathematical Foundation
The weak formulation seeks such that:
where:
- is the test function
- is a bilinear form
- is a linear functional
- is the test space (typically equal to the trial space )
Usage Example
P1 Vh(mesh); // Define finite element space TestFunction v(Vh); // Define test function // Use in variational formulation auto bilinearForm = Integral(Grad(u), Grad(v)); auto linearForm = Integral(f, v);
Base classes
-
template<class Derived, class FES, ShapeFunctionSpaceType Space>class ShapeFunction<TestFunction<FES>, FES, TestSpace>
- Intermediate shape function class for CRTP derivation.
Public types
- using FESType = FES
- Finite element space type.
- using Parent = ShapeFunction<TestFunction<FESType>, FESType, TestSpace>
- Parent class type.
Public static variables
- static ShapeFunctionSpaceType Space constexpr
- Space type (test space)
Constructors, destructors, conversion operators
- TestFunction(const FES& fes) constexpr
- Constructs a test function in the given finite element space.
- TestFunction(const TestFunction& other) constexpr
- Copy constructor.
- TestFunction(TestFunction&& other) constexpr
- Move constructor.
Public functions
- void operator=(const TestFunction&) deleted
- Copy assignment is deleted.
- void operator=(TestFunction&&) deleted
- Move assignment is deleted.
- auto x() const -> auto constexpr
- Gets the x-component of a vector-valued test function.
- auto y() const -> auto constexpr
- Gets the y-component of a vector-valued test function.
- auto z() const -> auto constexpr
- Gets the z-component of a vector-valued test function.
- auto getLeaf() const -> const TestFunction& constexpr
- Gets the leaf (innermost) expression in the shape function tree.
- auto copy() const -> TestFunction* override noexcept
- Creates a copy of this test function.
Function documentation
template<class FES>
Rodin:: Variational:: TestFunction<FES>:: TestFunction(const FES& fes) constexpr
Constructs a test function in the given finite element space.
| Parameters | |
|---|---|
| fes in | Finite element space |
template<class FES>
Rodin:: Variational:: TestFunction<FES>:: TestFunction(const TestFunction& other) constexpr
Copy constructor.
| Parameters | |
|---|---|
| other in | Test function to copy |
template<class FES>
Rodin:: Variational:: TestFunction<FES>:: TestFunction(TestFunction&& other) constexpr
Move constructor.
| Parameters | |
|---|---|
| other in | Test function to move |
template<class FES>
const TestFunction& Rodin:: Variational:: TestFunction<FES>:: getLeaf() const constexpr
Gets the leaf (innermost) expression in the shape function tree.
| Returns | Reference to this test function |
|---|
template<class FES>
TestFunction* Rodin:: Variational:: TestFunction<FES>:: copy() const override noexcept
Creates a copy of this test function.
| Returns | Pointer to newly allocated copy |
|---|