|
Galeri Development
|
This file gives an overview of the finite element module of Galeri.
An alternative way to produce example matrices is to define a finite element problem. The Galeri package contains (in the Galeri::FiniteElement namespace) a set of classes that can be used to discretize scalar, second-order, symmetric and non-symmetric PDEs of type

Neumann boundary conditions can be imposed with minimal changes to the code. The computational domain 
The Galeri finite element code is based on a set of abstract classes:
The solution can be visualized using MEDIT (see web page http://www.ann.jussieu.fr/~frey/logiciels/medit.html for details and download).
Probably, the easiest way to understand the finite element module is to browse the examples; see 3D Laplacian and 2D Advection-diffusion. File How to deal with AbstractGrid Classes shows how to use the AbstractGrid class.
Examples of solutions are reported below.
AdvDiffSquare: Creates a matrix corresponding to the finite element discretization of the advection-diffusion problem
![\[
\begin{tabular}{ r l c}
$- \epsilon \Delta u + \mathbf{b} \cdot \nabla u = 0$ & in $\Omega = (0, 1)$ \\
$u = g$ & on $\partial \Omega$
\end{tabular}
\]](form_57.png)





"galeri/data/Square.grid". The solution looks like:
LaplaceCircle: Creates a matrix corresponding to the finite element discretization of the Laplace problem
![\[
\begin{tabular}{ r l c}
$-\Delta u = f$ & in $\Omega = \forall (x, y) \; | \;\sqrt{(x-1)^2 + (y-1)^2)} < 1$ \\
$u = 0$ & on $\partial \Omega$
\end{tabular}
\]](form_63.png)
"galeri/data/Circle.grid". The solution looks like:
LaplaceSquare: Creates a matrix corresponding to the finite element discretization of the Laplace problem
![\[
\begin{tabular}{ r l c}
$-\Delta u = f$ & in $\Omega = (0, 1)$ \\
$u = 0$ & on $\partial \Omega$
\end{tabular}
\]](form_64.png)
"galeri/data/Square.grid". The solution looks like:
LaplaceSquareInSquare: Creates a matrix corresponding to the finite element discretization of the Laplace problem
![\[
\begin{tabular}{ r l c}
$-\Delta u = 1$ & in $\Omega = (0, 3) \times (0, 3) \backslash (1,2) \times
(1,2)$ \\
$u = g$ & on $\partial \Omega$
\end{tabular}
\]](form_65.png)


0, while the one of the internal boundary is 1. The grid is composed by 4800 triangles, 2516 nodes, and 232 boundary faces, and can be found in file "galeri/data/SquareInSquare.grid". The solution looks like: