/usr/share/doc/freefem++/examples/examples++-tutorial/medit.edp is in freefem++-doc 3.19.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | int n=20,nn=n+10;
real[int] xx(nn),yy(nn);
// build square $]-1,1[^2$
mesh Th=square(10,10,[2*x-1,2*y-1]);
fespace Vh(Th,P1);
Vh u=2-x*x-y*y;
savemesh(Th,"mm",[x,y,u*.5]); // save mm.points and mm.faces file for medit
// build a mm.bb file
{ ofstream file("mm.bb");
file << "2 1 1 "<< u[].n << " 2 \n";
int j;
for (j=0;j<u[].n ; j++)
file << u[][j] << endl;
}
// call ffmedit command
exec("ffmedit mm");
// clean files
exec("rm mm.bb mm.faces mm.points");
|