!*********************************************************************************************************************************************************!
!* Copyright (c) <2015> <Purdue University> All rights reserved.																					     *!
!*                                                                      																			     *!
!* Developed by:  Fang Jiang, Wenbin Yu                                                                                                                  *!
!*        <Prof. Yu’s Research Group>,                                                                                                                   *!
!*        <School of Aeronautics and Astronautics, Purdue University>                                                                                    *!
!*        <https://cdmhub.org/projects/ansysvabsgui2015>                                                                                                 *!
!*                                                                      																			     *!
!* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),    *!
!* to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,  *!
!* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:            *!
!*                                                                      																			     *!
!* •Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimers.                        *!
!*                                                                      																			     *!
!* •Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimers in the documentation *!
!*  and/or other materials provided with the distribution.                                                                                               *!
!*                                                                      																			     *!
!* •Neither the names of < Prof. Yu’s Research Group, School of Aeronautics and Astronautics, Purdue University >,                                       *!
!*  nor the names of its contributors may be used to endorse or promote products derived from this Software without specific prior written permission.   *!
!*                                                                      																			     *!
!* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   *!
!* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR     *!
!* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER     *!
!* DEALINGS WITH THE SOFTWARE. 																															 *!
!*********************************************************************************************************************************************************!
!/INPUT, VABS_APDL_VisualRecovery/VABS_APDL_ContourPlot, mac

/POST1
/DSCALE,ALL,OFF
ALLSEL,ALL

*IF,PLOTEN,EQ,0,THEN                    ! plot nodal values
		*IF,PLOTSE,EQ,0,THEN            ! plot stress
				*IF, PLOTCOMP,EQ,0,THEN
					PLNSOL,S,Z
				*ELSEIF,PLOTCOMP,EQ,1
					PLNSOL,S,XZ
				*ELSEIF,PLOTCOMP,EQ,2
					PLNSOL,S,YZ
				*ELSEIF,PLOTCOMP,EQ,3
					PLNSOL,S,X
				*ELSEIF,PLOTCOMP,EQ,4
					PLNSOL,S,XY
				*ELSEIF,PLOTCOMP,EQ,5
					PLNSOL,S,Y
				*ELSE
				*ENDIF
			*ELSEIF,PLOTSE,EQ,1         ! plot strain
				*IF, PLOTCOMP,EQ,0,THEN
					PLNSOL,EPEL,Z
				*ELSEIF,PLOTCOMP,EQ,1
					PLNSOL,EPEL,XZ
				*ELSEIF,PLOTCOMP,EQ,2
					PLNSOL,EPEL,YZ
				*ELSEIF,PLOTCOMP,EQ,3
					PLNSOL,EPEL,X
				*ELSEIF,PLOTCOMP,EQ,4
					PLNSOL,EPEL,XY
				*ELSEIF,PLOTCOMP,EQ,5
					PLNSOL,EPEL,Y
				*ELSE
				*ENDIF			
			*ELSE
		*ENDIF
	*ELSE
*ENDIF

*IF,PLOTEN,EQ,1,THEN                    ! plot elemental values
		*IF,PLOTSE,EQ,0,THEN            ! plot stress
				*IF, PLOTCOMP,EQ,0,THEN
					PLESOL,S,Z
				*ELSEIF,PLOTCOMP,EQ,1
					PLESOL,S,XZ
				*ELSEIF,PLOTCOMP,EQ,2
					PLESOL,S,YZ
				*ELSEIF,PLOTCOMP,EQ,3
					PLESOL,S,X
				*ELSEIF,PLOTCOMP,EQ,4
					PLESOL,S,XY
				*ELSEIF,PLOTCOMP,EQ,5
					PLESOL,S,Y
				*ELSE
				*ENDIF
			*ELSEIF,PLOTSE,EQ,1         ! plot strain
				*IF, PLOTCOMP,EQ,0,THEN
					PLESOL,EPEL,Z
				*ELSEIF,PLOTCOMP,EQ,1
					PLESOL,EPEL,XZ
				*ELSEIF,PLOTCOMP,EQ,2
					PLESOL,EPEL,YZ
				*ELSEIF,PLOTCOMP,EQ,3
					PLESOL,EPEL,X
				*ELSEIF,PLOTCOMP,EQ,4
					PLESOL,EPEL,XY
				*ELSEIF,PLOTCOMP,EQ,5
					PLESOL,EPEL,Y
				*ELSE
				*ENDIF			
			*ELSE
		*ENDIF
	*ELSE
*ENDIF


!		/UI,COPY,SAVE,BMP,GRAPH,COLOR,NORM,LANDSCAPE,NO,10 !The last position is the quality level with max of 100