Deﬁning a stretching and alignment aware quality measure for linear and curved 2D meshes

—We deﬁne a regularized shape distortion (quality) measure for curved high-order 2D elements on a Riemannian plane. To this end, we measure the deviation of a given 2D element, straight-sided or curved, from the stretching and alignment determined by a target metric. The deﬁned distortion (quality) is suitable to check the validity and the quality of straight-sided and curved elements on Riemannian planes determined by constant and point-wise varying metrics. The examples illustrate that the distortion can be minimized to curve (deform) the elements of a given high-order (linear) mesh and try to match with curved (linear) elements the point-wise alignment and stretching of an analytic target metric tensor.


A. Introduction
In the last decades, the utilization of unstructured meshes composed by highly stretched elements and aligned with dominant flow features, such as boundary layers and shock waves, have shown to be very advantageous.When compared with uniform refinement or with isotropic meshes with non-uniform sizing, anisotropic meshes lead to a significant reduction on the number of required degrees of freedom to obtain the same approximation accuracy.This allows performing simulations with a significantly reduced, and even unbeatable, computational cost.
The generation of anisotropic meshes requires to determine the location, stretching and alignment of the elements.These features can be prescribed manually with the help of the user interface of a mesh generation environment.They can also be prescribed imposing point-wise varying metric tensors obtained in an automatic and iterative adaption procedure based on error indicators or estimators.Then, an anisotropic mesher can be used to match the resolution, stretching and alignment determined by the target metric.
It is standard to use parallelotopes (quadrilaterals and hexahedra) to manually prescribe the alignment and stretching required to capture flow features such as boundary layers.Whereas the flexibility of simplices (triangles and tetrahedra) is the preferred one in automatic adaption iterations.Nevertheless, for both types of elements, the most mature anisotropic mesh generation techniques lead to meshes featuring second order elements such as multi-linear parallelotopes and linear simplices.
The utilization of curved anisotropic meshes composed by third order elements, such as multi-quadratic parallelotopes and quadratic simplices, or piece-wise polynomial elements of higher order has been mainly centered to curve, manually prescribed, straight-sided boundary layer meshes [1]- [9].It has not been until recently that the first metric based approaches have been explored to generate anisotropic meshes featuring straight-sided very high-order three dimensional approximations, curved quadratic triangles, and r-adapted curved highorder 2D elements.However, no specific efforts have been conducted to check the validity and measure the quality of curved high-order anisotropic meshes considering a prescribed metric tensor.
Our main contribution is to define a regularized shape distortion (quality) to measure the deviation of a given linear or high-order 2D element from the stretching and alignment determined by a target metric.The influence of the target metric on the element quality has only been considered in detail for linear elements and not for curved high-order elements.The defined distortion (quality) is suitable to check the validity and the quality of straight-sided and curved elements on Riemannian planes determined by constant and point-wise varying metrics.Furthermore, we illustrate that the distortion can be minimized to curve (deform) the elements of a given high-order (linear) mesh and try to match with curved (linear) elements the point-wise alignment and stretching of an analytic target metric tensor.Specifically, this approach can be used to improve, by curving (deforming) the elements, the alignment and stretching of a mesh obtained with a straightsided anisotropic mesher.

B. Examples
In this section, we present an example to illustrate the main features of the proposed quality measure.It features an analytic and point-wise varying smooth metric.We generate an initial mesh and we measure its quality according to the new measure for anisotropic elements.Next, we optimize the location of the nodes to minimize the element distortion using the framework presented in [5], [10].
The mesh resulting after the optimization is composed by elements as aligned and stretched as possible to match the target metric tensor.In both figures, the meshes are colored according to the elemental quality.
As a proof of concept, a mesh optimizer has been developed in MATLAB using the Optimization Toolbox, the PDE Toolbox and the Symbolic Math Toolbox.The MAT-LAB prototyping code is sequential (one execution thread), corresponds to the implementation of the method presented in this work.The optimization is reduced to find a minimum of a nonlinear unconstrained multi-variable function, where a trust-region algorithm is used.The stopping condition is set to reach a relative residual smaller than 10 −8 .
6th BSC Severo Ochoa Doctoral Symposium The metric is extracted from [11] and attains the highest level of anisotropy at the curve described by the points (x, y) ∈ Ω such that h(x, y) = 0.The anisotropy ratio of this metric is 1 : 1 + |∇z| 2 and its maximum is approximately 1 : 60.Note that the chosen ϕ surface is not related to a finite element solution.It is a standard analytical test to check anisotropic capabilities.
We illustrate this example for triangles in Figure 1.We generate an initial isotropic straight-sided high-order mesh 1(a) composed by 1905 nodes and 228 elements.The optimized mesh is illustrated in Figure 1(b).We observe that the elements away from the anisotropic region are enlarged vertically whereas the elements lying in the anisotropic region are compressed.In the optimized mesh the minimum is improved and the standard deviation of the element qualities is reduced when compared with the initial configuration.

C. Conclusion
In this work, we have presented a new definition of distortion (quality) measures for linear and high-order planar anisotropic meshes equipped with a point-wise metric.The proposed quality measures the alignment and stretching of the elements according to the given metric.In addition, it is valid for any interpolation degree and allow to detect the validity of a high-order element equipped with a metric.To assess the reliability of the technique, we have first analyzed the behavior of the measure for linear triangles equipped with a constant metric.The tests show that for a given metric the obtained quality measure detects invalid and low-quality configurations and, the alignments and stretching described by the metric.
The defined distortion measure is applied to curve linear meshes to improve the node configuration according to the desired metric.The numerical example show an optimized mesh with an improved alignment and stretching according to the metric.This improvement leads to an increase of the minimum elemental mesh quality and a reduction of the standard deviation between the different element qualities.
Our long term goal is to extend the quality measure for 3D anisotropic meshes.In addition, the quality measure developed in this work is devised to quantify the alignment and the stretching of the mesh according to the target metric.Thus, we would like to extend the proposed measure to also quantify the mesh sizing.
II. ACKNOWLEDGMENT This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme under grant agreement No 715546.This work has also received funding from the Generalitat de Catalunya under grant number 2017 SGR 1731.The work of X. Roca has been partially supported by the Spanish Ministerio de Economía y Competitividad under the personal grant agreement RYC-2015-01633.