Lesson 3: Using an iterative solver

We consider the same example as in Lesson 2 with the following modifications:

The Finite Element Code

The main program

Here is a description of the source code. The source file can be found in Example 3 in the examples directory.

How to declare a material ?

This is very simple: in the mesh data file, all elements have, in the present example, the code 1. If we say nothing, then a generic material (precisely called GenericMaterial with default properties is used. Otherwise, we can assign, in the mesh file a material, here Aluminium to this code, by the line

   Material  1  Aluminium

This line must be given after all elements lines. Note that the file Aluminium.md must be present in the material's directory. We are now ready to test the package.

A test

We use here a finer mesh than in Lesson 2 except the line defining the material. We obtain the same solution as Lesson 2 after 15 iterations.

Copyright © 1998-2016 Rachid Touzani