home news images pubs c3dTeam
whatIsCart3D?
surfaceModeling
meshGen?
flowSolvers?
postprocess?
mailList?
betaTest?
licensing?

   Mesh Generation

  What is "cubes"?
  What is new in cubes for v1.4?
  What input files does cubes require?
  What is "autoInputs"?
  Usage - cubes
  How do I run a 2D case?
  Tell me more about prespecified adaptation regions.
  File Format of Meshes produced by Cubes
  Further Documentation
What is "cubes"?
 
Cubes  is a mesh generation program which produces topologically unstructured, adaptively refined, Cartesian  meshes around any geometry or configuration that may be described by a collection of simplicial polyhedra (closed surface triangulations - the output of intersect works fine) The source is written in Ansi C and makes extensive use of bitwise operators to minimize memory requirements and maximize speed. 

Features:

  • Gross memory usage is typically 13-15 words/cell 
  • Speed is about 3,000,000 cells/min (x86_64 @ 2.4Ghz) 
  • Geometry based adaptive cell division (directional or isotropic). 
  • An aspect ratio limit may be placed on directionally divided cells. 
  • Option for users to limit total # cells & max allowable memory 
  • Multiple region (split-cells) handled automatically 
  • The ability to prespecify mesh adaptation in certain regions 
HSCT configuration 5M cells
5M cell mesh around a HSCT configuration
HSCT configuration 5M cells
side view - zoom box on nacelle region
HSCT configuration 5M cells
closeup near nacelle.
(top)
What is new in cubes for v1.4?
Cubes now allows direct meshing in 2D. You can invoke this with "% cubes -mesh2d", and cubes will make a 2D mesh in x-y with no refinement in the z-direction. This allows you to create a 2D "slab" of cells which only get refined in x and y.  The Cart3D_v1.4 distributions include a new sample in $CART3D/cases/samples/naca0012/ which illustrates use of this option to do 2D simulation over an airfoil. Its a good starting-out case since it runs in seconds to encourage experimentation.

A few tips?
Experienced users can make use of a couple of handy features in cubes to for both greater control and a more streamlined meshing process. All command line options are listed in the usage statement below.
    Automatic reordering:  "% cubes -reorder" will reorder the mesh before it ever hits your disk. This is completely equivalent to running the standalone reorder program, but you skip ever writing the un-reordered mesh, and go straight to Mesh.R.c3d. Since CPU speeds are improving faster than disk speed, writing the mesh has been taking an increasing amount (relative) time in the past few years, Writing out  the mesh at the end of cubes just to read it back in in the first step of reorder seemed like a complete waste of time,  so now you can do it direct. Doing the reorder on-the-fly within cubes does mean that the whole mesh needs to reside in memory at the same time as all the other data structures that cubes needs, so this option does increase the memory requirements of cubes by a bit, but this consumption is not severe, and nobody's complained yet, since cubes has a very tiny memory footprint to start with.
    Sharp Feature Refinement: You can additional refinement sweeps that just target sharp features in your geometry (sharp edges, ridges, etc). This argument takes an integer which says how many additional refinement sweeps to do. Invoke it with "%cubes -sf %d" where %d is an integer. Usually "-sf 1" or (at most) "-sf 2" is sufficient.
(top)

What input files does cubes require?
    Cubes requires 2 files to get going:
    1. An input file controlling the mesh you want to make (only 7 entries! ). By default this file is called "input.c3d" it is fully described on the example input/output file page
    2. Input surface triangulations are read in as a Cart3D "wetted surface triangulation" which may contain any number of components.  Entry #1 in the cubes input file takes the name of the triangulation you're gonna mesh. 


    Optionally, you can include a "prespecified adaptation region" file, usually called preSpec.c3d.cntl. Entries in this file can be used to direct cubes to refine more in certain regions of the domain click here to learn more about prespecified adaptation regions, or here to see a sample.
    (top)

  What is "autoInputs"?

The v1.4 release includes "autoInputs" which is a new utility that automatically generates the input.c3d and preSpec files that cubes needs to get going. This utility befitted greatly from beta-testing and we strongly recommend its use by both novice and experienced users alike.  Basically you hand autoInputs your geometry and a rough idea of how big you want the mesh to be and it will produce an input.c3d and preSpec.c3d.cntl file that you can use to mesh. Overall, autoInputs is very handy for getting going in short order. The preSpec.c3d.cntl files that autoInputs produces are quite detailed, and include preSpec boxes for the entire configuration, and smaller boxes for each component. Like the rest of the utility programs in Cart3D, the executable for autoInputs is located in $CART3D/bin/$CART3D_ARCH/. To get a usage statement, type "% autoInputs -" (the trailing "-" will get you the usage statement, as with all executables in the package).

