PHOTON USE
    x
    x1


    msg(  PLANT generated grid
    up z
    rot z ang 60
    gr z 7 y 1 5
    gr y 6 z 1 6
    gr z 1 x 1 5
    gr z 1 x 15 m
    gr z m x 6 14
    gr y m x 6 14 z 1 m
    ENDUSE

  DISPLAY

    PLANT is used to create body-fittted-coordinate grids
    defined by formulae.
    

    Example: 3D chamber with obliquely cut cylinder
  ENDDIS

TEXT( 3D chamber with cut cylinder

    GROUP 6. Body-fitted coordinates or grid distortion
nx=18;ny=16;nz=15
bfc=t;store(mark)
dumpc(grid);readco(grid)
CSG1=PHI;CSG2=XYZ;lsweep=1;idispa=1
NAMSAT=MOSG

    PLANTBEGIN
real(twopi,littler)
littler=1.0;twopi=2.0*3.14157
    XC=:LITTLER:*FLOAT(J-1)/FLOAT(NY)*   $
                COS(:TWOPI:*FLOAT(I-1)/FLOAT(NX))
    YC=-:LITTLER:*FLOAT(J-1)/FLOAT(NY)*   $
                SIN(:TWOPI:*FLOAT(I-1)/FLOAT(NX))
    ZC=2.*FLOAT(K-1)/FLOAT(NZ)+$
        FLOAT(K-1)/FLOAT(NZ)*0.75*YC*$
        AMAX1(0.,FLOAT(7-K)/ABS(FLOAT(7-K)+TINY))+$
        (1-FLOAT(11-K)/FLOAT(NZ))*0.5*YC*$
        AMAX1(0.,FLOAT(K-6)/ABS(FLOAT(K-6)+TINY))-$
        (1-FLOAT(11-K)/FLOAT(NZ))*0.5*YC*$
        AMAX1(0.,FLOAT(K-11)/ABS(FLOAT(K-11)+TINY))+$
        (1-FLOAT(K-1)/FLOAT(NZ))*1.5*YC*$
        AMAX1(0.,FLOAT(K-11)/ABS(FLOAT(K-11)+TINY))
     PLANTEND

dmpstk=t
DISTIL=T
EX(MARK)=1.000E-10
 LIBREF=510
STOP