We suppose in this section that you know how to define your mesh (see Meshes) and your function spaces (see Function Spaces). You may need integration tools too (see Integrations, Operators and Norms).
There are Feel++ tools you need to create linear and bilinear forms in order to solve variational formulation.
Notations:
u:
element from your trial function space (unknown function) v:
element from your test function spaceInterface :
Required Parameters:
_test:
test function space.Optional Parameters:
_init:
Default = false
.By default, a new linear form is:
\[ l(v)=\int_\Omega v \]
Then you can customize it using integration tools.
Examples :
From "doc/manual/tutorial/mylaplacian.cpp"
:
From "doc/manual/tutorial/myadvection.cpp"
:
Notice that +=
operator is working with linear and bilinear forms.
Interface :
Required Parameters:
_trial:
test function space _test:
trial function spaceOptional Parameters:
_init:
Default = false
.By default, a new bilinear form is:
\[ a(u,v)=\int_\Omega uv \]
Then you can custom it using integrations tools
From "doc/manual/tutorial/mylaplacian.cpp"
:
From "doc/manual/tutorial/mystokes.cpp"
:
Notice that +=
operator is working with linear and bilinear forms.
In this section we present syntax to solve variational formulations. For more general linear problems see Linear Algebra.
Once you created your linear and bilinear forms you can use the solve()
function on your bilinear form.
The solve()
function presented there is a method from the class BilinearForm
.
Interface :
Required Parameters:
_solution:
the solution. _rhs:
right hand side. The linear form.Optional Parameters:
_rebuild:
rebuild the solver matrix. Default = false
. _name:
Default = "".Examples :
From "doc/manual/tutorial/laplacian.cpp"
:
Solve the linear problem \(a(u,v)=l(v)\).
The function on()
allows you to add conditions to your bilinear form before using the solve
function.
Interface :
Required Parameters:
_range:
domain concerned by this condition (see Integrations, Operators and Norms ). _rhs:
right hand side. The linear form. _element:
element concerned. _expr:
the condition.This function is used with += operator.
Examples :
From "doc/manual/tutorial/mylaplacian.cpp"
:
There we add the condition: \( u = 0 \text{ on }\;\partial\Omega \;\).
From "doc/manual/tutorial/mystokes.cpp"
:
There we add the conditions \( u=\left( \begin{aligned} y(1-y) \\ 0 \\ \end{aligned} \right) \) on the face identified by "inlet" and \( u=\left( \begin{aligned} 0 \\ 0 \\ \end{aligned} \right) \) on the face identified by "wall".