Arbeitsgruppe Mathematik in Industrie und Technik

### FEINS

#### (Finite Element Incompressible Navier-Stokes solver)

Author: Rene Schneider

#### Intro

As the name suggests, this software originated as a solver for fluid flow problems, to test methods developed in the authors PhD Thesis. Over time though it evolved, and the same low level routines were reused to build solvers for other problems as well.

All linear equation systems are solved by modern preconditioned iterative methods, based on multi-level/multi-grid ideas.

Although the code is written entirely in C, it uses ideas from object oriented programming to a certain degree, to combine advantages of both worlds.

#### Key features

The code currently implements unstructured meshes of triangular elements (P1 and P2) in two dimensions, unstructured meshes of tetrahedral elements (P1) in three dimensions, with adaptive refinement or uniform h-refinement. The data structures and code layout are intended to allow easy extension other types of elements (e.g. quadrangles, hexahedra).

From the beginning, the code was meant to support shape optimisation. For this purpose in 2D it allows boundary sections defined by Bezier-splines, and is able to compute the derivatives of functionals that depend on the solution of a PDE with respect to those spline parameters. This is done efficiently by means of the discrete adjoint method (see the authors PhD thesis), with a cost roughly equivalent to one additional solve of the primal problem. This derivative is in some sense a shape-gradient of the functional, which can be used for optimisation.
In 3D shape optimisation is not implemented yet, but should be possible with similar techniques.

Problem specific features:
Poisson Equation
• mainly meant for testing various components for other problems
• BPX-preconditioner and V-cycle-multigrid as preconditioners for CG
• P1 and P2 elements in 2D
• P1 elements in 3D
• adaptivity, using Bänsch green refinement and a ZZ error estimator (currently only in 3D)
• stationary case only
Lame-Equation of linear elasticity
• BPX-preconditioner and V-cycle-multigrid as preconditioners for CG
solving 35,419,650 DOFs for P2 elements to 1e-6 in 733 seconds on a single core of a Intel Xeon 5160 @ 3.0 GHz
• P1 and P2 elements
• adaptivity, using Bänsch green refinement and a residual error estimator
• stationary case only
Incompressible Navier-Stokes
• Newton- or Picard-linearisation
• Fp-preconditioner for GMRES ([Kay, Loghin, Wathen, 2002] and [Elman, Loghin, Wathen, 2003]) with multigrid preconditioned GMRES for solving the subproblems within the preconditioner.
solving 37,769,219 DOFs to 1e-9 in 8.6 hours on a single core of a Intel Xeon 5160 @ 3.0 GHz
• Taylor-Hood elements (P2 for velocities and P1 for pressure)
• stationary case only

This finite element solver is released as free software under GNU GPL Version 3. However, if this to restrictive for your purposes, please contact the author rene.schneider@..., and a less restrictive license may be agreed.

#### Documentation

The code itself is documented fairly well, but a central guide is only available in form of the README.TXT. The README provides support up to the point that you can build the code and run an example that comes along with it. It should be fairly easy to start from there. If you have questions, please contact me: rene.schneider@....

• feins___rev2691_2013-04-19__15_51_17.tgz, SVN snapshot revision 2691, last change 19 April 2013.
Main changes since last release:
• mainly added 3D support, E1 tetrahedra only for now
• mesh read and .vtk writing of solution
• solution of Poisson problems with test_assem3d.c
• multigrid for E1 is working
• interface with mesh generator gmsh
• can directly read .msh files
• can use a modified gmsh to project new nodes onto geometry
• still only Poisson equation
• ZZ error estimate (generic)
• Baensch green refinement
• several 3D geometries for tests

• Improvements on Navier-Stokes preconditioner:
• implemented Chebyshev semi iteration in the preconditioner for Stokes problems. This does indeed allow significant savings. Should investigate this further.
• new interface to hypre->BoomerAMG:
• algebraic multigrid
• requires hypre to be configured and built without MPI
• Option to use AMG inside Preconditioner for navsto
• select FP_VELOCITY_SOLVER (4) in feins_macros.h to use this

• Other improvements:
• improved OMP implementation on some parts
• convection-diffussion code is now OMP parallel
• feins___rev2579_2011-04-29__13_59_22.tgz, SVN snapshot revision 2579, last change 29 April 2011.
Main changes since last release:
• two new examples for optimisation with linear elasticity equation: pedal crank and support with hole
• generic ZZ error estimate and generalised marking: gen_error_est_zz_tx gen_error_est_marker
• improved the solver_settings section of mesh files (.f1m), now allowing various stopping criteria for the mesh refinement among other options
• backward Euler and ROS3P Rosenbrock ODE solver for time dependent convection diffusion
• loads of changes to make feins compile and run in Windows environment. See README.txt for instructions on building under Windows
• implemented usage of OpenMP parallelisation: for now only matrix vector products and assembly of Navier-Stokes matrices, reasonable speedup, looks promising
• feins___rev1824_2010-05-21__13_00_13.tgz, SVN snapshot revision 1824, last change 21 May 2010.
Main changes since last release:
• Adjoint and shape gradient for Lamé equation (linear elasticity, thanks Andreas Günnel).
• Adaptivity for Lamé equation (Bänsch green refinement, thanks Andreas Günnel, see his Diplom thesis).
• Dropped \$ARCHI variable approach and old makefiles, we now use cmake for automatic configuration, see also README.TXT.
• Added UMFPACK as sparse direct solver, with automatic detection of availability.
• New visualisation solution: paraview. We can now write .vtk files for use with paraview.
• feins_080703.tgz, released 3 July 2008.

#### Examples

• Navier-Stokes: shape optimisation of a obstacle in a channel
Initial shape at Re=10

Optimised shape for Re=10
• Navier-Stokes: flow over bump (from README.TXT)
• Navier-Stokes: cavity (with curved bottom)
lid driven cavity at Re=100; 148,739 DOFs, solution takes 54s, adjoint gradient 30s
• Linear elasticity (Lamé): optimisation of a pedal crank
Initial shape

Optimised shape
• Linear elasticity (Lamé): triangular support with a hole
• Poisson equation: square domain (solution accurate up to discretisation error)
Nodes PCG iterations |C^-1 res| time(level) (s) time(total) (s)
9 1 0.00e+00 1.459e-04 1.550e-04
25 2 1.82e-04 6.390e-05 2.639e-04
81 2 9.46e-04 1.841e-04 4.921e-04
289 3 1.11e-04 6.971e-04 1.387e-03
1,089 3 6.75e-05 2.659e-03 4.585e-03
4,225 3 3.90e-05 5.158e-03 1.109e-02
16,641 3 2.08e-05 2.089e-02 3.498e-02
66,049 3 1.05e-05 9.640e-02 1.438e-01
263,169 3 5.22e-06 4.546e-01 6.456e-01
1,050,625 3 2.59e-06 1.922e+00 2.764e+00
4,198,401 3 1.29e-06 7.912e+00 1.144e+01
16,785,409 3 6.44e-07 3.110e+01 4.565e+01
67,125,249 3 3.22e-07 1.283e+02 1.865e+02

• Poisson equation in 3D: domain of complex 3D geometry (solution accurate up to discretisation error)
Nodes PCG iterations |C^-1 res| time(level) (s) time(total) (s)
7,334 1 2.62e-10 7.848e-01 7.909e-01
50,036 3 9.09e+00 4.036e-01 2.482e+00
366,87 3 7.22e+00 3.105e+00 1.081e+01
2,803,666 2 6.29e+01 2.212e+01 5.640e+01
21,909,034 3 3.05e+01 1.750e+02 3.493e+02

visits to this site: 10514
Details.