File: medit.edp

package info (click to toggle)
freefem%2B%2B 3.47%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 132,088 kB
  • ctags: 19,726
  • sloc: cpp: 138,951; ansic: 22,605; sh: 4,951; makefile: 2,935; fortran: 1,147; perl: 768; awk: 282; php: 182
file content (32 lines) | stat: -rw-r--r-- 732 bytes parent folder | download | duplicates (3)
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
31
32
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;
// old code ::
if(1)
{
   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 	
    if(!NoGraphicWindow) exec("ffmedit mm");
    // clean files
    exec("rm mm.bb mm.faces mm.points");
}
else 
{
// new code 
load "medit" load "msh3"  
    mesh3 Th3= movemesh23(Th,transfo=[x,y,u*0.5]);
    medit("mm",Th3);// bug un color of u ... FH 
}

// FFCS: testing 3D plots
plot(u);