PHOTON USE
  p
 
 
 
  msg             Numerical solution  contours
  con C1 Z M fi;0.001
  con C1 Y M fi;0.001
  con C1 X M fi;0.001
  gr ou x m;gr ou y m;gr ou z m
  msg Press Enter to continue
  PAUSE
  CLEAR
  con EXAC Z M fi;0.001
  con EXAC Y M fi;0.001
  con EXAC X M fi;0.001
  gr ou x m;gr ou y m;gr ou z m
  msg               Exact solution  contours
  msg Press e to END
  ENDUSE
 
    GROUP 1. Run title and other preliminaries
 
  DISPLAY
    Three dimensional diffusion problem which can be tested against
    exact solution fields.  
  ENDDIS
 
TEXT( 3D DIFFUSION PROBLEM:118
NX=5;NY=5;NZ=5
    GROUP 3. X-direction grid specification
GRDPWR(X,NX,1,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,NY,1,1.0)
    GROUP 5. Z-direction grid specification
GRDPWR(Z,NZ,1,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(C1)
    * Solve whole-field
SOLUTN(C1,Y,Y,Y,N,N,N)
    GROUP 8. Terms (in differential equations) & devices
TERMS(C1,N,N,Y,P,P,P)
    GROUP 9. Properties of the medium (or media)
RHO1=1.0;PRNDTL(C1)=1.0;ENUL=1.
    GROUP 13. Boundary conditions and special sources

  PLANTBEGIN
PATCH(DIFWES,WWALL,1,1,1,NY,1,NZ,1,LSTEP)
   VAL=-YG2D**2-ZGNZ**2
COVAL(DIFWES,C1,1.,GRND)
 
PATCH(DIFNOR,NWALL,1,NX,NY,NY,1,NZ,1,LSTEP)
   VAL=2.*XG2D**2-1.-ZGNZ**2
COVAL(DIFNOR,C1,1.,GRND)
 
PATCH(DIFEAS,EWALL,NX,NX,1,NY,1,NZ,1,LSTEP)
   VAL=2.-YG2D**2-ZGNZ**2
COVAL(DIFEAS,C1,1.,GRND)
 
PATCH(DIFSOU,SWALL,1,NX,1,1,1,NZ,1,LSTEP)
   VAL=2.*XG2D**2-ZGNZ**2
COVAL(DIFSOU,C1,1.,GRND)
 
PATCH(DIFHIG,HWALL,1,NX,1,NY,NZ,NZ,1,LSTEP)
   VAL=2.*XG2D**2-YG2D**2-1.
COVAL(DIFHIG,C1,1.,GRND)
 
PATCH(DIFLOW,LWALL,1,NX,1,NY,1,1,1,LSTEP)
   VAL=2.*XG2D**2-YG2D**2
COVAL(DIFLOW,C1,1.,GRND)
  
STORE(EXAC)
   EXAC=2.*XG2D**2-YG2D**2-ZGNZ**2
  PLANTEND

    GROUP 15. Termination of sweeps
LSWEEP=3
    GROUP 19.
NAMSAT=MOSG
    GROUP 20. Preliminary print-out
    GROUP 21. Print-out of variables
tstswp=-1
dmpstk=t
DISTIL=T
 LIBREF=118
EX(C1)=5.782E-01; EX(EXAC)=5.786E-01
STOP