Controlling Mesh Size

Mesh spacing is controlled in a number of ways depending upon the mesh generation module used. The mapped mesh and extrusion modules, MapMesh and ExtMesh, the mesh spacing is very specific to the mesh generation technique. In the unstructured mesh modules, there are a set of common parameters such as target edge length, growth rate and minimum edge length. Additional parameters such as spanning angle are available for curve and surface mesh generation.

In the unstructured meshing modules such as TriMesh, SurfMesh and TetMesh, the normal input sizing parameters may be overridden by installing a callback function to specify the mesh size as a function of spatial coordinate. Generally, both isotropic and anisotropic sizing callback functions are available. These sizing callback functions have the same general form for all modules. Note that if an anisotropic sizing function is set, it takes precedence over any isotropic sizing function which has been set. The function prototypes for the SurfMesh module appear below as an example.

The isotropic sizing callback function prototype is

void function (msh_SurfMesh *surfmesh,
                Vobject *object,
                Vdouble x[3],
                Vdouble *s)

The first argument is the SurfMesh object, surfmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned size s.

The anisotropic sizing callback function prototype is

void function (msh_SurfMesh *surfmesh,
            Vobject *object,
            Vdouble x[3],
            Vdouble s[3][3])

The first argument is the SurfMesh object, surfmesh, the second is a user defined object, object, the third is the coordinate location x and the fourth is the returned anisotropic scaled orthogonal direction vectors. The first 3 components are the first size scaled direction, the next 3 components are the second size scaled direction, the next 3 components are the third size scaled direction.