TALK=f;RUN(1,1)
  DISPLAY
  A rectangular plate of dimensions LX * LZ is 
  1. held fixed along its high and west edges
  2. subjected to uniform tension along its low edge
  3. allowed to contract freely along its east edge
  4. in case 1 (plane stress) allowed to contract freely in the 
     y-direction
  5. in case 2 (plane strain) prevented from contracting in the 
     y-direction.
  The distributions of displacement in the xz plane are computed,
  and also the corresponding stresses and strains in all three 
  directions.
  A uniform cartesian grid is used.
  The computed results are compared with the analytically-derived
  values.  
    
  ENDDIS
  
  PHOTON USE
  p;;;;
  
  

  set prop off
  cl
  msg x-displacement fields
  gr ou y 1
  cont U1 y 1 fil;.0001
  pause
  cl
  msg z-displacement fields
  gr ou y 1
  cont W1 y 1 fil;.0001

  ENDUSE
  
 ************************************************************
  Group 1. Run Title and Number
 ************************************************************
 TEXT(2D xz plate in z-direction tension; s205
libref=205 
TITLE
integer(caseno)     
mesg(caseno = 1  : y free
mesg(caseno = 2  : y fixed
caseno=1
label ask
mesg(caseno=:caseno: Enter 1, 2 or blank
readvdu(caseno,int,1)
if(caseno.lt.1) then
 goto ask
endif  
if(caseno.gt.2) then
 goto ask
endif 
caseno
  Declarations and settings
REAL(FZ,LX,LZ,POISSON,YOUNG) 
FZ= -40.0e6  ! H/m^2 = 40 N/mm^2
LX=90.e-3
LZ=120.e-3 
YOUNG   = 1/0.5E-11   ! Young's modulus used for exact solutions
POISSON=0.3           ! Poisson's ratio used for exact solutions
                      ! The above must correspond to the data   
                      ! below MATFLG                            
INTEGER(NXBODY,NZBODY)

 ************************************************************
  Group 2. Time dependence
 STEADY  =    T
 ************************************************************
  Group 3. X-Direction Grid Spacing
 CARTES  =    T
 NXBODY = 10
 GRDPWR(X,NXBODY,LX,1)  

 ************************************************************
  Group 4. Z-Direction Grid Spacing
 NZBODY = 10
 GRDPWR(Z,NZBODY,LZ,1)  
 ************************************************************
  Group 5. Z-Direction Grid Spacing
 NY=1
 YVLAST  = 0.001
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS  =    T
 SOLVE(P1,W1,U1)
 SOLUTN(P1  ,Y,Y,Y,N,N,N)
 SOLUTN(U1  ,Y,Y,Y,N,N,Y)
 SOLUTN(W1  ,Y,Y,Y,N,N,Y)
 
 STORE(PRPS,DRH1,VISL)     ! Necessary to save storage DRH1,VISL 
 STORE(STRX,STRY,STRZ,STXZ)
 STORE(EPSY,EPSX,EPSZ)

 STORE(U1T,W1T,U1/T,W1/T)

 ************************************************************
  GROUP 8. ITERATION NUMBERS ETC
RESFAC=1.e-7
RESREF(W1)=0.0 
RESREF(U1)=0.0  ! to prevent premature exit
LITER(W1) = 20 ! from solver
LITER(U1) = 20 
LITER(P1) = 20 

 ************************************************************
  GROUP 9. PROPERTIES
  
 CSG10='Q1'                  ! material properties
  MATFLG=T;NMAT=1         
  160    7800.0    0.3       473.0   43.0      1.0e-5   0.5e-11 
 
 ************************************************************
  GROUP 11. INITIAL VALUES
fiinit(p1)=0.0
fiinit(u1)=0.0
fiinit(w1)=0.0
 
FIINIT(PRPS)=160

 ************************************************************
  GROUP 13. BOUNDARY & SPECIAL SOURCES
 
PATCH(UP,HWALL,1,NX,1,1,NZ,NZ,1,1)   ! high edge fixed
COVAL(UP,W1,1,0.0)

PATCH(FORS01,HIGH,1,NX,1,1,1,1,1,1)  ! low edge appplied
COVAL(FORS01,W1,FIXFLU,FZ)

PATCH(AXESZZ,WWALL,1,1,1,1,1,NZ,1,1) ! west edge fixed
COVAL(AXESZZ,U1,1,0.0)

IF(CASENO.EQ.2) THEN
SPEDAT(BOUNDARY,YCONST,R,1.e20)
ELSE
SPEDAT(BOUNDARY,YCONST,R,0.0)
ENDIF 
 ************************************************************
  GROUP 15. TERMINATE SWEEPS
 LSWEEP  =      100
 ISG21=LSWEEP
 ************************************************************
  GROUP 17. RELAXATION
 RELAX(P1  ,LINRLX, 1.000000E+00)
     spedat(rlxfac,rlxu1d,r,0.5)  
     spedat(rlxfac,rlxw1d,r,0.5)  

 ************************************************************
  GROUP 19. DATA TRANSMITTED TO GROUND
 STRA    =    T
 PARSOL  =    F
 ISG52   =    3   !   probe & res

 ************************************************************
  GROUP 23.FIELD PRINT-OUT & PLOT CONTROL
TSTSWP = - 1   ! graphic-mode
nxprin= 2
nzprin= 2
IXMON = NX/2
IYMON = 1
IZMON = NZ-2
      
#maxmin
#endpause
#$s003

  inform7begin
real(CEPSX,CEPSZ,CEPS)
IF(CASENO.EQ.2) THEN
 CEPSX = FZ/YOUNG*(1+POISSON)*POISSON
 CEPSZ =  -FZ/YOUNG*(1-POISSON**2)
ELSE
 CEPSX = FZ/YOUNG*POISSON
 CEPSZ =  -FZ/YOUNG
ENDIF
CEPS = CEPSX+CEPSZ
CEPSX
CEPSZ 
CEPS

   **** CALCULATE analytical solution ***
(STORED VAR U1T IS :CEPSX:*XU)
(STORED VAR W1T IS :CEPSZ:*(ZZW -:LZ:))

(STORED VAR U1/T IS U1/(U1T+1.e-20) with imat>100)
(STORED VAR W1/T IS W1/(W1T+1.e-20) with imat>100)

  inform7end

STOP