Logo  0.95.0-final
Finite Element Embedded Library and Language in C++
Feel++ Feel++ on Github Feel++ community
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Post-Processing and Visualisation

Introduction

Once we have solved the PDE is solved we usually would like to visualise the solution and possibly other data or fields associated with the problem. Feel++ provides a very powerful framework for post-processing allowing to:

  • visualize time-based data
  • visualize high order functions
  • visualize traces
  • use standard visualisation tools such as Paraview, Ensight and even Gmsh

To achieve this, Feel++ defines a so-called Exporter object

General principles

The library Feel itself does not have any visualization capabilities. However, it provides tools to export both scalar and vector fields into two formats: EnSight and Gmsh. The EnSight format can be read by the visualization software EnSight http://www.ensight.com or, for instance, by the open source package Paraview http://www.paraview.org.

The choice of format depends on several factors, some of them being the robustness/capabilities of the visualization packages associated and the type of data to be plotted.

For first (at most second) degree piecewise polynomials defined in straight edge/faces meshes, Paraview (or any other software that reads the EnSight format) is a very good choice. A trick to use Paraview (or any other visualization software that plots first order geometrical and finite elements) to visualize high degree polynomials in curved meshes, is to use an interpolation operator built on high order nodes associated with the polynomial space, see~[10]. However, for high degree polynomials or meshes with curved elements, Gmsh http://geuz.org/gmsh is prefered due to its adaptive visualization algorithm for this type of finite/geometrical element, see[5].

To illustrate both approaches in visualizing high degree polynomials in curved meshes, we plot, in the Figures below, the nodal projection of the function $f(x,y)=\cos(5x) \sin(5y)$ in the unit circle onto several function spaces. Notice the improved look of the projection using high degree polynomials instead of linear projections in a finer mesh. We remark also that the difference between the two approaches fades away as we increase the degree of the polynomials and the order of the geometrical elements. However, the additional cost of building the piecewise first order finite element space associated with the finer mesh, the calculation of the projection onto this space and the smoothness of the graphics makes Gmsh's approach more appealing to visualize this type of finite elements. We highlight that these algorithms are available for meshes composed only of simplices or quadrilaterals (see Mathematical Concepts and Notations), in 1D, 2D and 3D.

circle_p1p1.png
P1
circle_p2p2.png
circle_p2p2_p1interpolator.png
$u$: $P_1$, $P_2/P_2$ and $P_2/P_2$ with $P_1$ interpolation
circle_p3p3.png
circle_p3p3_p1interpolator.png
circle_p4p4.png
circle_p4p4_p1interpolator.png
circle_p5p5.png
circle_p5p5_p1interpolator.png
$u$: $P_1$, $P_2/P_2$ and $P_2/P_2$ with $P_1$ interpolation

To further illustrate the capabilities of the Feel's exporter to Gmsh, we plot in Figures 1D and 3D functions defined in the $[-1,1]$ interval and the unit sphere, respectively.

sphere_p1.png
sphere_p2.png
sphere_p3.png
sphere_p4.png
Low to high order visualisation of $u$

Visualisation

We would like to visualise the function $u=\sin(\pi x)$ over $\Omega=\{(x,y) \in \mathbb{R}^2 | x^2 + y^2 < 1\}$. $\Omega$ is approximated by $\Omega_h$.

To define $\Omega$ and $u$, the code reads

auto mesh = unitCircle<2>(); // ``order 2'' circle
auto Xh = Pch<2>( mesh ); // $\mathbb{p}_2$ space
auto v = project( _space=Xh, _range=elements(mesh),
_expr=sin(pi*Px()));

We start with an Exporter object that allows to visualise the $P_1$ interpolant of $u$ over

top



Generated on Fri Oct 25 2013 14:24:27 for Feel++ by doxygen 1.8.4