cashocs.geometry.compute_mesh_quality#

cashocs.geometry.compute_mesh_quality(
mesh: fenics.Mesh,
quality_type: str = 'min',
quality_measure: str = 'skewness',
quantile: float = 0.0,
) float[source]#

This computes the mesh quality of a given mesh.

Parameters:
  • mesh (fenics.Mesh) – The mesh whose quality shall be computed.

  • quality_type (str) – The type of measurement for the mesh quality, either minimum quality or average quality over all mesh cells, default is ‘min’.

  • quality_measure (str) – The type of quality measure which is used to compute the quality measure, default is ‘skewness’

  • quantile (float) – The quantile which shall be used to compute the mesh quality.

Return type:

float

Notes

One can specify a quantile when using quality_type="quantile" and specifying quantile=q, where \(q \in [0,1]\) is some probability for the quantile to compute. That means that the computed quality \(Q \in [0,1]\) satisfies the following relation: \(100q \%\) of all mesh cells have a quality lower than \(Q\), whereas \(100(1-q) \%\) of all mesh cells have a quality greater than \(Q\). In particular, \(q = 0.5\) will return the median of the mesh quality. This can be used to control the mesh quality (for remeshing) when the minimum quality is too strict but the average quality too coarse.

Returns:

The quality of the mesh, in the interval \([0,1]\), where 0 is the worst, and 1 the best possible quality.

Parameters:
  • mesh (fenics.Mesh)

  • quality_type (str)

  • quality_measure (str)

  • quantile (float)

Return type:

float