Gfem is a small language which generally follows the syntax of the language Pascal. See the list below for the reserved words of this language.
The reserved word begin can be replaced by { and end by }.
C programmers: caution the syntax is "...};" while most C constructs use " ...;}"
Example 1: Triangulates a circle and plot f = x*y
border(1,0,6.28,20) begin x:=cos(t); y:=sin(t); end; buildmesh(200); f=x*y; plot(f);
Example 2: on the circle solve the Dirichlet problem
- with u=0 on
border(1,0,6.28,20) begin x:=cos(t); y:=sin(t); end; buildmesh(200); solve(u) begin onbdy(1) u =0; pde(u) -laplace(u) = x*y ; end; plot(u);