! ANSYS $RCSfile: RMEXPAND.MAC,v $
! Modified on $Date: 2010-11-14 13:40:31 -0500 (Sun, 14 Nov 2010) $
! Source ID = $Revision: 435640 $
!
/com
/com *** RMEXPAND Command Macro
/com
!                                                       eantonov  fv
! 
! Expansion pass for rom tool
!
/nopr
_nerr=0
_nmodes=arg1
*if,_nmodes,le,0,then
 *msg,error
 Zero number of modes specified on label 2. Command RMEXPAND is ignored.
 _nerr=1
*endif
!
_strf=arg2
*if,_strf,le,0,then
 _strf=0
*endif
!
_ldstep=arg3
*if,_ldstep,le,0,then
 _ldstep=0
*endif
!
_substep=arg4
*if,_substep,le,0,then
 _substep=0
*endif
!
_timfrq=arg5
*if,_timfrq,le,0,then
 _timfrq=0
*endif
!
_exts=arg6
*if,_exts,le,0,then
 _exts=0
*endif
*if,_exts,gt,0,then
 rm02,RMEX,min,_exts
*endif
!
_exte=arg7
*if,_exte,le,0,then
 _exte=0
*endif
*if,_exte,gt,0,then
 rm02,RMEX,max,_exte
*endif
!
*if,_nerr,eq,0,then
 PHYSICS,CLEAR
 PHYSICS,READ,STRU
!
 /SOLU                          
 ANTYPE,MODAL                     ! Run modal analysis
 MODOPT,LANB,_nmodes
 MXPAND,_nmodes
!
 rmuse,off
!
 *get,_tmp1,active,,erro
 SOLVE
 *get,_tmp2,active,,erro
 *if,_tmp2,gt,_tmp1,then
  _nerr=1
  *msg,error
  RMEXPAND command stopped due to an error condition.
 *endif
 fini
*endif
!
*if,_nerr,eq,0,then
 /solu
  rmuse,on
  expass,on
!
  *if,_timfrq,le,0,then
     *if,_ldstep,gt,0,then
       *if,_substep,gt,0,then
         *if,_strf,gt,0,then
           expsol,_ldstep,_substep,,ON
         *else
           expsol,_ldstep,_substep,,OFF
         *endif
       *endif
     *else
       *if,_strf,gt,0,then
          expsol,,,,ON
       *else
          expsol,,,,OFF
       *endif
     *endif
  *else
     *if,_strf,gt,0,then
        expsol,,,_timfrq,ON
     *else
        expsol,,,_timfrq,OFF
     *endif
  *endif
!
  solve
!
  rmuse,off
!
 fini
*endif
!
_nmodes=
_tmp1=
_tmp2=
_ldstep=
_substep=
_timfrq=
_strf=
_exts=
_exte=
/gopr
