TALK=f;RUN(1,1)
  DISPLAY
    A rectangular plate with a centrally-placed CIRCULAR hole is
  extended by uniform equal forces on its Top and Bottom
  surfaces, which are allowed to distort.
  By reason of symmetry, only one quarter of the plate is analysed.
  For calculation is used POLAR coordinates and Boundary Flow 
  Cells.
  Comparison - a analytical solution (Timoshenko )
  
  Boundary Condition:
  ===================
  
  V ( UR) :
  ---------
  Y = RO :   StrY = FX/2*(1-RI^2/RO^2) + FX/2*(1 + 3*RI^4/RO^4 - 
      4*RI^2/RO^2)*COS(2*X)  
               
  U ( UTeta) :
  ------------
  X = 0, PI/2 :  U = 0,
  Y = RO      :  StXY = - FX/2 * (1 - 3*RI^4/RO^4 + 2*RI^2/RO^2)
      *SIN(2*X)
  
  Exact Solution:   
  ===============
  Displacements
  -------------
  V = FX/(2*E)* R* {(1-P) + RI^2/R^2*(1+P) + [(1 - RI^4/R^4)*(1+P)
      + 4*RI^2/R^2]*COS(2*X) }
  U = -FX/(2*E)* R* [(1 + RI^4/R^4)*(1+P) + 2*RI^2/R^2*(1-P)]*
       SIN(2*X)  
  
  Strains
  -------
  EpsY  = FX/(2*E)* {(1-P) - RI^2/R^2*(1+P) + [(1+P)*(1 + 
          3*RI^4/R^4) - 4*RI^2/R^2]*COS(2*X)} 
  EpsX  = FX/(2*E)* {(1-P) + RI^2/R^2*(1+P) - [(1+P)*(1 + 
          3*RI^4/R^4) - P * 4*RI^2/R^2]*COS(2*X)} 
  EpsZ  = - P * FX/(2*E) * [ 2 - 4*RI^2/R^2*COS(2*X) ]
  D     = FX/E*(1-2*P) * [1 - 2*RI^2/R^2*COS(2*X) ]
  

  Stress
  ------
  StrY = FX/2*(1-RI^2/R^2) + FX/2*(1 + 3*RI^4/R^4 - 4*RI^2/R^2)*
         COS(2*X)  
  StrX = FX/2*(1+RI^2/R^2) - FX/2*(1 + 3*RI^4/R^4)*COS(2*X)  
  StXY = - FX/2 * (1 - 3*RI^4/R^4 + 2*RI^2/R^2)*SIN(2*X)
  StrZ = 0
  ENDDIS
  
  PHOTON USE
  p;;;;
  
  
  set prop off
  msg
  msg Grid
  msg
  gr Z 1
  pause
  
  cl
  msg
  msg V1 contours
  msg
  cont V1 z 1 fil;.0001
  vec z 1 col 0
  pause
  
  cl
  msg
  msg V1TH contours
  msg
  cont V1TH z 1 fil;.0001
  pause

  cl
  msg
  msg V1/T contours
  msg
  cont V1/T z 1 fil;.0001
  pause
  
  
  cl
  msg
  msg U1 contours
  msg
  cont U1 z 1 fil;.0001
  vec z 1 col 0
  pause

  cl
  msg
  msg U1TH contours
  msg
  cont U1TH z 1 fil;.0001
  pause

  cl
  msg
  msg U1/T contours
  msg
  cont U1/T z 1 fil;.0001
  pause

  cl
  msg
  msg STRX contours
  msg
  cont STRX z 1 fil;.0001
  pause
    
  cl
  msg
  msg SXTH contours
  msg
  cont SXTH z 1 fil;.0001
  pause

  cl
  msg
  msg SX/T contours
  msg
  cont SX/T z 1 fil;.0001
  pause

  cl
  msg
  msg STRY contours
  msg
  cont STRY z 1 fil;.0001
  pause

  cl
  msg
  msg SYTH contours
  msg
  cont SYTH z 1 fil;.0001
  pause

  cl
  msg
  msg SY/T contours
  msg
  cont SY/T z 1 fil;.0001
  pause

  cl
  msg
  msg STXY contours
  msg
  cont STXY z 1 fil;.0001
  pause

  cl
  msg
  msg XYTH contours
  msg
  cont XYTH z 1 fil;.0001
  pause
  
  ENDUSE

 ************************************************************
  Group 1. Run Title and Number
 ************************************************************