Usage - autoInputs

% autoInputs
   Usage: autoInputs [ argument list ]
 Options:
    -t %s       Input '*.tri' file name <Components.i.tri>
    -r %F       nominal mesh radius <default = 30.>
    -nDiv %d    nominal # of divisions in background mesh <default: 5>
    -maxR %d    Max Num of cell refinements to perform <default: 11>
    -symmX      Halfbody mesh in X
    -symmY      Halfbody mesh in Y
    -symmZ      Halfbody mesh in Z
    -halfBody   Input geometry is a half-body
    -pre %s     file name for preSpec control file <preSpec.c3d.cntl>
    -i   %s     file name for mesh input control file <input.c3d>



(top)

Usage - Cubes
 
% cubes -
   Usage: cubes [ argument list ]
   Options:
    -i %s       Input  file name, default:<input.c3d>
    -o %s       Output file name, default:< Mesh.c3d>
    -v          Verbose mode ON
    -quiet      Don't make excessive noise
    -mem        Report memory usage (auto on with -v)
    -T          Create tecplot file 'c3d-mesh.plt'-(NOT YET)
    -I          Restrict cells to isotropic division only
    -ascii      Surface geometry file is ascii formatted
    -P          Retain parent cell information
    -no_file    Suppress output file
    -Dunset     dump tecplot format file <unset.dat>
    -Dcut       dump tecplot format file <cutcells.dat>
    -Dflow      dump tecplot format file <flowcells.dat>
    -Dsolid     dump tecplot format file <solidcells.dat>
    -Dsplit     dump tecplot format file <splitcells.dat>
    -Daniso     dump tecplot format file <anisocells.dat>
    -Xcut %d    Num of X=const cut planes <cutPlanes.dat>
    -Ycut %d    Num of Y=const cut planes <cutPlanes.dat>
    -Zcut %d    Num of Z=const cut planes <cutPlanes.dat>
    -maxR %d    Max Num of refinements (override)
    -b %d       Number of layers of buffer cells
    -h          Output history of #Cells with refinement
    -memLim %f  Specify Absolute Memory Limit (in Mbytes)
    -verify     Verify cut cells close (auto on in DEBUG)
    -N %d       Maximum number of Cartesian cells
    -try_exact  Use Newton solve on REAL cell # fn
    -a %f       Angle (deg) threshold for geom refinement (def=25°)
    -d %f       angle (degrees) for directional refinement
    -weight     Area weight triangles in divide criteria
    -TPC %d     adapt based on # of triangles-per-cutCell
    -sf %d      Number of additional levels at sharp edges
    -Internal   Mesh the *interior* of the geometry
    -mesh2d     Make 2d mesh in X-Y, no refinement in Z
    -reorder    Reorder output mesh with peano Hilbert SFC
    -pre %s     Prespecified adapt region filename (default = NONE)
    -no_est     Dont estimate mem. requirements (slower,less compact)
    -STARS      Record intermediate refinement history

pressure contours around 2D airfoil problem(top)
How do I run a 2D case?
2D cases can be run by making a "slab-like" domain in x-y that is only 1-cell deep (in z). Then use the "-mesh2d" command-line flag to suppress cell refinement in z. The result is a mesh which is adapted in x-y only, and is only 1-cell across. The NACA 0012 example in $CART3D/cases/samples/naca0012/ is designed to illustrate the setup and running of 2D problems.


File Format of Meshes produced by Cubes
The file format used by Cart3D to store meshes relies heavily upon the fact that the meshes are Cartesian to store meshes in a highly compressed format. This produces quite small mesh files, but the format takes a little explanation. For users who wish to use Cart3D meshes in other applications, or wish to write their own visualization software for these meshes, this format is described in the *pdf document fileformat.pdf (50kb) and an ansi-C I/O library is available for use.
(top)
Further Documentation
Many of the algorithms in cubes are described in:
AIAA Paper 97-0196: Robust and Efficient Cartesian Mesh Generation for Component-Based Geometry  35th AIAA Aerospace Sciences Meeting, Reno NV Jan, 1997.  (1.7Mb, acrobat format)
(top)

last update December 2008, M. Aftosmis