The Future of Elmer: Solving the Grand Challenges in Mathematical Modeling

By Juha Haataja

Version 1.1 / June 29, 2004 (updated with GiD info) Version 1.11 / December 1, 2005 (small details corrected)

What is Elmer?

Elmer 3.0 is a computational tool for multi-physics problems. Elmer includes physical models of fluid dynamics, structural mechanics, electromagnetics and heat transfer. These are described by partial differential equations which Elmer solves by the Finite Element Method (FEM).

Here are two screen captures of Elmer 3.0 on Mac OS X:

The software is available for download also for the Mac OS X platform (in addition to Linux and Windows). The software is available free of charge to academic users by filling in the registration form.

The requirements for installing Elmer on Mac OS X are as follows: system version 10.3 or newer, including the X11 package (an optional install).

Elmer has been developed in collaboration with Finnish universities, research laboratories and industry. Here are examples of things which you can solve with Elmer:

Elmer is not a substitute for Matlab or Mathematica. However, Elmer can solve hard multiphysical problems which these other tools cannot.

The Elmer software is targeted to the professional who knows mathematical modeling and numerical methods. It is not suitable for a novice, at least without the guidance of an experienced colleague.

The user interface is not polished at all. In fact it looks ugly. But beneath the surface there are state-of-the-art numerical algorithms for FEM-based modeling and for solving those models. In all, Elmer contains about 300 000 lines of code: Fortran 90/95, C++, C, and Tcl/Tk.

Recently, Elmer has been boosted to include discontinuous Galerkin elements, automatic mesh refinement, and block preconditioners. In a few areas Elmer has no competitors, and with these new techniques the system can solve large real-life problems even on desktop systems.

In this document I'm writing about using Elmer on Mac OS X, and how Elmer was ported to Mac OS X. Finally, I'll shortly discuss the future of Elmer. Perhaps you could help?

Update: In September 2005, Elmer was released under the GPL open source license.

Why I'm thinking about the future of Elmer

First I should say that I'm not a neutral party as regards Elmer. In September 2003 I took responsibility for leading the group which has been developing Elmer for over ten years. So, I am not a developer of the system, but I do have a strong interest in making Elmer a success story.

Update: In December, 2004 is changed my position to Director of Science support at CSC, so I'm no longer managing the groups which develop Elmer at CSC.

This spring there will be a new manual for the ElmerSolver component, and the existing manuals will be updated. In addition, the developers have plans to go Open Source with the Solver component of Elmer during 2004.

Most of the software development effort (perhaps 90%) has been dedicated to the ElmerSolver component, plus solving numerous real-life applications.

Currently the weakest part of Elmer is the graphical ElmerFront component, which is used for defining the geometry, physical properties, and the mathematical equations. Developing a graphical interface for 3D modeling and grid-generation is a huge task, outside our current resources. The current interface is a starting point on Elmer, but lacks features for complex industrial modeling.

Currently we are searching for portable software which could replace or complement the existing graphical interface. This front-end software should be priced reasonably, and be made available for free to academic users. This is a difficult set of requirements.

So far Elmer has mainly been used for consulting services in multi-physical problems. By going open source we hope to add yet additional functionality to the modeling capabilities of the system.

Porting Elmer to Mac OS X

Previously only Linux and Windows versions were available. But it took only two days to port the code to Mac OS X 10.3.

The porting of the code was done on my PowerBook G4 while I was using it. The software developers logged in via ssh, transferred the source code, compiled, fixed problems, and did the test runs. (All tests seem to have passed.)

The funny thing is --- I didn't much note when the developers did their work. The PowerBook was as fast as it usually is. Once in a while I checked with top to see if the developers were actually doing something on the system. And then I was told that the port of Elmer was complete, including the X11-based graphical interface. Suprise!

The future of Elmer

We are a bit unhappy with the current interface of Elmer. In fact, we would like to switch to a completely new graphical interface.

The current interface is a bit difficult to modify. The current ElmerFront system lacks features which would make it easy to model realistic geometries in industrial problems. Currently the geometry description files are ofter written by hand (painfully), or imported from other software packages.

Many of our current users generate a simple model description file with ElmerFront, and then edit the file to suit their purposes. Or they start from the large collection of tutorial files, and thus bypass the ElmerFront component completely.

