Mesh Element Quality and Size
The mesh resolution and mesh element quality are important aspects to consider when validating a model. Low mesh resolution — in relation to the variations in the solution and the geometry — can lead to inaccurate results. A low mesh element quality — which measures the regularity of the mesh elements’ shapes — can lead to inverted mesh elements (see Avoiding Inverted Mesh Elements) and to high condition numbers for the Jacobians, which in turn can cause convergence issues. The mesh element quality is a dimensionless quantity between 0 and 1, where 1 represents a perfectly regular element, in the chosen quality measure, and 0 represents a degenerated element. COMSOL Multiphysics includes the following mesh quality measures:
Skewness, which is the default quality measure, is a measure of the equiangular skew is defined as the minimum of the following quantity:
where θ is the angle over a vertex (2D) or edge (3D) in the element, θe is the angle of the corresponding edge or vertex in an ideal element, and the minimum is taken over all vertices (2D) or edges (3D) of the element.
Maximum angle, which is based on the largest angle in the element. If no angle is larger than the largest angle of the corresponding optimal element, the quality is one; otherwise, the measure shows how much larger the angle is. This quality measure is insensitive to element anisotropy.
Volume versus circumradius is the default quality measure, which is based on a quotient of the element volume and the radius of the circumscribed sphere (or circle) of the element. This quality measure is sensitive to large angles, small angles, and anisotropy.
Volume versus length, which is based on a quotient of element edge lengths and element volume. This quality measure is primarily sensitive to anisotropy.
Condition number, which is based on the element dimension divided by the condition number (in the Frobenius norm) of the matrix transforming the element to a reference element.
Growth rate, which is a measure of local (anisotropic) growth rate. Let sα(E) denote the element size of an element E in a spatial direction α, and let Eα denote the element neighbor of E in the direction α. The growth rate measure is then the minimum of the quotient min(sα(E), sα(Eα))/max(sα(E), sα(Eα)), where α is taken over all directions.
Custom expression (available in the Mesh plot node’s Settings window), where your can enter a custom expression for the mesh quality (using the variables listed below, for example). The expression should evaluate to scalar values from 0 to 1.
The following built-in variables are available for these mesh quantities:
h, the local mesh size.
qualskewness, the skewness mesh quality measure, which is the default mesh quality measure.
qualmaxangle, the maximum angle mesh quality measure.
qual, the volume versus circumradius quality measure.
qualvollength, the volume versus length mesh quality measure.
qualcondition, the condition number mesh quality measure.
qualgrowth, the growth rate mesh quality measure.
All these variables are also available in variants for the various frames in a moving mesh or ALE simulation, for example. Append _geometry, _mesh, or _spatial to the base variable name to evaluate the quantity in the geometry frame, mesh frame, or spatial frame, respectively.
In general, if a mesh with a low mesh quality has been generated, a Warning node appears, indicating where the bad elements are located in the geometry. To locate the exact placement of the bad elements, use a Mesh plot node set to show elements of the right dimension and using an element filter like qualskewness<0.01.
Displaying Mesh Element Quality and the Mesh Element Size
You can display the mesh element quality and the mesh element size using, for example, a surface plot in 2D or a volume plot in 3D. You can always use a Mesh data set to display these quantities as soon as you have created a mesh. If you have a solution, you can also use a Solution data set. For a Component with a mesh, the following steps display the mesh element quality or mesh element size:
1
Right-click the Mesh node and select Plot (). This creates a plot group with a Mesh plot node ().
2
By default, this plot shows the mesh element quality. You can choose the mesh quality measure to display from the Quality measure list. In the Settings window for Mesh, select Size instead of Quality from the Element color list to plot the mesh element size instead.
Alternatively, you can access the built-in variables for mesh element quality (qual) and mesh element size (h) in a surface plot, for example:
1
Under Results (), right-click Data Sets () and select Mesh ().
2
Add a 2D or 3D Plot Group using the Mesh data set as the group’s data set, and then add a Surface or Volume plot. For example, in a 2D Plot Group>Surface node (), from the predefined quantities (under Mesh), select qualskewness - Element quality (the default mesh quality measure), h - Element size, or one of the other available mesh element quality quantities for another quality measure. Then click the Plot button ().