/out,embed,out
fini
/nerr,0,1e5
/cle,all
/prep7
/inp,mach2,des
*SET,off2,.03
*SET,rbc,gap/2+rr2+magh

pcirc,rr1,rr2+magh,0,180/npole
pcirc,rr2+magh,rbc,0,180/npole
pcirc,rr2,rr2+magh-off2,0,(magw/180)*180/npole
aovl,all
asel,,,,3
aatt,3,3,1
asel,,,,5
aatt,2,2,1
asel,,,,4
aatt,1,5,1
alls

! radial divisions in the air gap
lesi,13,,,rref
rp2,1
!  circumferential divisions in the air gap
lesi,1,,,20
rp2,4
!  circumferential for the backiron
lesi,3,,,4
!  radial through the magnet
lesi,10,,,3
!   radial for the iron on the side
lesi,2,,,5,3


et,1,13
ames,all

csys
arsymm,y,all
csys,1
agen,npole,all,,,0,360/npole
numm,node
numm,kp
numc,elem
numc,node
arscal,all,,,ggeom,ggeom,,,,1
csys
/rep
:end
/out