But how to proceed? We plan to search for an academic (?) partner with a software module or an application for geometry modeling and grid generation. Then we could plug in the "engine" of Elmer, and make it easier for novice users to start solving demanding multi-physical problems.

The real value of Elmer is in the flexible and powerful ElmerSolver component (the "engine"). You can dynamically load new multiphysics modules as needed in the computations. And with the promised Open Source version, you could modify the engine however you wanted.

For example, we are currently starting a project to provide tools for modelers in microfluidics research. These models could be used to design lab-on-a-chip systems, measurement devices in health care, liquid cooling on portable devices, microrockets, etc.

So, please have a look at Elmer, and tell us of your experiences. And if you want to contribute or collaborate, please contact us to discuss how we could make Elmer serve your needs and requirements.

Update: You can now use the GiD preprocessor with Elmer to solve multiphysical models. You can model 2d and 3d geometry with GiD, and use Elmer to solve multiphysical models.

GiD looks like this on Mac OS X:

The necessary template files for GiD are available at the Elmer web site. Both GiD and Elmer are available for Windows, Linux, and Mac OS X.

Learning to use Elmer

The tutorial is a nice place to start with Elmer, because it has lots of examples from different areas. Here is a screen capture of solving the first tutorial problem using the finite element methods (FEM):

This illustrates a temperature distribution problem. You can also use the boundary element method (BEM) to solve a similar problem. Here are the results from solving the second tutorial problem:

Elmer can solve also radiation heat transfer problems. In the following the solution is iterative. The first step is to solve the view and Gebhardt factors. After this the nonlinear heat equation is solved repeatedly until convergence. Here are the results:

Next we model a loaded elastic beam. Here are the results when a linear or a nonlinear model is used (load value -5.0e8 N/m2):

The FEM grid is shown at the bottom. The linear model is shown on the left and the nonlinear on the right. The nonlinear model describes the situation much better.

The following picture shows Elmer solving a problem of (small) deflection of plates. (Theory of Reissner and Mindlin.) The case depicts an L-shaped steel plate under pressure. The displacements are exaggerated 50 times.

Inside the ElmerPost visualization tool there is a matrix-language which makes it possible to process the result data like with Matlab. This is how the picture of displacements was generated:

math tmp = size(Deflection.1); 
math n = tmp(1); 

math nodes(2,0:n-1) = 50*Deflection.1;

math Rotation=0; math Rotation(0,0:n-1) = Deflection.2; math Rotation(1,0:n-1) = Deflection.3; math Rotation(2,0:n-1) = Deflection.2*0;

math AbsRotation = sqrt( vdot(Rotation,Rotation) );

display;

Next we move to the example number six of the tutorial. This is a classic problem. We are modeling incompressible flow passing a step. The model is solver both with linear triangles and 2nd order rectangles. The meaning of the windows is (from bottom to top): triangle mesh, solution with triangles, and solution with rectangles.

Next we calculate the stream lines of the flow. Here are the results, from top to bottom: pressure, absolute velocity, and streamlines.

To solve this problem I compiled the Fortran 90 code of the tutorial for solving the stream function. The solution consists of first solving the Navier-Stokes equations, and then solving the equations for the stream function.

Elmer can be used to model acoustic waves. As an example, the Helmholtz equation can be used to model lossless acoustic waves. This is example number eight of the Elmer tutorial. The following picture shows a solution for the model:

What about dissipative acoustics? Below you find an animation (in QuickTime format) of the solution to the tutorial example 9. The model describes propagation of sound waves in a circular tube:

The Elmer animation was captured using Snapz Pro 2.0. Also, GraphicConverter can generate an animation from pictures saved from ElmerPost. An animation can be generated with the following kind of commands in ElmerPost:

do i 100 301 {math s=2*pi*($i-100)/200; 
  math p=cos(s)*Flow.7-sin(s)*Flow.8; 
  display; screensave t$i.ppm;}
Here we generate 201 pictures into files t100.ppm ... t301.ppm. I re-generated the movie with GraphicConverter, using the highest quality and 24 pictures per second (see here).

Next, we use the Poisson equation to model electric potential, and use Elmer to solve the model. This is case number 10 of the tutorial. The result is shown below using isosurfaces for displaying the potential and color to show the electric field magnitude: