Mesh > Information and Statistics > Quality of Elements

Quality of Elements
The absolute value of the mesh element quality is based on the ratios of the inscribed and circumscribed circles’ or spheres’ radii for the simplex corresponding to each corner of the element. If the simplex cannot be clearly determined (an apex of the pyramid, for example), the corresponding corner is excluded from the consideration. The absolute value is always between 0 and 1, where 0.0 represents a degenerated element and 1.0 represents the best possible element. A negative value means a contradiction to the COMSOL Multiphysics numbering convention for mesh element vertices (see Element Numbering Conventions), and the element is then referred to as an inverted element.
To retrieve the minimal quality, use
double model.mesh(<tag>).stat().getMinQuality(type);
double model.mesh(<tag>).stat().getMinQuality();
To retrieve the mean quality, use
double model.mesh(<tag>).stat().getMeanQuality(type);
double model.mesh(<tag>).stat().getMeanQuality();
To calculate a distribution of qualities, use the getQualityDistr method.
int[] model.mesh(<tag>).stat().getQualityDistr(type, <size>);
int[] model.mesh(<tag>).stat().getQualityDistr(<size>);
The size parameter is a positive integer determining how detailed the distribution is and equals the size of the output array. The distribution can by used to plot a histogram of the element quality. For example, if size equals 10, the first entry in the returned array is the number of elements with quality less than 0.1, and the last entry is the number of elements with quality better than 0.9.
The following methods are available directly on the sequence and provide statistics for the entire geometry:
double model.mesh(<tag>).getMinQuality(type);
double model.mesh(<tag>).getMinQuality();
double model.mesh(<tag>).getMeanQuality(type);
double model.mesh(<tag>).getMeanQuality();
int[] model.mesh(<tag>).getQualityDistr(type, <size>);
int[] model.mesh(<tag>).getQualityDistr(<size>);