Developer Training




A good opportunity to get up to speed with your Diffpack development is to attend one of our scheduled training courses in Nürnberg, Germany, or local arrangements in your region. All courses will be lectured either in English or in German.

The course extends over a total of 4 days and is split in two main parts:

Depending on your background you might want to skip Part I. It is possible to prepare yourself for Part II by reading Chapter 1 of the course book.

The course is suitable for beginners as well as more experienced Diffpack programmers. It should be ideal if you are in the process of evaluating Diffpack. Confer the course program to see what you will learn.

If the courses do not suit you, we can offer training at your own office location. With this solution we can adjust the training to your requirements and even bring your own applications into the discussion. Please contact us at for details.


Practical Information

As a special service we will organize accommodation for the course attendees at a hotel in Nürnberg. We will then take care of booking etc., while you pay for the hotel at departure. Of course, you are free to choose other arrangements at your preference.

Depending on interest, we will also arrange a dinner for the attendees one of the evenings.


Course Program

The course gives an introduction to Diffpack programming, with main emphasis on developing simulators for the numerical solution of partial differential equations. The topics of the course are based on the book:

H. P. Langtangen: Computational Partial Differential Equations - Numerical Methods and Diffpack Programming.

Lecture Notes in Computational Science and Engineering, Springer-Verlag, 1999

The course consists of a number of modules, where each module contains a lecture (typically 1-3 hours) followed by computer exercises (typically 1-3 hours) under the supervision of the course leader. The overall goal is to provide conceptual insight in Diffpack paired with practical skills in bringing these concepts to life. At the end of the course you should understand how advanced full-size industrial simulators can be coded by simply combining basic building blocks in Diffpack, and thus have build a firm platform for developing advanced Diffpack simulators for your own area of interest.

Suitable background for the course is familiarity with the finite difference method (for Part I) and finite element method (for Part II) for solving linear and nonlinear partial differential equations (Chapters 1, 2 and 4.1 in the book). It is not necessary to have much experience with C++, although it it is assumed that you have good experience with programming in general.

You should be prepared for 3-4 days of hard work. Each day will consist of two main sessions, 0900-1200 and 1300-1800, separated by lunch and shorter breaks. The last day will finish at 1600.



1: The first Diffpack encounter

2h lecture and 1h exercise

Connecting yourself to Diffpack, "Hello World!" programs, a 1D heat conduction problem, a 1D wave equation, curve plotting. Ch. 1.1, 1.2.2-1.2.5, 1.3.2-1.3.4, Appendix B.2.1. Type a "Hello World!" program.
Exercise 1.4.
2: Intro to C++ programming

1h lecture and 1h exercise

Dissection of a simple C++ class (MyVector) for representing vectors; constructors, inline functions, overloaded operators, the const concept, the C/C++ preprocessor, arguments passed by value and reference. Ch. 1.5.2. Exercises 1.9-1.11.
3: Intro to object-oriented programming (OOP)

2h lecture and 1h exercise

Motivation for the object concept, outline of C++ classes, inheritance, virtual functions. Examples: programming with various matrix formats, designing an ODE solver environment, grid and field abstractions, a PDE solver coded as a class. Ch. 1.5.1, 1.5.3-1.5.5, 1.6.1. Exercise 1.17.
4: Intro to finite element programming

2h lecture and 1h exercise

A very simple Poisson equation solver in 2D (class Poisson0); explanation of each function. Ch. 3.1. Extend class Poisson0 to a 2D convection-diffusion (CD) solver (with constant velocity), u=0 on the boundary and a constant source term.
5: Visualization support and the Diffpack menu system

2h lecture and 1h exercise

Recoding class Poisson0 with more flexibility: class Poisson1. Operating and coding with the menu system, "space-dimension-independent" code, storage of fields, visualization of fields. Ch. 3.2-3.4. Repeat the previous exercise with class Poisson1 (put the velocity components on the menu). Visualize the solution field in Plotmtv, Vtk, Matlab etc.
6: Finite element programming tools

1h lecture and 2h exercise

Representing boundary condition information, line/surface integrals, simple mesh generation tools, debugging, automatic report generation, using OOP to extend or specialize a simulator. Ch. 3.5. Repeat the previous exercise, but implement the solver as a subclass of ReportPoisson2. Generate a non-trivial geometry, introduce an "outflow" boundary with Neumann conditions, and visualize the simulation results.
7: Time-dependent finite element problems

1h lecture and 2h exercise

Heat equation solvers as a minor extension of the Poisson equation solvers, class TimePrm for time data, visualization of time-dependent data. Ch. 3.9-3.10. Exercise 3.11.
8: A fast wave equation solver

1h lecture and 1h exercise

Increasing the efficiency by precomputing components of the linear system, application to a 1D/2D/3D wave equation in general geometries, the field concept, restarting simulations. Ch. 3.11. Exercise 3.14-3.15.
9: Nonlinear problems

1h lecture

A nonlinear heat equation as a simple extension of a linear heat equation, successive substitutions and Newton-Raphson iteration. Ch. 4.2.  
10: A solver for 2D/3D thermo-elasticity

1h lecture

Definition of the PDEs in the linear thermo-elasticity problem, finite element discretization, implementation of a vector equation in Diffpack, computation of derivatives (stresses). Ch. 5.1.  
11: Solving systems of PDEs by assembling independent solvers

2h lecture and 2h exercise

If a system of PDEs can be solved by a sequential approach, Diffpack offers tools for combining existing solvers (e.g. Poisson eq. solvers, convection-diffusion solvers, elasticity solvers etc.) to build a solver for the system without modifying the original codes. Ch. 7. Coupling of thermo-elasticity and transient heat conduction.
12: Advanced Diffpack Toolboxes

1h lecture

Overview of the Adaptivity Toolbox, plus the upcoming Multigrid Toolbox, Domain Decomposition Toolbox and the parallel-Diffpack Toolbox. Each of these toolboxes can be incorporated in existing solvers by about 10 lines of extra code.  
13: Two finite element Navier-Stokes solvers

1h lecture

An implicit Navier-Stokes solver based on the penalty method and an efficient explicit solver based on velocity correction. Ch. 6.3 and 6.5.  
14: Tools for representing and solving sparse linear systems

1h lecture

Overview of vector and matrix storage formats, abstractions for linear systems, preconditioners, and linear solvers. Examples on the use of these abstractions in finite difference solvers for the Poisson equation. Appendix D.