How to start developing own modules with Elmer

Discussion about coding and new developments

How to start developing own modules with Elmer

Postby raback » 12 Apr 2013, 13:50

Hi All

I thought that I would write a few words for those who are interested in developing or modifying their own modules in Elmer. There is some new material that might help in the process.

A presentation on how the software development practices around Elmer may be found at: ... 3April.pdf

The is also really nice "ModelPDE" case that is among the tests in ... /ModelPDE/

This is a really nice model problem for transient/steady advection-diffusion-reaction problem that may be tailored by the users to fit their needs. It even includes bubble stabilization and runs serial and parallel and nodal/p-elements etc. Still it is just ~170 lines of code. The Elmer dialect has evelved over the years and it may be a good idea to avoid the older legacy solvers if starting to write own code and utilize the current practices that result to much more economical code.

The ModelPDE It is nicely documented in Ch 6. of Programmers Tutorial in: ... torial.pdf

Hope these pointers help those wanting to dwell deeper into Elmer world.

Site Admin
Posts: 3146
Joined: 22 Aug 2009, 11:57
Location: Espoo, Finland

Re: How to start developing own modules with Elmer

Postby Franz Pichler » 23 Apr 2013, 14:46

NIce Work!
wish i had that a year ago ;)
best regards
Franz Pichler
Posts: 196
Joined: 29 Sep 2011, 12:25

Re: How to start developing own modules with Elmer

Postby sebastien ROUQUETTE » 23 Apr 2013, 18:54

Right in time for me...
Rouquette Sébastien
University of Montpellier / Mechanical and Civil Engineering Lab. / Welding Group
sebastien ROUQUETTE
Posts: 90
Joined: 05 Nov 2011, 16:50
Location: Nimes, France

Re: How to start developing own modules with Elmer

Postby gschrank » 22 Oct 2016, 23:44

Good afternoon. I'm hoping to piggyback off of this post and try to get some guidance as I dive into developing my own module. I'm relatively new to Elmer (worked with it for about a year) and to Fortran. My previous experience with FEM was with COMSOL, so I didn't have to think about the nuts and bolts of the computation.

I'm working on developing a module for my niche application of polarized gas. I think I've properly expressed the weak form of the PDE. I've used ModelPDE as a template for my module, and I've started editing the code for the mass and stiffness matrix generally. However, I've run into the difficulty of linearizing the problem. The Elmer Programers' Tutorial excludes the linearization step for simplicity, but it is something I kind of need to know how to do to properly code my PDE.

I think I understand the two methods that Elmer uses standard, Picard and Newton. What I don't know or can't readily find is if there is a prewritten function call to implement either of these methods or to implement the hybrid method. Is there something in DefUtils or elsewhere I can use to easily integrate this step into the module? Is this something I need to hardcode in the module? Are their coding standards in place for the linearization step.

Thanks in advance... and if this question needs it's own thread, please let me know.
Posts: 6
Joined: 21 Aug 2016, 05:40

Return to Software development

Who is online

Users browsing this forum: No registered users and 1 guest