Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Preferred method:
    1. Here we follow a procedure developed by Oksana Guba  where we draw the PNG image on top of a background image of a cubed-sphere grid.  This allows one to have better control over the refined region’s boundaries and avoid notches and other types of glitches in the transition region.  SQuadGen generates the refinement region by using pointwise sampling of an input PNG image.  The input PNG is a grayscale representation of a regular latitude-longitude grid (under equirectangular projection) with the shading determining the level of refinement: white for the coarse grid and black where maximum refinement is desired.  Shades of gray can be used to impose an intermediate level of refinement.  To determine the refinement region on the cubed-sphere mesh, each volume on the cubed-sphere grid is sampled from the PNG image to determine the desired level of refinement on that grid.  The transition region is then built around each refinement region using "paving" tiles, with optional smoothing of edges.
      • The following PNG image (with base grid ne16) can be used as a template for drawing your refinement region so that grid lines are parallel to cubed-sphere arcs. This PNG file will be used as a background image in Photoshop or GIMP.  The PNG of the refined region is then drawn on top of this image (in a separate layer).  You can set the transparency between layers at, i.e. 50% with the grayscale image in front of the template.  When you are ready to save the image, you can change the transparency to 0% and export the image as a PNG.
      •  
      • If desired a different "base grid" image can be generated if you want more detail as part of your template.  This can be done with "./SQuadGen --resolution <ne> --output base_grid.g", where <ne> is your desired base grid resolution.  The grid can then be plotted with the "gridplot.ncl" script and screenshotted.
      • An example PNG file with refinement over the central Atlantic is depicted below.  We will assume this file is called "newmesh.png": 
    2. Use SQuadGen to create the refined grid.  The "resolution" defines the number of elements along each edge of the cubed sphere on the base grid (i.e. the coarsest resolution).  The "refine_level" defines the number of refinement levels between the coarsest resolution and the finest resolution.  Hence the resolution of the finest region is equal to <resolution>*2^-<refine_level>.
      ./SQuadGen --refine_file  newmesh.png --invert --refine_level 3 --refine_type LOWCONN \
      --resolution 16 --smooth_type SPRING --smooth_dist 3 --smooth_iter 20 \
      --output newmesh.g
    3. Plot the final grid and make sure it does not have any highly deformed elements.
      • Please note:  If you use the LOWCONN option for --refine_type, try to avoid six elements around one point by editing the white parts of the PNG.  Six elements around a point is unavoidable with the CUBIT option.  
      • The mesh generated by the PNG file above is:

...