File: saverestore.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 (31 lines) | stat: -rw-r--r-- 721 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
// bug  save - restore P2 
verbosity=3;
int nn=2;
mesh Th=square(nn,nn);
savemesh(Th,"Th.msh");
func f=x+y+0.1234567890e-5;
fespace Vh(Th,P2);
Vh u=f;
{ofstream f("u.txt");
  f.precision; 
 cout << " f.precision() = " << f.precision() << endl;
 f.precision(12);
 cout << " f.precision() = " << f.precision() << endl;

f <<u[];
}
real regtest;//FFCS regression test value
{
mesh Th=readmesh("Th.msh"); // il y a un changement de numerotation des traingle ou??
// mesh Th("Th.msh"); // oK ..
savemesh(Th,"Th1.msh");
fespace VVh(Th,P2);
VVh u=f,v,e;
ifstream f("u.txt");
f >> v[] ;
e[] = u[] -v[];
cout << e[].max << " " << e[].min << endl;
plot(e,wait=1,value=1);
assert(e[].max-e[].min < 1e-6);
regtest=e[].max-e[].min;
}