load "qf11to25"
load "Element_QF"
{
mesh Th=square(5,5,flags=2);
//Th=trunc(Th, x <0.5);
plot(Th,wait=1);
mesh Thf=square(10,10);
fespace QFh(Th,FEQF5);
fespace Ph(Thf,P0);
func ff = (x+1)^2*(y-2)^3;
QFh ffh=ff;
Ph ffp=ffh;
plot(ffp,wait=1,fill=1); 
QFh xh=x;
QFh yh=y;
if(verbosity>9)
{
cout << " xh = " << xh[] << endl;
cout << " yh = " << yh[] << endl;
}
cout << int2d(Th)(x) << " ==  " << int2d(Th)(xh) << endl; 
cout << int2d(Th)(y) << " == " << int2d(Th)(yh) << endl; 
cout << int2d(Th)(ff) << " == " << int2d(Th)(ffh) << endl; 
//dumptable(cout);
FiniteElement2d EFQF(qf23pT);
fespace Zh(Th,EFQF);
Zh zz=x+y;
plot(zz,fill=1,wait=1,cmm="zz");
}
{
mesh3 Th=cube(2,2,2);
//Th=trunc(Th, x <0.5);
plot(Th,wait=1);
mesh3 Thf=cube(10,10,10);
fespace QFh(Th,FEQF53d);
fespace Ph(Thf,P0);
func ff = (x+1)^2*(y-2)^3*(z+2)^1.5;
QFh ffh=ff;
Ph ffp=ffh;
plot(ffp,wait=1,fill=1); 
QFh xh=x;
QFh yh=y;
QFh zh=z;
if(verbosity>9)
{
cout << " xh = " << xh[] << endl;
cout << " yh = " << yh[] << endl;
cout << " yh = " << yh[] << endl;
}
cout << int3d(Th)(x) << " ==  " << int3d(Th)(xh) << endl; 
cout << int3d(Th)(y) << " == " << int3d(Th)(yh) << endl; 
cout << int3d(Th)(z) << " == " << int3d(Th)(zh) << endl; 
cout << int3d(Th)(ff) << " == " << int3d(Th)(ffh) << endl; 
FiniteElement3d EFQF3(qfVp14);
fespace Zh(Th,EFQF3);
fespace Zh2(Th,[EFQF3,EFQF3]);

}
;
