! ANSYS $RCSfile: TOPLOT.MAC,v $
! Modified on $Date: 2010-11-14 13:40:31 -0500 (Sun, 14 Nov 2010) $ 
! Source ID = $Revision: 435640 $
! ******************************************************************* !
!                          TOPLOT.MAC                                 !
!        Macro to plot result of topological optimization             !
!                                                                     !
! Last Modified:                                                      !
!   Fv June 10, 1999    Created by FV                                 !
!   Fv September 05, 1999    Modified by FV                           !
!                                                                     !
! Usage:  TOPLOT,AVRG                                                 !
!                                                                     !
!           AVRG = Averaging key                                      !
!                0 ... plot smoothed nodal solution (default)         !
!                1 ... plot non-smoothed element solution             !
!                                                                     !
! Parameters used in this macro:                                      !
!   ARG1    First argument (AVRG)                                     !
!                                                                     !
! ******************************************************************* !
*get,_PRNT,active,,prkey    ! Check for print supression
/nopr                       ! Suppress command echo
*get,_proc,active,,rout
*if,_proc,eq,0,then
 _rtnproc='FINI'
*elseif,_proc,eq,17,then
 _rtnproc='/PREP7'
*elseif,_proc,eq,21,then
 _rtnproc='/SOLU'
*elseif,_proc,eq,31,then
 _rtnproc='/POST1'
*elseif,_proc,eq,36,then
 _rtnproc='/POST26'
*elseif,_proc,eq,41,then
 _rtnproc='/OPT'
*elseif,_proc,eq,52,then
 _rtnproc='/AUX2'
*elseif,_proc,eq,62,then
 _rtnproc='/AUX12'
*elseif,_proc,eq,65,then
 _rtnproc='/AUX15'
*endif
*get,_ismenu,active,,menu
*if,_ismenu,eq,1,then
 /ui,coll,no
*endif
_AVRG = arg1                ! _AVRG = averaging key
*if,_AVRG,lt,0,then
 *msg,warning
 Incorrect option selected for the TOPLOT command. The default option 0 = NODAL AVERAGING is used.
 _AVRG=0
*endif
*if,_AVRG,gt,1,then
 *msg,warning
 Incorrect option selected for the TOPLOT command. The default option 0 = NODAL AVERAGING is used.
 _AVRG=0
*endif
/post1
set,last
/dsc,1,1.0d-8
*if,_AVRG,eq,0,then
 plns,topo
*else
 ples,topo
*endif
/dsc,1,auto
fini
%_rtnproc%
*get,_ismenu,active,,menu
*if,_ismenu,eq,1,then
 /ui,coll,yes
*endif
/mrep,TOPLOT,arg1
_AVRG=
_rtnproc=
_ismenu =
_proc=
*if,_PRNT,ge,1,then            ! Check and resume printing
   _PRNT =
   /gopr           
*else
   _PRNT =
*endif
