File: EqPoisson.edp

package info (click to toggle)
freefem%2B%2B 3.61.1%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,108 kB
  • sloc: cpp: 141,214; ansic: 28,664; sh: 4,925; makefile: 3,142; fortran: 1,171; perl: 844; awk: 290; php: 199; pascal: 41; f90: 32
file content (21 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
load "msh3" load "medit"
func f=2*((0.1+(((x/3))*(x-1)*(x-1)/1+x/100))^(1/3.)-(0.1)^(1/3.));
real yf=f(1.2,0); 
border up(t=1.2,0.){ x=t;y=f;label=0;}
border axe2(t=0.2,1.15) { x=t;y=0;label=0;}
border hole(t=pi,0) { x= 0.15 + 0.05*cos(t);y= 0.05*sin(t); label=1;}
border axe1(t=0,0.1) { x=t;y=0;label=0;}
border queue(t=0,1) { x= 1.15 + 0.05*t; y = yf*t; label =0;}
int np= 100;
func bord= up(np)+axe1(np/10)+hole(np/10)+axe2(8*np/10)+ queue(np/10);
plot( bord); 
mesh Th2=buildmesh(bord);
plot(Th2,wait=1);
int[int] l23=[0,0,1,1]; 
mesh3 Th=buildlayers(Th2,coef= max(.15,y/max(f,0.05)), 50 ,zbound=[0,2*pi]
   ,transfo=[x,y*cos(z),y*sin(z)],facemerge=1,labelmid=l23);
macro Grad(u) [dx(u),dy(u),dz(u)] //
fespace Vh(Th,P1);  Vh u,v;
solve Poisson(u,v) = int3d(Th)( Grad(u)'*Grad(v) ) - int3d(Th)( v) + on(1,u=1);
plot(u,wait=1,nbiso=20,value=1);
medit("u",Th,u,wait=1);