###############################################################
#
#         Duct-grid generator instruction.
#
# ---------------------------------------------------
#
###############################################################

###############################################################
# Compile the codes by gfortran as below, or ifort, g95, etc.
###############################################################

#------------------------------------------
# compile the grid generation progarm:

  echo " Compiling duct_v0p9.f90..."
  gfortran -O2 -o duct_executable duct_v0p9.f90

#----------------------------------------------------------------------
# Endianness will be automatically detected, but if you wish,
# you can specify endianness at compilation: e.g., as follows:
#  gfortran -O2 -fconvert=big-endian -o duct  duct_v0p9.f90
#     ifort -O2 -convert big_endian  -o duct  duct_v0p9.f90
#----------------------------------------------------------------------

###############################################################
#
#  Just use the included input.nml file. This corresponds to the hexahedral grids
#  used to generate FUN3D and USM3D reference solutions in AIAA-2021-1552. 
#
###############################################################
 
# run the program (with this, the code will read the input file, "input.nml"):

  ./duct_executable

# Visualize the grid by Tecplot to see how the domain boundary
# is split into different parts.


###############################################################
#
#  To generate prismatic grids, modify the following line in "input.nml" 
#
#                    igrid_type = 1       !1=strct(hex), 2=prims, 3=tetra
#   as
#   
#                    igrid_type = 2       !1=strct(hex), 2=prims, 3=tetra
#
#   and to generate tetrahedral grids, modify it as
#
#                    igrid_type = 3       !1=strct(hex), 2=prims, 3=tetra
# 
#  and then run the code with the following command: 
#
#  ./duct_executable
#
#
###############################################################

#######################################################################
#######################################################################
# NOTE:    To convert .ugrid+.mapbc file to a CGNS file.
#
#  Install the CGNS package (see http://cgns.github.io/), and use
#  the utility code 'aflr3_to_cgns': at a terminal (command prompt),
#
# %$HOME/cgnslib/bin/cgnstools/aflr3_to_cgns duct.1.b8.ugrid duct.cgns
#
#  where $HOME/cgnslib/ is the directory of the CGNS library installed.
#######################################################################
#######################################################################
