forked from burakbayramli/books
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample42.edp
31 lines (26 loc) · 813 Bytes
/
example42.edp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// example42.edp, from cone.edp
// example to build a mesh a cone
load "msh3"
load "medit"
// cone using buildlayers with a triangle
real RR=1, HH=1;
border Taxe(t=0, HH){x=t; y=0; label=0;}
border Hypo(t=1, 0){x=HH*t; y=RR*t; label=1;}
border Vert(t=0, RR){x=HH; y=t; label=2;}
int nn = 10;
real h= 1./nn;
mesh Th2=buildmesh( Taxe(HH*nn) + Hypo(nn*sqrt(HH*HH + RR*RR)) + Vert(RR*nn) ) ;
plot(Th2, wait=1);
int MaxLayersT=4*(int(2*pi*RR/h)/4);
func zminT = 0;
func zmaxT = 2*pi;
func fx = y*cos(z);
func fy = y*sin(z);
func fz = x;
int[int] r1T=[0,0], r2T=[0,0,2,2];
int[int] r4T=[0,2];
mesh3 Th3T = buildlayers(Th2, MaxLayersT, coef= max(.01,y/max(x,0.4) ),
zbound=[zminT,zmaxT], transfo=[fx,fy,fz], facemerge=true,
region=r1T, labelmid=r2T);
medit("cone",Th3T,wait=1);
plot(Th3T,cmm="cone");