READQ1=T
 TEXT(Polar Plate with CIRCULAR hole
 
  Declarations and settings
  
REAL(RI,RO,POISSON,YOUNG,FX,LR,LTETA,LLX) 

RI=0.5   ! inner radius
RO=2     ! outer radius
LR = RO-RI
FX= 1.0e4  
LTETA=3.1416/2
LLX = LTETA*0.01

YOUNG   = 1/(0.5E-11) ! Young's modulus
POISSON=0.3           ! Poisson's ratio

integer(NXCYL,NYCYL)

  Grid settings
NYCYL =30 
NXCYL =20
NZ    = 1  

integer(CaseDBG)
CaseDBG = 0


  **** !!! ***
ISG59 = 1


 ************************************************************
 
 ************************************************************
  Group 2. Time dependence
 STEADY  =    T
 ************************************************************
  Group 3. X-Direction Grid Spacing
 CARTES  =    F
 NREGX=3
 IREGX=1;GRDPWR(X,1,LLX,1.0)
 IREGX=2;GRDPWR(X,NXCYL,LTETA,1)
 IREGX=3;GRDPWR(X,1,LLX,1.0)
 
 ************************************************************
  Group 4. Y-Direction Grid Spacing
 RINNER = RI - 0.01*LR
 NREGY=3
 IREGY=1;GRDPWR(Y,1,0.01*LR,1.0)
 IREGY=2;GRDPWR(Y,NYCYL,LR,1.4)
 IREGY=3;GRDPWR(Y,1,0.01*LR,1.0)
 ************************************************************
  Group 5. Z-Direction Grid Spacing
 ZWLAST  = 0.5E+00
 GRDPWR(Z,NZ,1.0,1.0)              ! uniform z grid
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS  =    T
 SOLVE(P1,V1,U1)
 STORE(PRPS)
 STORE(PRPS,DEN1,ENUL,DVO1,DRH1)
 STORE(EPSX,EPSY,EPSZ)
 STORE(EXTH,EYTH,EZTH)
 STORE(STRX,STRY,STXY)
 STORE(SXTH,SYTH,XYTH)
 STORE(SX/T,SY/T,XY/T)
 STORE(P1TH)
 STORE(U1TH,V1TH,U1/T,V1/T,P1/T)
 STORE(EX/T,EY/T,EZ/T)

 ************************************************************
  GROUP 8. ITERATION NUMBERS ETC
 RESFAC=1.e-7 

 RESREF(V1)=0.0
 RESREF(u1)=0.0
 LITER(V1) = 40
 LITER(U1) = 40
 
    spedat(rlxfac,rlxu1d,r,0.4)  
    spedat(rlxfac,rlxv1d,r,0.4)  


 ************************************************************
  GROUP 9. PROPERTIES
  
 CSG10='Q1'                  ! materials with various POISSON ratios
  MATFLG=T;NMAT=1         
  160    7800.0    0.3       473.0   43.0      1.0e-5   0.5E-11 
 
 ************************************************************
  GROUP 11. INITIAL VALUES
FIINIT(PRPS)=0
PATCH(BODY,INIVAL,2,NX-1,2,NY-1,1,1,1,1)
INIT(BODY,PRPS,FIXVAL,160)

 ************************************************************
  GROUP 13. BOUNDARY & SPECIAL SOURCES


  ********* Exact Solution: Stress ********
char(ag2,ag4,av2,av4)
real(FX2)
FX2=FX/2
ag2=(:RI:/RG)^2
ag4=(:RI:/RG)^4
av2=(:RI:/RV)^2
av4=(:RI:/RV)^4

char(bg,bu)
bg=(XG-:LLX:)
bu=(XU-:LLX:)
char(FSY1,FSY2,FBY1,FBY2, FSX1,FSX2,FSXY1,FSXY2)
FSY1=:FX2:*((1-:ag2:)+(1+3*:ag4:
FSY2=-4*:ag2:)*COS(2*:bg:))

FBY1=:FX2:*((1-:av2:)+(1+3*:av4:
FBY2=-4*:av2:)*COS(2*:bg:))

FSX1=:FX2:*((1+:ag2:)-(1+3*:ag4:)
FSX2=*COS(2*:bg:)) 
FSXY1=-:FX2:*(1-3*:av4:+2*:av2:)
FSXY2=*SIN(2*:bu:)
(STORED VAR SXTH IS :FSX1::FSX2: with imat>100)
(STORED VAR SX/T IS STRX/SXTH with imat>100)
(STORED VAR SYTH IS :FSY1::FSY2: with imat>100)
(STORED VAR SY/T IS STRY/SYTH with imat>100)
(STORED VAR XYTH IS :FSXY1::FSXY2: with imat>100)
(STORED VAR XY/T IS STXY/XYTH with imat>100)


 ****** Polar Source for U ****
    STORE(PUTH)
    char(FPOU1,FPOU2) 
    real(FX211)
    FX211 = FX2*1.e-11
    FPOU1=-:FX211:*(1-3*:ag4:+2*:ag2:)
    FPOU2=*SIN(2*:bu:)/RG
    (STORED VAR PUTH IS :FPOU1::FPOU2: with imat>100)


  ********* Exact Solution: Displacement ********
char(FU1,FU2,FV1,FV2,FV3)
real(ONEPLP,ONEMNP,FX2E)
ONEPLP = 1.0 + POISSON
ONEMNP = 1.0 - POISSON
FX2E = FX/2/YOUNG


FU1=-:FX2E:*RG*(:ONEPLP:*(1+:ag4:)+2*:ag2:
FU2=*:ONEMNP:)*SIN(2*:bu:)

FV1=:FX2E:*RV*(:ONEMNP:+:av2:*:ONEPLP:+
FV2=((1-:av4:)*:ONEPLP:+4*:av2:)
FV3=*COS(2*:bg:))

(STORED VAR U1TH IS :FU1::FU2: with imat>100)
(STORED VAR U1/T IS U1/U1TH with imat>100)

(STORED VAR V1TH IS :FV1::FV2::FV3: with imat>100)
(STORED VAR V1/T IS V1/V1TH with imat>100)

 ********* Exact Solution: Strains ********
char(FEY1,FEY2,FEX1,FEX2,FEX3,FEZ,FEP)
real(FXZ,FXP)
FXZ = -POISSON*FX/2/YOUNG
FXP = FX/YOUNG*(1-2*POISSON)

FEX1=:FX2E:*(:ONEMNP:+:ag2:*:ONEPLP:-(:ONEPLP:*
FEX2=(1+3*:ag4:)-4*:ag2:*POISSON)
FEX3=*COS(2*:bg:))

FEY1=:FX2E:*(:ONEMNP:-:ag2:*:ONEPLP:+(:ONEPLP:*
FEY2=(1+3*:ag4:)-4*:ag2:)*COS(2*:bg:))

FEZ=:FXZ:*(2 - 4*:ag2:*COS(2*:bg:))
FEP=:FXP:*(1 - 2*:ag2:*COS(2*:bg:))

(STORED VAR EXTH IS :FEX1::FEX2::FEX3: with imat>100)
(STORED VAR EX/T IS EPSX/EXTH with imat>100)

(STORED VAR EYTH IS :FEY1::FEY2: with imat>100)
(STORED VAR EY/T IS EPSY/EYTH with imat>100)

(STORED VAR EZTH IS :FEZ: with imat>100)
(STORED VAR EZ/T IS EPSZ/EZTH with imat>100)

(STORED VAR P1TH IS :FEP: with imat>100)
(STORED VAR P1/T IS P1/P1TH with imat>100)

   ************* BC *****************************
PATCH(dmn,cell,1,NX,1,ny,1,1,1,1)
COVAL(DMN,p1,FIXVAL,0)

  --------- V1 (VR) --------------------- 
PATCH(OUTV,NORTH,2,NX-1,NY-1,NY-1,1,1,1,1)
(source of V1 at OUTV is COVAL(FIXFLU,:FBY1::FBY2:))
  --------- U1 (VTeta) --------------------- 
PATCH(LOWX,WEST,1,1,2,ny-1,1,1,1,1)
coval(LOWX,U1,1.e6,0.0)

PATCH(HIGHX,EAST,NX-1,NX-1,2,ny-1,1,1,1,1)
coval(HIGHX,U1,1.e6,0.0)

PATCH(OUTU,NORTH,1,NX-1,NY-1,NY-1,1,1,1,1)
(source of U1 at OUTU is COVAL(FIXFLU,:FSXY1::FSXY2:))

 ************************************************************
  GROUP 15. TERMINATE SWEEPS
 LSWEEP  =  400 
 ISG21   =  LSWEEP
 ENDIT(V1) =0.0
 RESREF(V1)=0.0                                   
 ENDIT(u1) =0.0
 RESREF(u1)=0.0                                   
 ************************************************************
  GROUP 17. RELAXATION
#CONPROM
 ************************************************************
  GROUP 19. DATA TRANSMITTED TO GROUND
 STRA    =    T
 ************************************************************
  GROUP 23.FIELD PRINT-OUT & PLOT CONTROL
TSTSWP = - 1   ! graphic-mode
      ISG52   =    3   !   probe & res

#maxmin



output(den1,n,n,n,n,n,n)  
output(drh1,n,n,n,n,n,n)  
output(dvo1,n,n,n,n,n,n)  
output(enul,n,n,n,n,n,n)  
output(prps,n,n,n,n,n,n)  
IXMON = NX/2
IYMON = NY-1
IZMON = 1



   ******* RESIDUALS ! ********
if(CaseDBG.NE.0) then
 LSWEEP  =       1 
 PATCH(BODY_XX,INIVAL,1,NX-1,1,ny,1,1,1,1)
 (INITIAL of U1 at BODY_XX is :FU1::FU2:)
 PATCH(BODY_YY,INIVAL,1,NX,1,NY-1,1,1,1,1)
 (INITIAL of V1 at BODY_YY is :FV1::FV2::FV3:)
 (stored var v1rs is resi(v1))
 (stored var u1rs is resi(u1))
 (stored var u1an is anco(u1))
 (stored var u1as is asco(u1))
 (stored var u1ae is aeco(u1))
 (stored var u1aw is awco(u1))
 (stored var u1ap is apco(u1))
 STORE(DIFU,GRDU,TANU)
 STORE(POLU)

PATCH(BD_YY,CELL,1,NX,1,ny-1,1,1,1,1)
(SOURCE of V1 at BD_YY is COVAL(1.e5,:FV1::FV2::FV3:))

   PATCH(BD_XX,CELL,1,NX-1,1,ny,1,1,1,1)
   (SOURCE of U1 at BD_XX is COVAL(1.e5,:FU1::FU2:))

NYPRIN=1
NXPRIN=1


endif
STOP