```
*
#\$b001
display
*

This example Q1 demonstrates the use line-curve
option for BFC-type grid. This option is used to
create a spline curve between two end-points through
the user-set points, and with the user-set starting
end ending curvature.
In this example, line-curvature is used to create
car-body-like profile which is then copied to
create simplified car body.

CT1=TEXT(CURVATURE_FOR_CAR_BODY              B541
#\$b002
*
Set the grid type to BFC
CT1=BFC=T
#\$b002
*
REAL(LENGTH,CL,HEIGHT,WIDTH)

Enter the overall length of the car (default 3.85m)
READVDU(length,real,3.85)
INTEGER(NAB,NBC)
Characteristic length(CL) is calculated as length/55
Input data used in this example:
CL=LENGTH/55
HEIGHT=20*CL
WIDTH=22*CL
MESG(  car length = :length: CL=:cl:
MESG(  car height = CL*20 = :height:
MESG(  car width  = CL*22 = :width:

*

-- Create a car profile --
Define points A,B,C and D
Point A positioned at (0,0,0)
GSET(P,A,0,0,0)
GSET(P,A,0,0,0)
Point B positioned at (0,1.05,0.84)
GSET(P,B,0,cl*15,cl*12)
GSET(P,B,0,1.0500E+00,8.4000E-01)
GSET(P,C,0,1.9600E+00,1.4000E+00)
Point C positioned at (0,1.96,1.4)
GSET(P,C,0,cl*28,cl*20)
Point D positioned at (0,3.85,0)
CT1=GSET(P,D,0,length,0)
#\$b003
*
Draw four curves (AB,BC,CD,DA) from A to D
to create a car-profile.
Lines AB&CD must have equal number of cells, as
well as lines BC&DA. Power is set to 1.0, ie. cells
are uniformly distributed.

Enter number of cells for AB(&CD) lines (default 5)
readvdu(nab,int,5)

Start a spline curve C1 at point A.
GSET(V,C1,S,A,SPLINE)
GSET(V,C1,S,A,SPLINE)
Start with a zero-curvature; ie. allow program
to fit curve between points and decide curvature.
GSET(V,0,0,0)
GSET(V,0,0,0)
Define point on a curve (0,0.07,0.35)
GSET(V,0,cl*1,cl*5)
GSET(V,0,7.0000E-02,3.5000E-01)
Define point on a curve (0,0.21,0.63)
GSET(V,0,cl*3,cl*9)
GSET(V,0,2.1000E-01,6.3000E-01)
End spline curve at point B.
GSET(V,C1,E,B)
GSET(V,C1,E,B)
MESG(Define line AB, between points A and B with :nab:
uniformly distributed cells, using curve C1.
CT1=GSET(L,AB,A,B,nab,1.0CRVC1)
#\$b003

Enter number of cells for BC(&DA) lines (default 5)
readvdu(nbc,int,5)
Start a spline curve C2 at point B.
GSET(V,C2,S,B,SPLINE)
GSET(V,C2,S,B,SPLINE)
Define point on a curve (0,1.33,1.12)
GSET(V,0,cl*19,cl*16)
GSET(V,0,1.3300E+00,1.1200E+00)
Define point on a curve (0,1.61,1.3)
GSET(V,0,cl*23,cl*18.5))
GSET(V,0,1.6100E+00,1.3000E+00)
End spline curve at point C.
GSET(V,C2,E,C)
GSET(V,C2,E,C)
MESG(Define line BC, between points B and C with :nbc:
uniformly distributed cells, using curve C2.
CT1=GSET(L,BC,B,C,nbc,1.0CRVC2)
#\$b003

Start a spline curve C3 at point C.
GSET(V,C3,S,C,SPLINE)
GSET(V,C3,S,C,SPLINE)
Define point on a curve (0,2.66,1.3)
GSET(V,0,cl*38,cl*18.5)
GSET(V,0,2.6600E+00,1.3000E+00)
Define point on a curve (0,3.29,0.98)
GSET(V,0,cl*47,cl*14)
GSET(V,0,3.2900E+00,9.8000E-01)
Define point on a curve (0,3.64,0.63)
GSET(V,0,cl*52,cl*9)
GSET(V,0,3.6400E+00,6.3000E-01)
Define point on a curve (0,3.78,0.35)
GSET(V,0,cl*54,cl*5)
GSET(V,0,3.7800E+00,3.5000E-01)
End spline curve at point D.
GSET(V,C3,E,D)
GSET(V,C3,E,D)
MESG(Define line CD, between points C and D with :nab:
uniformly distributed cells, using curve C3.
CT1=GSET(L,CD,C,D,nab,1.0CRVC3)
#\$b003

MESG(Define straight line between points D and A with :nbc:
uniformly distributed cells.
GSET(L,DA,D,A,nbc,1.0)
GSET(L,DA,D,A,NBC,1.0)
Define frame ABCD (car profile) which has corner points
A,B,C,D
CT1=GSET(F,ABCD,A,-,B,-,C,-,D,-)
#\$b003
*

Enter number of cells in I (car-width) direction (def. 10)
readvdu(nx,int,10)
Set the BFC grid dimension as nx x nbc x nab cells with
reference length width x length x height.
CT1=GSET(D,nx,nbc,nab,width,length,height)
#\$B004
*

Match grid plane I1 on frame ABCD using the
trans-finite interpolation method
CT1=GSET(M,ABCD,+K+J,1,1,1,TRANS)
#\$B004
*
it1=nx+1
MESG(Copy I:it1: plane from I1 plane by shifting it
with a distance (dx=width,dy=0,dz=0), including internal
planes;internal planes are uniformly distributed, hence
power is set to 1.
CT1=GSET(C,I:it1:,F,I1,1,nbc,1,nab,+,width,0,0,INC,1)
#\$B004
enddis
```