Include "basis3.geo";

r=+0.000245000000; x=+0.000400000000; y=+0.000000000000; z=+0.000250000000; t=1.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000087500000; y=+0.000390312375; z=+0.000250000000; t=2.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000361718750; y=+0.000170761664; z=+0.000250000000; t=3.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000245751953; y=-0.000315604147; z=+0.000250000000; t=4.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000175640569; y=-0.000359375000; z=+0.000515542078; t=5.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000175640569; y=+0.000359375000; z=+0.000674028207; t=6.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000312249900; y=+0.000250000000; z=+0.000674028207; t=7.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000389092649; y=-0.000092773438; z=+0.000674028207; t=8.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000046382753; y=-0.000094902914; z=+0.000919704091; t=9.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000087500000; y=+0.000390312375; z=+0.001098056413; t=10.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000361718750; y=+0.000170761664; z=+0.001098056413; t=11.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000269034223; y=-0.000296007748; z=+0.001251470541; t=12.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000398842396; y=+0.000030409585; z=+0.001251470541; t=13.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000175640569; y=-0.000359375000; z=+0.001471126912; t=14.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000044060878; y=+0.000090152167; z=+0.001475674719; t=15.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000377891978; y=+0.000131139822; z=+0.001740770551; t=16.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000232328757; y=-0.000283111455; z=+0.001749954637; t=17.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=-0.000351713701; y=+0.000190519000; z=+0.001856826003; t=18.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000261499236; y=-0.000302684972; z=+0.001960427245; t=19.0; 
Call bead;
Physical Volume (t) = thehole ;

r=+0.000245000000; x=+0.000069419015; y=+0.000393930197; z=+0.002033662425; t=20.0; 
Call bead;
Physical Volume (t) = thehole ;


//Cylinder

h=+0.002405000000; x=0; y=0; z=-0.000005000000; r=+0.000655000000;

p1 = newp;  Point(p1) = {x,y,z,0.5};
p2 = newp;  Point(p2) = {x+r,y,z,0.5}; 
p3 = newp;  Point(p3) = {x,y+r,z,0.5}; 
p4 = newp;  Point(p4) = {-(x+r),y,z,0.5}; 
p5 = newp;  Point(p5) = {0,-(y+r),z,0.5}; 

c1 = newreg;  Circle(c1) = {p2,p1,p3}; 
c2 = newreg;  Circle(c2) = {p3,p1,p4}; 
c3 = newreg;  Circle(c3) = {p4,p1,p5}; 
c4 = newreg;  Circle(c4) = {p5,p1,p2}; 

l1  = newreg;  Line Loop(l1) = {c1,c2,c3,c4}; 
ps1 = newreg;  Plane Surface(ps1) = {l1}; 

cyl[]=Extrude {0,0,h} { Surface{ps1}; }; 

Delete { Volume { cyl[1] } ; }

theloops[0] = newreg ;

Surface Loop(theloops[0]) = { ps1, cyl[2], cyl[3], cyl[4], cyl[5], cyl[0] } ;

vv = newreg ;

Volume(vv) = { theloops[0], theloops[1], theloops[2], theloops[3], theloops[4], theloops[5], theloops[6], theloops[7], theloops[8], theloops[9], theloops[10], theloops[11], theloops[12], theloops[13], theloops[14], theloops[15], theloops[16], theloops[17], theloops[18], theloops[19], theloops[20] } ;

Physical Volume("Fluid")     = {vv} ;
Physical Surface("Cylinder") = {ps1, cyl[2], cyl[3], cyl[4], cyl[5], cyl[0] } ;
