photon use
  p;;;;;
  gr ou x 1;  gr ou x m
  gr ou y 1;  gr ou y m
  gr ou z 1;  gr ou z m
  sur wdis x 0.2 col 1; sur wdis y 0.2 col 1; sur wdis z 0.2 col 1
  sur wdis x 0.1 col 8; sur wdis y 0.1 col 8; sur wdis z 0.1 col 8
  vi
  1 2 3
  pause
  vi z 1
  pause;cl
  con wdis z 10 fi;0.001
  pause;cl
  con wgap z 10 fi;0.001
  enduse
 
 TEXT(Wall Distance Distribution Within A Box
 TITLE
  DISPLAY
  ******************************************************************
  This short Q1 file concerns the application of the wall-distance
  calculation scheme of PHOENICS to the inside of a box.
  **
  Interesting variants of the data include:
  the box dimensions (vary VYLAST and/or ZWLAST, say);
  the number of walls (move WALL lines 2 spaces right to remove);
  the plotted iso-distance surfaces plotted by PHOTON (vary the 0.1
                               and 0.2 in the PHOTON USE sequence);
  setting CARTES=F and RINNER=yvlast/2, say;
  introducing a central blockage.
  ******************************************************************
  ENDDIS
#pause
  ** Declarations **
BOOLEAN(BLOCK)
 
  ** Settings **
BLOCK=F
NX=20; NY=20; NZ=20
XULAST=1.0; YVLAST=1.0; ZWLAST=1.0
CARTES=T; RINNER=YVLAST/2
#UNIGRID
SOLVE(LTLS)
STORE(WGAP,WDIS)
  ** messages to screen **
LABEL DISPLAY
#cls
MESG(x, y & z dimensions are.. :xulast:, :yvlast:, :zwlast:
IF(CARTES) THEN
 MESG(grid is cartesian
ELSE
 MESG(grid is cylindrical polar
ENDIF
IF(BLOCK) THEN
 MESG(there is a central blockage
ELSE                                                S
 MESG(the box is empty
ENDIF
 
  ** Questions **
MESG(Are data settings OK? (Y/n)
READVDU(ANS,CHAR,Y)
ANS
IF(:ANS:.EQ.Y) THEN
 GOTO PROCEED
ELSE
 IF(CARTES) THEN
 + MESG(change to polar grid? (Y/n)
 + READVDU(ANS,CHAR,Y)
 + IF(:ANS:.EQ.Y) THEN
 +  CARTES=F
 +  GOTO DISPLAY
 + ENDIF
 ENDIF
 IF(.NOT.BLOCK) THEN
 + MESG(introduce blockage? (Y/n)
 + READVDU(ANS,CHAR,Y)
 + IF(:ANS:.EQ.Y) THEN
 +   BLOCK=T
 +   GOTO DISPLAY
 + ENDIF
 ENDIF
 MESG(change dimensions of box? (Y/n)
 READVDU(ANS,CHAR,Y)
 IF(:ANS:.EQ.Y) THEN
 + MESG(x-dimension is :xulast: . New value?
 + MESG(in metres if cartesian, otherwise radians
 + READVDU(XULAST,REAL,XULAST)
 + MESG(y-dimension is :yvlast: . New value?
 + READVDU(YVLAST,REAL,YVLAST)
 + MESG(z-dimension is :zwlast: . New value?
 + READVDU(ZWLAST,REAL,ZWLAST)
 + IF(.NOT.CARTES) THEN
 +   MESG(Inner radius = :rinner: . New value?)
 +   READVDU(RINNER,REAL,RINNER)
 + ENDIF
 + GOTO DISPLAY
 ENDIF
ENDIF
LABEL PROCEED
IF(BLOCK) THEN
 STORE(PRPS)
 PATCH(BLOCK,INIVAL,NX/4+1,3*NX/4,NY/4+1,3*NY/4,NZ/4+1,3*NZ/4,1,1)
 COVAL(BLOCK,PRPS,0.0,100.0)
ENDIF
WALL(W,WEST ,1,1  ,1,NY ,1,NZ ,1,1)
WALL(E,EAST ,NX,NX,1,NY ,1,NZ ,1,1)
WALL(N,NORTH,1,NX ,NY,NY,1,NZ ,1,1)
WALL(S,SOUTH,1,NX ,1,1 ,1,NZ ,1,1)
WALL(H,HIGH ,1,NX ,1,NY ,NZ,NZ,1,1)
WALL(L,LOW  ,1,NX ,1,NY ,1,1  ,1,1)
STOP