/usr/share/doc/freefem++/examples/examples++-3d/sphere6.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 21 22 23 24 25 26 27 28 29 30 | load "msh3"
load "medit"
real sqrt2=sqrt(2.);
real onesqrt2=sqrt2/2.;
mesh TS= square(10,10);
TS=adaptmesh(TS,sqrt(1+x*x+y*y),err=0.003,periodic=[[4,y],[1,x],[2,y],[3,x]]);
TS=adaptmesh(TS,sqrt(1+x*x+y*y),err=0.003,periodic=[[4,y],[1,x],[2,y],[3,x]]);
TS=TS+movemesh(TS,[-x,y])+movemesh(TS,[x,-y])+movemesh(TS,[-x,-y]);// build symetrique mesh
plot(TS,wait=1);
int orientation=1;
func f = 1;
int[int] ref=[0,1];
mesh3 Thx0 = movemesh23(TS,transfo=[-f,x,y],orientation=-orientation,label=ref);
mesh3 Thx1 = movemesh23(TS,transfo=[+f,x,y],orientation=+orientation,label=ref);
mesh3 Thy0 = movemesh23(TS,transfo=[x,-f,y],orientation=+orientation,label=ref);
mesh3 Thy1 = movemesh23(TS,transfo=[x,+f,y],orientation=-orientation,label=ref);
mesh3 Thz0 = movemesh23(TS,transfo=[x,y,-f],orientation=-orientation,label=ref);
mesh3 Thz1 = movemesh23(TS,transfo=[x,y,+f],orientation=+orientation,label=ref);
mesh3 Tcube= Thx0+Thx1+Thy0+Thy1+Thz0+Thz1;
savemesh(Tcube,"T.mesh");
exec("ffmedit T.mesh");
plot(Tcube,wait=1);
func R = sqrt(x*x+y*y+z*z);
mesh3 Th = movemesh3(Tcube,transfo=[x/R,y/R,z/R]);
plot(Th,wait=1);
savemesh(Th,"T.mesh");
exec("ffmedit T.mesh");
// medit("Th Sphere ",Th);
|