Automatic Unstructured Quadrilateral Grid Generation

Automatic Unstructured Quadrilateral Grid Generation

QuadMesh is a MATLAB cross compatible automatic and unstructured quadrilateral grid generation code, developed to be used with the FEATool Multiphysics MATLAB Finite Element simulation toolbox.

Using quadrilateral grid cells are often advantageous to simplex or triangular cells in that they can provide somewhat more accuracy when aligned with geometry features, and also tend to require less overall grid cells. Quadrilaterals and hexahedrals unfortunately do not tend to allow for easy automatic grid generation although it is possible to subdivide triangles into quads via the Catmull-Clark splitting algorithm, the resulting grids introduce a significant amount of additional grid points are often of poor quality.

QuadMesh, originally devised to align quadrilateral cell edges with immersed interfaces, uses distance or level set functions to describe implicit geometry objects (such as those defined by FEATool geometry objects). The algorithm employs the zero level set contour from the distance functions to align grid cell edges with external geometry object boundaries. Furthermore, the cells are split in a way to treat edge cases such as when and interface segment crosses cell diagonals.

GUI Usage

QuadMesh can currently not be used with the FEATool GUI. It is instead recommended to use the Gmsh mesh generator which features quadrilateral meshing.

CLI Usage

QuadMesh is included with the default FEATool installation and can be used by calling gridgen on the command line, with the ‘gridgen’ ‘quad’ property/value pair, as in the following examples

  1. Unit square with uniform global grid size set to 0.1.

     grid = gridgen( {gobj_rectangle()}, 'hmax', 0.1, 'gridgen', 'quad' );
     plotgrid( grid )
    
  2. Ellipse with uniform global grid size set to 0.025.

     grid = gridgen( {gobj_ellipse()}, 'hmax', 0.025, 'gridgen', 'quad' );
     plotgrid( grid )
    
  3. Triangular polygon with uniform global grid size set to 0.05.

     grid = gridgen( {gobj_polygon()}, 'hmax', 0.05, 'gridgen', 'quad' );
     plotgrid( grid )
    

Issues

  • Currently, very sharp corners are not treated properly (when several interface sections intersect a single grid cell), to avoid these issues it is recommended to increase the grid resolution.