next up previous contents index
Next: List of reserved words Up: The Gory Details Previous: The Gory Details   Contents   Index


Programs

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

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 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);



Debian Alpha Buildd 2001-10-21