# Elmer for PDEs

A user forum, wiki and other resources are available at http://www.elmerfem.org, and a very good tutorial is available from the main Elmer Web site. Along with the tutorial documentation, sample files are available for each of the cases. Those files can be great starting points for your own calculations and help you as you are learning the system. As an example, let's look at the sample "Computation of fringe capacitance". Once you have downloaded the sample files and unpacked them, you can load the project with File→Load Project... from the menu. Once it is loaded, all the input data also is loaded. A project is simply a directory containing all the files required to do a computation. The actual mesh is defined by the files mesh.header, mesh.nodes, mesh.elements and mesh.boundary. The current settings and state are stored in the file egproject.xml. There also is a solver input file called case.sif that is handed in to ElmerSolver when you actually are ready to do your calculations. You can edit this file via Sif→Edit... (Figure 3).

Figure 3. Solver Input File

You can edit the model details (like physical constants) via Model→Setup.... When you are ready to run your calculation, you can use Run→Start Solver. This opens a log window and shows its progress. A convergence monitor shows how quickly Elmer converges on the results (Figure 4).

Figure 4. Convergence Monitor

This creates a new file named case.ep in your project directory containing the results of your calculation. You can view it using either Run→Start Postprocessor or Run→Postprocessor (VTK)... (Figure 5).

Figure 5. Viewing the Results

As you can see, several tools are available to help you visualize the results of your calculation.

Now that you have seen a basic example of running one of the tutorials, what else can Elmer do for you? The solver can handle solving linear systems. It can do this by using direct methods, through the LAPACK library, for example. You can use a set of Krylov subspace methods to do iterative solutions. In order to get rapid convergence though, you usually need to use some form of preconditioning. A class of iterative methods called multilevel methods are used for large linear systems. Elmer provides two options: geometric multigrid and algebraic multigrid.

More complex, and hence more physically accurate, problems tend to be nonlinear. This nonlinearity may be as simple as what you see in the full equation for pendulum motion to the Navier-Stokes equations for fluid flow to the equations of General Relativity. Elmer deals with nonlinear systems by first linearizing the equations at each iteration step. How the equations are linearized depends on exactly which solver method is being used. For example, the Navier-Stokes solver can use either the Picard linearization or the Newton linearization.

There are methods for solving time-dependent systems. First-order time derivatives can be discretized using either the Crank-Nicolson method or the Backward Differences Formulae. You also can solve eigenvalue problems with Elmer. These tend to crop up in structural analysis problems, including factors like elasticity and damping.

For really large problems, you likely will want to look into running your computation in parallel. Elmer uses MPI as the parallelization technique, along with domain decomposition as the method of dividing up the work. The first step is to take the mesh and subdivide it into chunks or partitions, which, depending on the actual calculation to perform, will divide the load evenly across all the CPUs. These chunks then are sent out to individual CPUs, and the calculation is done. At the end of the run, the results are combined back into a single result. Because of the work involved in partitioning and so forth, most users likely will take advantage of ElmerGUI's parallelization tool.

The last of Elmer's selling points is its modular nature. The solver is written in FORTRAN 90. This means if you want to add your own user functions or a complete solver, it is simply a matter of writing a FORTRAN module and including it in Elmer. The main Elmer site provides good documentation covering the steps involved.

Hopefully, this introduction has given you some ideas of what you can do with Elmer. If you are studying multiphysics problems, Elmer probably is a very good tool to learn. It also might be a good tool to introduce in a numerical physics course, because you can model so much. If you do end up using it in your research or studies, I would love to hear about it.

Joey Bernard has a background in both physics and computer science. This serves him well in his day job as a computational research consultant at the University of New Brunswick. He also teaches computational physics and parallel programming.

Tools and Technologies for Scale and Reliability

by Linux Journal Editor Bill Childers

Sponsored by IBM

Scheduling Crontabs With an Enterprise Scheduler

11am CDT, April 29th

Moderated by *Linux Journal* Contributor Mike Diehl

Sponsored by Skybot

## Trending Topics

## Webinar: 8 Signs You’re Beyond Cron

*Scheduling Crontabs With an Enterprise Scheduler*

11am CDT, April 29th

Join *Linux Journal* and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.

Play for Me, Jarvis | Apr 16, 2015 |

Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites | Apr 15, 2015 |

Non-Linux FOSS: .NET? | Apr 13, 2015 |

JavaScript All the Way Down | Apr 09, 2015 |

Designing Foils with XFLR5 | Apr 08, 2015 |

diff -u: What's New in Kernel Development | Apr 07, 2015 |

- Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites
- Play for Me, Jarvis
- Non-Linux FOSS: .NET?
- JavaScript All the Way Down
- Designing Foils with XFLR5
- Not So Dynamic Updates
- Flexible Access Control with Squid Proxy
- New Products
- New GeekGuide: Beyond Cron
- Users, Permissions and Multitenant Sites

## Comments

## I think that this formula can

I think that this formula can be really useful for many of us and I am sure that this will come in the help of the people.

Implant Dentar

## Very simple PDEs have exact

Very simple PDEs have exact solutions, but anything more complex that describes more physical situation just can't be solved exactly. This is where numerical slab come into play.

Ncr Paper || Form Printing || Ncr Forms

## Elmer is a great piece of

Elmer is a great piece of software, but you need to be careful.

For all but the most trivial problems, (like heat transfer), you will need to play around with the values in the .sif file. The UI does not have the capabilities to do things like mesh building (you will need to use gmsh, or something), much in the way of mesh editing, and sometimes (in complex situations) even assigning boundary conditions in the UI can be tricky.

The documentation is quite extensive and the help from the elmer devs is excellent.

The package is considerably more flexible (though also considerably less UI user friendly) than ANSYS' (very expensive) offering.