Skip to content

Commit f656c5f

Browse files
committed
add missing files
1 parent 6351ede commit f656c5f

File tree

117 files changed

+119483
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+119483
-0
lines changed

2023/pdf/FH-ffday23.zip

5.13 MB
Binary file not shown.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
load "msh3"
2+
load "medit"
3+
int nn=10;
4+
// a potentiel flow on a lac ..
5+
// a first freefem++ 3d example
6+
// ------ not to bad ......
7+
verbosity=3;
8+
mesh Th2("lac-leman-v4.msh");
9+
fespace Vh2(Th2,P1);
10+
Vh2 deep;
11+
{ Vh2 v;
12+
macro Grad(u) [dx(u),dy(u)] //
13+
solve P(deep,v)= int2d(Th2)(Grad(deep)'*Grad(v))+int2d(Th2)(v)
14+
+on(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,deep=-1);
15+
deep = deep*5/abs(deep[].min);
16+
plot(deep,wait=1,cmm="min: "+deep[].min+ " max: "+deep[].max );
17+
}
18+
Vh2 ux,uz,p2;
19+
int[int] rup=[0,200], rdown=[0,100],rmid(17*2);
20+
for(int i=0;i<rmid.n;++i)
21+
rmid[i]=1+i/2;
22+
cout << rmid << endl;
23+
real maxdeep = deep[].min;
24+
mesh3 Th=buildlayers(Th2,nn,
25+
coef= deep/maxdeep,
26+
zbound=[deep,0],
27+
labelmid=rmid,
28+
labelup = rup,
29+
labeldown = rdown);
30+
//medit("Leman",Th);
31+
fespace Vh(Th,P13d);
32+
Vh p,q;
33+
// (-deep[].min)*c = 0.5 Km
34+
// c =
35+
real cc=(0.5/-deep[].min);
36+
cout << cc << " cc = " << endl;
37+
cc=1; // otherwise bug in bounding condition ...
38+
macro Grad(u) [dx(u),dy(u),cc*dz(u)] //
39+
40+
real ain=int2d(Th,1)(1.);
41+
real aout=int2d(Th,2)(1.);
42+
cout << " area " << ain << " " << aout << endl;
43+
real din=1./ain;
44+
real dout=-1./aout;
45+
solve P(p,q)= int3d(Th)(Grad(p)'*Grad(q)+1e-5*p*q)-int2d(Th,1)(q*din)+int2d(Th,2)(q*dout);
46+
47+
plot(p,wait=1,nbiso=30,value=1);
48+
medit("potentiel",Th,p);
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
load "msh3" load "medit"
2+
mesh3 Th;
3+
try {Th=readmesh3("/tmp/3daxi.mesh");} // try to read
4+
catch(...) { // if not build ...
5+
func f=2*((0.1+(((x/3))*(x-1)*(x-1)/1+x/100))^(1/3.)-(0.1)^(1/3.));
6+
real yf=f(1.2,0);
7+
border up(t=1.2,0.){ x=t;y=f;label=0;}
8+
border axe2(t=0.2,1.15) { x=t;y=0;label=0;}
9+
border hole(t=pi,0) { x= 0.15 + 0.05*cos(t);y= 0.05*sin(t); label=1;}
10+
border axe1(t=0,0.1) { x=t;y=0;label=0;}
11+
border queue(t=0,1) { x= 1.15 + 0.05*t; y = yf*t; label =0;}
12+
int np= 100;
13+
func bord= up(np)+axe1(np/10)+hole(np/10)+axe2(8*np/10)+ queue(np/10);
14+
plot( bord);
15+
mesh Th2=buildmesh(bord);
16+
plot(Th2,wait=1);
17+
int[int] l23=[0,0,1,1];
18+
Th=buildlayers(Th2,coef= max(.15,y/max(f,0.05)), 50 ,zbound=[0,2*pi]
19+
,transfo=[x,y*cos(z),y*sin(z)],facemerge=1,labelmid=l23);
20+
savemesh(Th,"/tmp/3daxi.mesh");
21+
}
22+
23+
macro Grad(u) [dx(u),dy(u),dz(u)] //
24+
fespace Vh(Th,P1); Vh u,v;
25+
solve Poisson(u,v) = int3d(Th)( Grad(u)'*Grad(v) ) - int3d(Th)( v) + on(1,u=1);
26+
plot(u,wait=1,nbiso=20,value=1);
27+
medit("u",Th,u);
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
border C(t=0,2*pi){x=cos(t);y=sin(t);};
2+
3+
mesh Th= buildmesh(C(20));
4+
func u = ( (10*x^3+y^3) + tanh(500*(sin(5*y)-2*x) ));
5+
func v = ( (10*y^3+x^3) + tanh(5000*(sin(5*x)-2*y) ));
6+
7+
real xz = 0.5, yz = 0.3 , dz=0.05;
8+
func bb=[[xz-dz,yz-dz],[xz+dz,yz+dz]];
9+
int nn = Th.nv;
10+
plot(Th, cmm = 0 + " nv =" + Th.nv, ps="../plots/aTh-"+0+".eps" );
11+
12+
for(int iter=1;iter < 20; ++iter )
13+
{
14+
Th = adaptmesh(Th,[u,v],err=0.06,nbvx=50000,thetamax=30);
15+
if(abs(Th.nv - nn) < nn*0.005) break;
16+
nn = Th.nv;
17+
plot(Th, cmm = iter + " nv =" + Th.nv, ps="../plots/aTh-"+iter+".eps" );
18+
plot(Th, cmm = iter + " nv =" + Th.nv, ps="../plots/zTh-"+iter+".eps", bb = bb,wait=1 ,WindowIndex=1);
19+
20+
}
21+
// plot ...
22+
fespace Vh(Th,P1);
23+
Vh uh=u,vh=v;
24+
25+
load "msh3"
26+
meshS Thu= movemesh23(Th,transfo=[x,y,u/10]);Thu=change(Thu,fregion=1);
27+
meshS Thv= movemesh23(Th,transfo=[x,y,v/10]);Thv=change(Thv,fregion=2);
28+
29+
30+
plot(uh,dim=3, cmm="uh",wait=1,fill=1);
31+
plot(vh,dim=3, cmm="vh",wait=1,fill=1);
32+
plot(Thu,Thv,wait=1);
33+
//plot(Thv,wait=1);
34+
load "medit" medit("Thu",Thu,Thv);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
load "MetricPk" load "Element_P3"
2+
int[int] lab=[1,1,1,1];
3+
mesh Th = square(10,10,label=lab);
4+
Th=trunc(Th,x<0.2 | y<0.2, label=1);
5+
fespace Vh(Th,P3);
6+
fespace Metric(Th,[P1,P1,P1]);
7+
Vh u,v;
8+
real error=0.01;
9+
solve Poisson(u,v,solver=CG,eps=1.0e-6) =
10+
int2d(Th,qforder=5)( u*v*1.0e-10+ dx(u)*dx(v) + dy(u)*dy(v))
11+
+ int2d(Th,qforder=5)( (x-y)*v);
12+
// Do sub optimal adaptation in Norm $W^{r,p}$ for $Pk$
13+
real Nt= 1000,r = 1, k =3, p=1;
14+
15+
for (int i=0;i< 4;i++)
16+
{
17+
Metric [m11,m12,m22];
18+
m11[]=MetricPk(Th,u , kDeg=k,rDeg=r,pExp=p, mass=Nt/2);
19+
Th = adaptmesh(Th,m11,m12,m22,IsMetric=true, nbvx= Nt*2);
20+
u=u;// reinterpolation of u on new mesh Th.
21+
Poisson;
22+
plot(Th,wait=1);
23+
plot(u,wait=1);
24+
25+
} ;

2023/pdf/FH-ffday23/edp2-full/Ali-Bouchta-B.pgm

Lines changed: 4 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)