//Alnico magnet with a 2mm pure iron sheet above

mm=0.001;
lc = 1*mm;

Point(1)={-2.5*mm,0,0,lc};
Point(2)={2.5*mm,0,0,lc};
Point(3)={2.5*mm,10*mm,0,lc/5};
Point(4)={-2.5*mm,10*mm,0,lc/5};

Point(5)={-2.5*mm,12*mm,0,lc/5};
Point(6)={2.5*mm,12*mm,0,lc/5};

Line(11)={1,2};
Line(12)={2,3};
Line(13)={3,4};
Line(14)={4,1};
Line(15)={4,5};
Line(16)={5,6};
Line(17)={6,3};


rint=50*mm;
rext=75*mm;
lcint=3;
lcext=5;

Point(30)={rint,0,0,lc*lcint};
Point(31)={rext,0,0,lc*lcext};
Point(32)={0,rint,0,lc*lcint};
Point(33)={0,rext,0,lc*lcext};

Point(34)={-rint,0,0,lc*lcint};
Point(35)={-rext,0,0,lc*lcext};
Point(36)={0,-rint,0,lc*lcint};
Point(37)={0,-rext,0,lc*lcext};

centre=newp;
Point(centre)={0,0,0,lc};

Circle(38)={30,centre,32};
Circle(39)={32,centre,34};
Circle(40)={34,centre,36};
Circle(41)={36,centre,30};

Circle(42)={31,centre,33};
Circle(43)={33,centre,35};
Circle(44)={35,centre,37};
Circle(45)={37,centre,31};

Line Loop(40)={11,12,13,14};
Plane Surface(41)={40};

Line Loop(42)={15,16,17,13};
Plane Surface(43)={42};

Line Loop(44)={11,12,-17,-16,-15,14};
Line Loop(45)={38,39,40,41};
Plane Surface(46)={45,44};

Line Loop(47)={42,43,44,45};
Plane Surface(48)={47,45};

// Entite physique

Physical  Line(9999)={42,43,44,45};

Physical Surface(8888) = {41};//aimant
Physical Surface(7777) = {43};//ferdou
Physical Surface(6666) = {46};//Air
Physical Surface(5555) = {48};//Air infini
