/out,for_off,out
/gopr
*get,_nops,active,,prkey
*get,_mnu,active,,menu
*get,_arout,active,,rout
_ok=0
*if,_arout,ne,31,then
*msg,warn
Enter Post1 before issuing this command macro
_ok=1
*else
fx=
fy=
*get,_sysr,active,,rsys
*get,_unit,active,,solu,emunit
*get,_mu,active,,solu,muzro
*get,_dimn,active,,solu,dimn
cm,_curelm,elem
*if,_dimn,eq,3,then
esel,,ename,,13,53,40
*get,_num2d,elem,,count
*if,_num2d,gt,0,then
_dimn=2
*else
_dimn=3
*endif
cmsel,s,_curelm
_num2d=
*endif
cmdele,_curelm
*get,_sysd,active,,dsys
RSYS,0
_afun=atan(1)
*if,_afun,gt,1,then
*afun,rad
*endif
_pi4=16*atan(1)
_relz=1/_mu
*if,_dimn,eq,3,then
*msg,warn
Command macro FOR2D may not be valid for 3-d analysis
_ok=0
*endif
*if,_unit,gt,2,then
*msg,error
Invalid units option specified, please reissue command macro
_ok=1
*endif
*if,_unit,le,2,then
check_=0
*if,check_,eq,12345,then
*msg,error
Path must be defined before calling command macro
_ok=1
*else
cmsel,,rotor
*get,rmrmdx,node,,mxloc,x
esel,r,mat,,3
esel,a,mat,,2
nsle
csys,1
*get,_rrdmx,node,,mxloc,x
_rtorq=_rrdmx+.25*(rmrmdx-_rrdmx)
arg1=_rtorq
arg2=20
_tcsys=99
esel,,mat,,1
*get,_antyp,active,,anty
*if,_antyp,ne,3,then
_nget=1
*else
_nget=2
*endif
*do,_ifor1,1,_nget
*if,_ifor1,eq,1,then
set,1,1
*else
set,1,1,,1
*endif
local,_tcsys,1
cscir,_tcsys,0
path,_torq,2,,arg2*48
ppath,1,,-arg1,-1.e-6,,_tcsys
ppath,2,,-arg1,0,,_tcsys
PDEF,BPX,B,X
PDEF,BPY,B,Y
PDEF,BPZ,B,Z
DSYS,0
*if,_mg1,ne,1,then
_mg1=0
*endif
*if,_mnu*(_mg1-1),ne,0,then
/PBC,PATH,1
NPLOT
*endif
PCALC,MULT,BX2,BPX,BPX
PCALC,MULT,BY2,BPY,BPY
PCALC,ADD,B2,BX2,BY2
PCALC,ADD,T11,BX2,B2,,-0.5
PCALC,MULT,T12,BPX,BPY
PCALC,ADD,T22,BY2,B2,,-0.5
csys
PVECT,NORM,NX,NY,NZ
PDOT,TNX,T11,T12,BPZ,NX,NY,NZ
PDOT,TNY,T12,T22,BPZ,NX,NY,NZ
*IF,_dimn,eq,1,THEN
PCALC,MULT,TNX,TNX,XG,_pi4/2
PCALC,MULT,TNY,TNY,XG,_pi4/2
*ENDIF
PCALC,INTG,FX,TNX,S,_RELZ
*GET,FX,PATH,,LAST,FX
PCALC,INTG,FY,TNY,S,_RELZ
*GET,FY,PATH,,LAST,FY
*if,_unit,eq,2,then
fx=fx/_pi4
fy=fy/_pi4
*endif
*if,_ifor1,eq,1,then
fxr=fx
fyr=fy
*else
fxi=fx
fyi=fy
fx=.5*(fxr+fxi)
fy=.5*(fyr+fyi)
*endif
*enddo
/nopr
/out,for2d,out
*msg,info
%/___SUMMARY OF FORCE CALCULATIONS BY MAXWELL STRESS TENSOR____
*if,_antyp,eq,3,then
*msg,info
The forces are RMS values for an AC analysis
*if,_dimn,eq,2,then
*if,_unit,le,1,then
*msg,info,FX
%/Force in x-direction = %G N/m
*msg,info,FY
%/Force in y-direction = %G N/m
*elseif,_unit,eq,2,then
*msg,info,FX
%/Force in x-direction = %G Dyne/cm
*msg,info,FY
%/Force in y-direction = %G Dyne/cm
*endif
*elseif,_dimn,eq,1,then
*if,_unit,le,1,then
*msg,info,FX
%/Force in x-direction = %G N
*msg,info,FY
%/Force in y-direction = %G N
*elseif,_unit,eq,2,then
*msg,info,FX
%/Force in x-direction = %G Dyne
*msg,info,FY
%/Force in y-direction = %G Dyne
*endif
*endif
*msg,info
%/Parameter defined for force in X direction: FX
*msg,info
%/Parameter defined for FORCE in Y direction: FY
*msg,info
_____________________________________________________________
/out
/gopr
rsys,_sysr
dsys,_sysd
/pbc,path,0
*endif
*endif
rsys,_sysr
dsys,_sysd
_pi4=
_sysd=
_unit=
_mu=
_dimn=
_sysr=
_relz=
check_=
*if,_afun,gt,1,then
*afun,deg
*endif
_afun=
*endif
*if,_arout*(1+_ok),eq,31,then
*list,for2d,out
*if,_mnu*(1-_mg1),ne,0,then
*uilist,for2d,out
*endif
*endif
_arout=
_mnu=
_dely=
_ok=
*if,_nops,eq,0,then
/nopr
_nops=
*else
_nops=
/go
*endif