TEXT(GSET COMMAND TUTORIAL 1            :B538
TITLE
  display
#$b001
     This Q1 demonstrates the use of 5 operations used
     for the creation of BFC grids, namely:
     * defining points,
     * defining lines,
     * defining frames,
     * setting grid dimensions, and
     * matching a grid to a frame.
 
     Those operations are used here in order to:
     1. create a circle,
     2. create a square, and
     3. to match them to the two sides of a constant-I plane,
        (namely I2 and I1 respectively).
IVIEW=2
     The relevant PIL commands will be displayed, then processed.
     The first sets the grid type to BFC
CT1=BFC=T
#$b002
 
REAL(RADIUS,ROOT,SIDE)
 
     Please enter the circle radius (default 0.25m)
READVDU(radius,real,0.25)
     Please enter the side-length of the square (default 0.5m)
READVDU(side,real,0.5)
INTEGER(NAB,NBC)
root=0.707*radius
#$021
     The input data to be used in this example are..
mesg(    radius=:radius:
mesg(    side  =:side:
 
     The centre of the circle will be placed at:
     x = 0.0
     y = - square root of 2 times the radius
     z = + square root of 2 times the radius
 
mesg(square root of 2 times the radius, called root, = :root:
 
     Now define points A,B,C and D, positioned as follows:
       A at (0,-root,root)
       B at (0,root,root)
       C at (0,root,-root)
       D at (0,-root,-root)
     by the commands:
     for A
CT1=GSET(P,A,0,-root,root)
#$b003
     for B
CT1=GSET(P,B,0,root,root)
#$b003
     for C
CT1=GSET(P,C,0,root,-root)
#$b003
     and for D
CT1=GSET(P,D,0,-root,-root)
#$b003
#$021
     Now draw four arcs (AB,BC,CD,DA) from A to D
     to create a circle.
     Arcs AB and CD must have equal numbers of intervals;
     so must arcs BC and DA.
     The intervals will be supposed uniform on each arc.
 
     Please enter nab, the number of cells for AB and CD (default 5)
readvdu(nab,int,5)
     The command to create arc AB, with nab uniform intervals,
     which also goes through the point (0,0,radius),
     is:
CT1=GSET(L,AB,A,B,NAB,1.0,ARC,0,0,RADIUS)
#$b003
 
     Please enter nbc, the number of cells for BC and DA (default 5)
readvdu(nbc,int,5)
     The command to create arc BC, with nbc cells
     which also goes through the point (0,0,radius),
     is:
CT1=GSET(L,BC,B,C,NBC,1.0,ARC,0,RADIUS,0)
#$b003
     The corresponding command for CD is:
CT1=GSET(L,CD,C,D,nab,1.0,ARC,0,0,-RADIUS)
#$b003
     and for DA:
CT1=GSET(L,DA,D,A,nbc,1.0,ARC,0,-radius,0)
#$b003
 
     Now define a frame ABCD which has corner points
     A,B,C & D by the command:
 
CT1=GSET(F,ABCD,A,-,B,-,C,-,D,-)
#$b003
 
     Now set the BFC grid dimension as 1 x nab x nbc, with
     reference length 1m x side x side, by the command:
 
CT1=GSET(D,1,nab,nbc,1,side,side)
#$b003
 
     Now match grid plane I2 on frame ABCD using the
     trans-finite method, by the command:
CT1=GSET(M,ABCD,+J-K,2,1,nbc+1,TRANS)
#$b003
 
     Now create the square on plane I = 1
iview=1
     Define points E,F,G and H, with positions:
       E at (-side,-side/2,side/2)
       F at (-side,side/2,side/2)
       G at (-side,side/2,-side/2)
       H at (-side,-side/2,-side/2)
     by the commands:
     for E:
CT1=GSET(P,E,-SIDE,-SIDE/2,SIDE/2)
#$b003
     for F:
CT1=GSET(P,F,-SIDE,SIDE/2,SIDE/2)
#$b003
     for G:
CT1=GSET(P,G,-SIDE,SIDE/2,-SIDE/2)
#$b003
     and for H:
CT1=GSET(P,H,-side,-side/2,-side/2)
#$b003
     Now draw four lines (EF, FG, GH, HE) from E to H
     to create a square.
     Lines EF & GH each have nab uniformly-distributed intervals,
     and lines FG & HE each have nbc uniformly-distributed
     intervals, so as to match the numbers of intervals on the
     circle.
 
     The commands are:
CT1=GSET(L,EF,E,F,NAB,1.0)
#$b003
     then
CT1=GSET(L,FG,F,G,NBC,1.0)
#$b003
     then
CT1=GSET(L,GH,G,H,NAB,1.0)
#$b003
     and finally
CT1=GSET(L,HE,H,E,nbc,1.0)
#$b003
 
     Now define a frame EFGH (square) which has corner points
     E, F, G and H, by the command:
CT1=GSET(F,EFGH,E,-,F,-,G,-,H,-)
#$b003
 
     Now match grid plane I1 on frame EFGH using the trans-finite
     by the command:
CT1=GSET(M,EFGH,+J-K,1,1,nbc+1,TRANS)
#$B004)
 
     This completes the exercise.
 
     However, you may now wish to type VIEW, so as to be able to
     inspect, or indeed alter, the grid by means of the graphical
     grid generator.
  enddis