# Mesh Generation Algorithms

The mesh generation algorithms are divided into two types: those that require the presence of a surface to provide a context of operation, or those working entirely from node and/or line data.

## Autodecide

If you are meshing a surface, the default mesh generation algorithm is Autodecide. In this case, the geometry of each face and the element densities specified for each edge is analyzed, and the algorithm that will give the best results is selected. For most configurations, the Free algorithm is chosen.

## Free

The Free meshing algorithm is a general-purpose formula that works for most meshing conditions. The surface can have interior holes or edges and any number of sides. If quads or trias is the selected element type, an advancing front algorithm is used. If mixed is the element type, a sub-mapping algorithm is used.

- Traverses the perimeter of the region, placing elements along the edges as it proceeds. Each site where an element could be placed is measured and one of several possible elements is chosen. Eventually the entire region is filled with elements.
- Examines the groups of elements to see if a local change in the connectivity might improve element quality.
- Applies repeatedly the selected smoothing algorithm until no node is moved farther than the specified smoothing tolerance.

- If the total number of elements specified for the perimeter of the face is odd, at least one tria always needed.
- If there is a tight corner on the boundary that would require a poor quality quad, a single tria is used.
- Sometimes two or more trias are needed because of the particular order in which the elements were generated; if that is the case, you can usually eliminate them by changing some of the meshing parameters and then remeshing the region.

## Map as Triangle, Rectangle, Pentagon, or Circle

If the region is free from internal holes and the boundary is clearly triangular, rectangular, or pentagonal in shape, the best choice of algorithm is usually to map a standard mesh onto the region using transfinite interpolation. Such an operation is exceedingly fast, and where applicable, gives quality results rapidly. A standard template based on the element densities around the perimeter of the region is chosen. Ignoring rotations, more than 18 different configurations requiring distinct templates are recognized. To make tria elements, first a quads mesh is created and then each element is divided along its shortest diagonal.

## Map without Surface

If you are creating a mesh entirely from line and/or node data, with no surface, the mesh generation algorithm is decided by the tool that was used to describe the desired operation. If you use the Drag panel, the algorithm is to drag. If you use the Spin panel, the algorithm is to spin, and if you use the Spheres panel, the algorithm is to map a sphere-covering mesh. You can still use the density and biasing manipulation tools but some edges will be linked together, so that the configuration always satisfies the balancing requirements of the intended mapping.