Versions Compared

Key

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

...

  1. Preferred method:
    • 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.  
    • If the fine region will be (for example) NE120 (¼ degree), make a uniform NE60.g file (exactly half the resolution of the fine region). 
      • This can be done via; SQuadGen --resolution 60 --refine_level 0 --output NE60.g
      • Create a lat/lon plot of this NE60 mesh, without any borders or axis, and convert to a PNG file with an aspect ratio of 2.  The final resolution should be something like 2048x4096.
        • You can convert SQuadGen output to PNG using gridplot.ncl in the SQuadGEN test directory.

      • Here's an example of the kind of file you want: 
      • 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).
    • Create a PNG of the same dimensions as the file above which is transparent where the coarse grid is used and black where refinement is needed.
      • For best results, create a PNG that is transparent (so you can see the NE60 grid behind it) and then fill in, in white, the elements that should be refined to NE120. 
      • For best results the border should follow the grid lines, or go at a 45 degree angle (i.e. over 1 element, then down 1 element, and repeat).  
      • Save the new PNG (without the background image).  Here we assume the file is called newmesh.png
      • An example of the PNG file:
      •  
    • Use SQuadGen to create the refined grid:
      ./SQuadGen --refine_file  newmesh.png --refine_level 3 --refine_type LOWCONN \
      --resolution 16 --smooth_type SPRING --smooth_dist 3 --smooth_iter 20 \
      --output newmesh.g
    • 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:

...