/out,pmach3d,out
/gopr
fini
/uis,msgpop,3
/prep7
*get,_immed,active,,imme
immed
alls
numc,node
_pbccp=arg4
*if,_pbccp,ne,0,then
ksel,all
*get,_kpmax,kp,,num,max
lsel,none
ksel,none
*endif
*set,tcpu
*dim,tcpu,,16
*get,tcpu(1),active,,time,cpu
_ok=0
*get,_nops,active,,prkey
*get,_mnu,active,,menu
*if,_mnu,eq,0,then
_dely=0
*else
_dely=5
*endif
*get,_arout,active,,rout
*if,_arout,ne,17,then
fini
/prep7
*endif
nsel,all
*get,tcpu(2),active,,time,cpu
*get,_ndmax,node,,num,max
*get,_cemx,active,,ce
cmsel,,rotor
esel,r,mat,,1
esel,r,real,,5
nsle
csys,1
*get,_rdmx,node,,mxloc,x
*get,_rdmn,node,,mnloc,x
*get,_trmx,node,,mxloc,y
*get,_trmn,node,,mnloc,y
_rdtol=(_rdmx-_rdmn)/100
_rdtolr=_rdtol
nsel,r,ext
nsel,r,loc,x,_rdmx-_rdtol,_rdmx+_rdtol
*get,_ecntr,elem,,count
cm,_remnod,node
cmsel,,stator
esel,r,mat,,1
nsle
*get,_rdmx,node,,mxloc,x
*get,_rdmn,node,,mnloc,x
*get,_tsmx,node,,mxloc,y
*get,_tsmn,node,,mnloc,y
_rdtol=(_rdmx-_rdmn)/100
_rdtols=_rdtol
nsel,r,ext
nsel,r,loc,x,_rdmn-_rdtol,_rdmn+_rdtol
*get,_ecnts,elem,,count
esln
nsle
cmsel,a,_remnod
cm,_remnod,node
*get,tcpu(3),active,,time,cpu
nsel,all
*get,tcpu(4),active,,time,cpu
cmsel,u,_remnod
cm,_perbcn,node
_delrsth=_trmx-_tsmx
_mv_rot=0
*if,abs(_delrsth),gt,.001,then
cmsel,,rotor
csys,1
ngen,2,,all,,,0,-_delrsth
cmsel,,_perbcn
_mv_rot=1
*endif
csys,1
*get,_thtmx,node,,mxloc,y
*get,_thtmn,node,,mnloc,y
*get,_rdmx,node,,mxloc,x
*get,_rdmn,node,,mnloc,x
arg7=arg1
_evodi=1
*if,arg7,ge,1,then
_evodi=2
*endif
arg1=_thtmn
arg2=_thtmx
arg4=_rdmn
arg5=_rdmx
arg6=_rdtols
*if,_rdtolr,lt,_rdtols,then
arg6=_rdtolr
*endif
arg3=(_thtmx-_thtmn)/(_ecnts*2)
*if,_ecntr,gt,_ecnts,then
arg3=(_thtmx-_thtmn)/(_ecntr*2)
*endif
*get,_sysc,active,,csys
csys,1
*get,tcpu(5),active,,time,cpu
*if,abs(_trmx-_trmn),gt,180,then
*msg,info
Periodic conditions are NOT appropriate for full 360d models
_ok=1
*endif
*if,arg1,eq,arg2,then
*msg,error
Invalid angle input on symmetry planes, please reissue command macro
_ok=1
*endif
*if,arg5,eq,0,then
*msg,error
Missing input for maximum radius, please reissue command macro
_ok=1
*endif
*get,tcpu(6),active,,time,cpu
*if,_ok,ne,1,then
esel,all
nsel,,ext
cmsel,u,_remnod
nsel,r,loc,y,arg2-arg3,arg2+arg3
nsel,r,loc,x,arg4-arg6,arg5+arg6
cm,_pln2,node
cm,cp_2,node
*get,_cnt2,node,,count
cpdel,all,,,any
cedel,all,,,any
numc,ce
numc,cp
*get,_cemx,active,,ce
*get,_cpmx,active,,cp
_ice=_cemx+1
_icp=_cpmx+1
_ceorg=_ice
_cporg=_icp
*set,_mskv1
*dim,_mskv1,,_ndmax
*set,_mskv2
*dim,_mskv2,,_ndmax
*get,tcpu(7),active,,time,cpu
*get,tcpu(8),active,,time,cpu
*set,_rdpln2
*dim,_rdpln2,,_ndmax
*set,_rdcpln2
*dim,_rdcpln2,,_cnt2
*vget,_mskv2(1),node,,nsel
*voper,_mskv2(1),_mskv2(1),ge,0
*vmask,_mskv2(1)
csys,1
*vget,_rdpln2(1),node,1,loc,x
*cfop,_radn
*vmask,_mskv2(1)
*vwrite,_rdpln2(1)
(f20.10)
*cfcl
*vread,_rdcpln2(1),_radn
(f20.10)
*get,tcpu(9),active,,time,cpu
esel,all
nsel,,ext
cmsel,u,_remnod
nsel,r,loc,y,arg1-arg3,arg1+arg3
nsel,r,loc,x,arg4-arg6,arg5+arg6
cm,_pln1,node
cm,cp_1,node
*get,_cnt1,node,,count
cmsel,a,_pln2
*if,_cnt1,eq,0,then
*msg,error
No nodes selected on 1st plane, please reissue command macro
/wait,_dely
_ok=1
*else
*if,_cnt2,eq,0,then
*msg,error
No nodes selected on 2nd plane, please reissue command macro
/wait,_dely
_ok=1
*else
*if,_cnt1,ne,_cnt2,then
*msg,error
Number of nodes on symmetry planes do not match
/wait,_dely
_ok=1
*endif
*endif
*endif
*endif
per3d,1,2,0
/out,pmach3d,out,,append
csys,_sysc
nsel,all
immed,_immed
/nopr
/uis,msgpop
esel,all
nsel,all
*if,_nops,eq,0,then
/nopr
_nops=
*else
_nops=
/go
*endif
/out