p.edp
来自「FreeFem++可以生成高质量的有限元网格。可以用于流体力学」· EDP 代码 · 共 37 行
EDP
37 行
verbosity=2;mesh3 Th("dodecaedre01");fespace Vh(Th,P23d);func ue = 2*x*x + 3*y*y + 4*z*z + 5*x*y+6*x*z+1;func f= -18. ;//Vh uhe = ue; // bug ..//cout << " uhe min: " << uhe[]. min << " max:" << uhe[].max << endl;/*border cc(t=0,2*pi){x=cos(t);y=sin(t);label=1;}mesh Th2=buildmesh(cc(50));fespace Vh2(Th2,P2);Vh u,v;//uhe = ue;macro Grad3(u) [dx(u),dy(u),dz(u)] // EOMproblem Lap3d(u,v,solver=CG)=int3d(Th)(Grad3(v)' *Grad3(u)) - int3d(Th)(f*v) + - int3d(Th)(f*v) + on(0,1,u=ue);Lap3d;cout << " u min:: " << u[]. min << " max: " << u[].max << endl;real err= int3d(Th)( square(u-ue) );cout << int3d(Th)(1.) << " = " << Th.mesure << endl;Vh d= ue-u;cout << " err = " << err << " diff l^\intfy = " << d[].linfty << endl;Vh2 u2=u;plot(u2,wait=1);plot(u2,wait=1); { ofstream file("dd.bb"); file << "3 1 1 "<< u[].n << " 2 \n"; int j; for (j=0;j<u[].n ; j++) file << d[][j] << endl; } */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?