next up previous contents
Next: Triangulation file Up: LESSON on freefem and Previous: Problem statement

An example with freefem

We shall define f and the triangulation of its domain of definition by writing a small program which will be stored in a file called "trace.pde":

/* file trace.pde */
n:=50;
border(1,0,2*pi,n) begin
   x := cos(t);
   y := sin(t);
end;
buildmesh(1000);
savemesh('trace.msh');

f = x * y;
plot(f);
save('trace.dta',f);

This text follows the Gfem syntax. It defines a border with reference number 1 by a parametric representation where the parameter t goes from 0 to 2pi and has n=50 vertices on it.

The mesh generator implements a Delaunay-Voronoi algorithm and has a maximum vertex number security features so as to avoid over flow. Here it will stop if it ever generates more than a 1000 vertices.`

Then the triangulation is stored in a file called "trace.msh" for future use. The format will be described below.

The function his then defined and its values at the vertices are stored in a file called "trace.dta". Its format

- number of values (vertices)

- value of f on each vertex.


remarque318
Beware that older version of freefem may have two values of f on each line; an old reminder that f could be complex valued and so the second value was the complex component.


exer324

  
Figure: Results



Pironneau Olivier
Jeudi 12 mars 1998 16:06:41