home news images pubs c3dTeam
whatIsCart3D?
surfaceModeling
meshGen?
flowSolvers?
flowCart
overview
reorder
mgPrep
running
Input/Output files
postprocess?
mailList?
betaTest?
licensing?

   mgPrep

  What is "mgPrep"?
  Input/Output files and Usage:
  An example of coarse mesh generation with "mgPrep":
  Partitioning and coarse meshes:
  Further Documentation:

 What is "mgPrep"?
To use flowCart's multigrid convergence acceleration, you need to generate a series of coarse meshes in addition to the fine mesh upon which you actually want to see the final solution. mgPrep is the mesh coarsening module which creates these coarse grids from an initial input grid.   
 Input/Output files and Usage:
mgPrep takes reordered meshes (from reorder) usually named Mesh.R.c3d and produces hierarchies of meshes (usually named Mesh.mg.c3d). The ordering of the input meshes is preserved and is propagated to coarser meshes in the hierarchy. So if you pass it a mesh that you reordered with Peano-Hilbert, all the coarse meshes will be ordered by Peano-Hilbert too. Here is the full usage statement:
 % mgPrep -
 
   Usage: mgPrep [ argument list ]
  Options:
  -n %d          Number of MultiGrid levels to prepare (n >= 2)
  -i %s          Input  file name, default:<Mesh.R.c3d>
  -o %s          Output  file name, default:<Mesh.mg.c3d>
  -sfc %c        sfc init mesh order, H=peano-hilbert (default), M=morton
  -v             verbose mode ON
  -separate      dumps coarser meshes in separate files
  -pmg           Write the finest mesh twice
  -no_stats      Suppress printing of coarsening statistics
  -verifyInput   Verify the input mesh before coarsening
  -Xcut %d       Num of X=const cut planes <mgPlanes.dat>
  -Ycut %d       Num of Y=const cut planes <mgPlanes.dat>
  -Zcut %d       Num of Z=const cut planes <mgPlanes.dat>
  -Dcut          Dump tecplottable file <cutcells.dat>
  -mesh2d        Not recommended, use "% mgTree -mesh2d " instead
                
(see $CART3D/cases/samples/naca0012/HOWTO.html)

top
 An example of coarse mesh generation with "mgPrep":
the command line:
% mgPrep -n 5 -i Mesh.R.c3d
will produce a sequence of 5 meshes from the original input Mesh.R.c3d that look something like this (click on any image for an enlargement). This hierarchy of meshes will get stored in a file called Mesh.mg.c3d by default, and is ready to be read into cubes.
 
Input mesh
 1st coarse mesh
2nd coarse mesh
3rd coarse mesh
4th coarse mesh
4500000 cells
Coarsening Ratio:
630000 cells
7.1:1
97000 cells
6.5:1
19000 cells
5.1:1
4500 cells
4.2:1

Note: The output Mesh hierarchy in this case can be used to run anywhere from single mesh (%flowCart) to 5 levels of multigrid
(% flowCart -mg 5)  or grid sequencing - you dont need to use all the meshes in the hierarchy when you run. 

top

 Partitioning and coarse meshes:
As a happy consequence of some of the mathmatical properties of the SFC partitioner, coarse grids will get partitioned in a manner similar to the way that their fine mesh got partitioned. This helps to reduce the amount of communication between subdomains in multi-processor runs. Here is an example showing the partitioning of a mesh herarchy around an X-38 for a run on 2 processors. Note that the meshes in the blue and pink partitions remain nicely overlapped to reduce the amount of communication  with other processors durring multigrid prolongation and restriction.
 
Input mesh 1st coarse mesh 2nd coarse mesh
Mesh Partitioning for 2 processors mesh partitioning for 2 processors mesh partitioning for 2 processors
top

Further Documentation:
Technical information on all topics covered in this overview are addressed in


top



last update Dec. 2008, M. Aftosmis