FEATool
v1.6
Finite Element Analysis Toolbox

This chapter describes the solver options available with FEATool. Solvers are used to compute solutions to the involved finitie element FEM discretizations.
After a geometry, grid, and equation and boundary conditions have been defined one can change to solve mode by pressing the mode button.
The Solve menu similarly allows for switching to Solve Mode and also opening the Solver Settings... dialog box. The menu also features an option to Get Initial Solution which computes the expressions defined in the Initial Condition fields of the equation settings dialog box and returns this as the solution. Moreover, the default solver call command can be edited and changed through the Solver Call Command... option thus allowing for custom and external solvers to be employed.
In solve mode the available toolbar buttons and actions are the following.
The Solver Settings dialog box shown below and can be opened by pressing the corresponding toolbar button. The solver settings allow advanced control over the default builtin FEATool solver.
Firstly, the Solver Type option allows for either stationary monolithic solver solvestat, or the time dependent instationary solver solvetime to be chosen. Monolithic means that all dependent variables are discretized and solved together in a large coupled system, rather than iteratively solving a segregated set of smaller decoupled systems.
Initial Condition controls whether the initial values should be computed from the equation expressions in the initial value fields, or taken from an old solution in which case the solution can be chosen from the corresponding list box. Note that for this to work the geometry, grid, physics modes, and finite element shape functions must all remain the same.
The Time Dependent Settings controls timestepping parameters when using the timedependent solver. The Time step selects a fixed time step size for single step schemes, or the average time step size for multistep schemes. Time dependent simulations will terminate either when the accumulated time has reached the specified Simulation time, or the normed changes in the dependent solution variables are smaller than the Time stopping criteria indicating a stationary state. The Time stepping scheme allows choosing between the singlestep first order Backward Euler and second order CrankNicolson schemes, as well as the second order (multistep) Fractionalsteptheta scheme. Lastly, one can choose between using standard rowsum lumped and full Mass matrix representations.
The nonlinear solver is used then dependent variables are detected in the equation coefficients, which is the typical for multiphysics problems. Per default standard fixed point iterations are used while Newton iterations can be used if an analytical Jacobian is supplied by the user (see the NavierStokes fluid flow models for examples of this).The NonLinear Solver Settings allows control over the Maximum number of nonlinear iterations, and the Nonlinear relaxation parameter which is the fraction of the new to old solution to weigh in the next nonlinear iteration. The nonlinear solver will terminate and stop when either of the Defect stopping criteria or Solution changes stopping criteria are met which can be chosen to be measured both absolute or relatively. Stopping criteria for the nonlinear solver
In the General Settings frame there is also a setting to control the numerical integration rule and order used in the matrix assembly operations (it is necessary to increase this for higher order >2 shape functions).
FEATool uses the default builtin linear solvers available in Matlab and Octave which currently is the direct Umfpack and SuiteSparse solver suites. These are very robust for a wide range of problems but not as efficient either in memory or speed as a specialized dedicated solver can be. Starting with FeatFlow, FEATool provides functionality for using more efficient specialized external solvers.
FeatFlow, is very fast and efficient FEM based computational fluid dynamics (CFD) solver for the incompressible NavierStokes equations. The FeatFlow solver makes it easy to perform high performance CFD simulations with FEATool Multiphysics directly in Matlab and Octave.
FeatFlow is a finite element CFD code based on using an efficient FEM discretization (RannacherTurek nonconforming ansatz functions) together with a geometric multigrid approach for solving linear systems [1],[2]. This results in a very fast and computationally efficient solver typically yielding a magnitude or more of speedup compared to the builtin direct solver in Matlab (UMFPACK). Additionally, an iterative solver, such as in FeatFlow, uses much less memory than a direct one allowing for much larger simulations. Being a very stable and tested CFD code, FeatFlow has been used and validated in many commercial CFD projects, and studies have shown FeatFlow to be significantly more efficient than both Ansys CFX and OpenFOAM with respect to the total CPU time required to achieve a target accuracy [3].
The video below is a tutorial showing how to set up and solve a backwards facing step CFD problem with the FEATool GUI. For this backwards facing step benchmark example the FeatFlow solver is about 50 times faster compared to using the default builtin solver.
FeatFlow strictly employs quadrilateral grids in two dimensions. In the FEATool GUI one can use the Grid > Convert Grid Cells menu option to change an unstructured triangular simplex grid into quadrilateral one. On the Matlab and Octave command lines one can also use the tri2quad, gridgen_quad, and grid primitive functions such as rectgrid, circgrid etc. to generate quadrilateral grids. Alternatively, one can also import a premade external quadrilateral grid in any of the import format that are supported in FEATool, such as for example from GiD and Gmsh.
In contrast to most CFD and physics simulation codes it is in FeatFlow desirable to start with a very coarse grid. FeatFlow will then internally uniformly refine this grid a prescribed number of times to generate the multigrid level hierarchies, and also adapt boundaries to the geometric boundary parametrization. In this way one can achieve optimal conditions for the geometric multigrid solver. This also means that the output from FeatFlow will correspond to a much finer grid and have a higher quality solution.
FeatFlow can be used instead of the usual solve button =
to call the external FeatFlow solver for NavierStokes physics mode models. The FeatFlow solver control panel can be accessed in Solve Mode of the FEATool GUI by pressing the button labeled FeatFlow.
The FeatFlow solver dialog box allows one to first Export the current grid and model definition to FeatFlow data files. The Solve option calls the FeatFlow CC2D solver using the exported data. Import finally reads a computed FeatFlow solution and imports it into the FEATool GUI (refining the initial grid as necessary determined by the FeatFlow Grid refinement level setting).
The FeatFlow solver settings are described as follows
The featflow function can also be used on the command line as follows:
FEA = FEATFLOW( FEA, VARARGIN ) Export, solves, or imports the solved problem described in the FEA finite element struct using the FeatFlow CFD solver. Accepts the following property/value pairs
Input Value/{Default} Description    mode export/solve/import Command mode to call data default Default solver parameters solve '' FeatFlow solver to use fdir featflow Processing directory fname ft2ff FeatFlow output filename wbash C:\Windows\System32\bash.exe Windows bash path Input Value/{Default} Description
The following limitations apply to the FeatFlow solver.
The FeatFlow solvers cc2d and cc3d included with FEATool are capable of performing large scale simulations. Although technically possible, for memory and stability reasons it is not advised to do this from within Matlab or Octave. For large scale simulations then it is instead recommended to manually launch the FeatFlow cc2d / cc3d binaries from the system command line. To do this first make sure the proper FeatFlow data and grid files have been exported. The data files cc2d.dat / cc3d.dat, bdry.dat, and expr.dat should be located in the featool/featflow/data subdirectory, and the grid files ft2ff.tri / ft2ff.prm in the featool/featflow/adc directory. The ccXd binaries can then simply be launched as, for example
cc2d
Convergence output will be printed to the terminal screen as well as mirrored in the log file featflow/data/ff.out. As memory FeatFlow is statically allocated, four different binaries may be supplied for each solver with a postfix 1 through 4. If the grid and memory requirements are too large for one binary one can try using the one with a higher number. Result output files can be found in the featool/featflow/output subdirectory for the pressure, velocities, cell centers, and cell edge/face midpoints. Moreover, the ascii input data files can be tuned accordingly to provide for example binary, GMV, and AVS output data (see the FeatFlow documentation for a full explanation of the solver input parameters).
An example of setting up and solving a flow over a backwards facing step problem using the FeatFlow external solver is given in the tutorial section Fluid Dynamics  Flow Over a Backwards Facing Step.
[1] S. Turek, C. Becker, FeatFlow, Finite element software for the incompressible NavierStokes equations, User Manual, Release 1.1, Heidelberg, 1998.
[2] S. Turek, Efficient Solvers for Incompressible Flow Problems: An Algorithmic and Computational Approach, Series: Lecture Notes in Computational Science and Engineering ,Volume 6, SpringerVerlag, 1999.
[3] E. Bayraktar, O. Mierka, S. Turek, Benchmark Computations of 3D Laminar Flow Around a Cylinder with CFX, OpenFOAM and FeatFlow, International Journal of Computational Science and Engineering, 7, 3, 253266, 2012.