TALK=f;RUN(1,1)
  DISPLAY
  A rectangular block of dimensions LX * LY * LZ is 
  * held fixed at it north, west and low faces
  * subjected to uniform compression at its south face
  * allowed to contract freely along its east and high faces
  
  The distributions of displacement in the xy 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
  con disy x 10 y 1 10 z 1 10 fi;0.001
  con disy y 10 x 1 10 z 1 10 fi;0.001
  con disy z 10 y 1 10 x 1 10 fi;0.001
  pause
  con disx x 10 y 1 10 z 1 10 fi;0.001
  con disx y 10 x 1 10 z 1 10 fi;0.001
  con disx z 10 y 1 10 x 1 10 fi;0.001
  enduse

 ************************************************************
  Group 1. Run Title and Number
 ************************************************************
TEXT(3D block in y-direction compression
  Declarations and settings
REAL(FY,LX,LY,LZ,POISSON,YOUNG) 
FY= 40.0e6  ! H/m^2 = 40 N/mm^2
LX=90.e-3
LZ=90.e-3
LY=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, which the simulation uses.
INTEGER(NXBODY,NYBODY,NZBODY)

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

 ************************************************************
  Group 4. Y-Direction Grid Spacing
 NYBODY = 10
 GRDPWR(Y,NYBODY,LY,1)  
 ************************************************************
  Group 5. Z-Direction Grid Spacing
 NZBODY = 10
 GRDPWR(Z,NZBODY,LZ,1)  
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS  =    T
 SOLVE(DISX,DISY,DISZ)
 SOLUTN(DISX  ,Y,Y,Y,N,N,Y)
 SOLUTN(DISY  ,Y,Y,Y,N,N,Y)
 SOLUTN(DISZ  ,Y,Y,Y,N,N,Y)
 
 STORE(PRPS,DRH1,VISL) 
 STORE(STRX,STRY,STRZ,STXY,STXZ,STYZ)
 STORE(EPSY,EPSX,EPSZ)
 STORE(U1T,V1T,W1T,U1/T,V1/T,W1/T)

 ************************************************************
  GROUP 8. ITERATION NUMBERS ETC

 ************************************************************
  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(disx)=0.0
fiinit(disy)=0.0
fiinit(disz)=0.0
 
FIINIT(PRPS)=160

 ************************************************************
  GROUP 13. BOUNDARY & SPECIAL SOURCES
 
PATCH(UP,NWALL,1,NX,NY,NY,1,NZ,1,1)    ! north face fixed 
COVAL(UP,disy,1,0.0)

PATCH(FORs01,SOUTH,1,NX,1,1,1,NZ,1,1)  ! south face compressed
COVAL(FORs01,disy,FIXFLU,FY)

PATCH(AXESXX,WWALL,1,1,1,NY,1,NZ,1,1)  ! west face fixed
COVAL(AXESXX,disx,1,0.0)

PATCH(AXESZZ,LWALL,1,NX,1,NY,1,1,1,1)  ! low face fixed
COVAL(AXESZZ,disz,1,0.0)

 ************************************************************
  GROUP 15. TERMINATE SWEEPS
 LSWEEP  =      100
 ISG21=LSWEEP
 ************************************************************
  GROUP 17. RELAXATION
 ************************************************************
  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
IXMON = NX-2
IYMON = 2
IZMON = NZ-2
     #maxmin
#endpause
#$s003

output(prps,n,n,n,n,n,n) 
output(drh1,n,n,n,n,n,n) 
output(visl,n,n,n,n,n,n) 



  inform7begin
real(CEPSX,CEPSY,CEPSZ,CEPS,DDZZ)
DDZZ = LZ/NZBODY
CEPSX = FY/YOUNG*POISSON
CEPSY =  -FY/YOUNG
CEPSZ =  CEPSX
CEPS = CEPSX+CEPSY+CEPSZ
CEPSX
CEPSY
CEPSZ  
CEPS
   **** CALCULATE analytical solution ***
(STORED VAR W1T IS :CEPSZ:*ZG)
(STORED VAR U1T IS :CEPSX:*XG)
(STORED VAR V1T IS :CEPSY:*(YG -:LY:))

(STORED VAR U1/T IS disx/(U1T+1.e-20))
(STORED VAR V1/T IS disy/(V1T+1.e-20))
(STORED VAR W1/T IS disz/(W1T+1.e-20))

  inform7end

STOP