⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 poisson.edp

📁 FreeFem++可以生成高质量的有限元网格。可以用于流体力学
💻 EDP
字号:
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 uex=   4*x+  5*y+6*z;func uey=   6*y + 5*x;func uez=   8*z +6*x;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;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) + 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;plot(u,wait=1);Vh d= ue-u;cout <<  " err = " << err <<  " diff l^\intfy = " << d[].linfty << endl;Vh2 u2=u,u2e=ue;plot(u2,wait=1);plot(u2,u2e,wait=1);// test new plot ... plot(Th,wait=1);plot(u,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;     }*/  assert(err < 1e-9);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -