# Preconditioning the Quad Dominant Mesh Generator for Ship Structural Analysis
## 2 Materials and Methods  
Many modern quadrilateral meshing algorithms are designed around the notion of the cross field [11]. This is a heuristic function defined based on the geometry, and it models the preferred orientation of the mesh. For quadrilateral mesh generating algorithm, this is taken to be parallel to the boundaries of the domain. Frontal meshing algorithms propagate this cross field from the boundaries towards the interior of a surface. The new point is inserted in a mesh so that it forms an equilateral triangle with two nearest previously inserted nodes. In the quad oriented algorithm, one uses the \(L^{\infty}\) norm, and so the equilateral triangle is actually isosceles with an angle close to the right-angle. These triangles can then be optimally matched into quadrilaterals using the graph theoretic approach which minimizes the measure of the departure of a quad (a pair of triangles) from regularity. Furthermore, the unmatched triangle will be pushed by the marching front to the boundary. In what follows, we will describe the basic properties of the algorithm and our method of imposing further line restriction on the mesh by the addition of the virtual stiffeners (rods) to the model. Let us note that full recombination of the mesh is not always desirable since it might lead to the reduced quality of the quadrilaterals. The Blossom and the simple recombination algorithms will leave some triangles in the mesh in the case when recombining all the triangles would lead to low quality quads (either by the aspect ratio or angle criterion). In such cases, to generate full-quad meshes, the full-quad recombination algorithm is used. The algorithm performs a subdivision of the elements, followed by the further recombination and smoothing. The smoothing is performed using the Lloyd's algorithm, and then the whole sequence is repeated until all of the triangles have been matched [14]. We will employ the full recombination algorithm only in the case when the returned mixed mesh has more than 5% triangles. Even then, we will return both meshes and raise the flag that the processing pipeline did not produce a mesh which meets all of the constraints. We will see that the fully recombined mesh forces the satisfaction of requirement for almost no triangles at the expense of reducing the quality of the quadrilateral mesh. To this end, let us rigorously define the mesh quality measures which we will be using to check the compliance with the rules of the classification societies. For a quadrilateral \(q\) with internal angles \(\alpha_{i}(q)\), \(i=1,\cdots,4\), we define the quality measure  
\[\eta(q)=\max\left[1-\frac{2}{\pi}\max_{i}\left[\left|\frac{\pi}{2}-\alpha_{i }(q)\right|\right],0\right].\]  
This quality measure is equal to one for the perfect rectangle, and it is zero in the presence of angles which are less than zero or greater than the straight angle (a nonconvex quadrangle). Let now \(\mathcal{T}\) be the mixed tesselation consisting of quadrilaterals and triangles. The set \(\mathcal{T}\) is a disjoint union of the set of all quadrilaterals \(\mathcal{T}_{q}\) and the set of all triangles \(\mathcal{T}_{q}\)in the mesh. To define the stopping criterion, we introduce the following measures. Here, \(|\cdot|\) marks the cardinality of a finite set. The average \(\eta\) for the tesselation \(\mathcal{T}\) is defined by  
\[\overline{\eta}(\mathcal{T})=\frac{100}{|\mathcal{T}_{q}|}\sum_{q\in\mathcal{T} _{q}}\eta(q).\]  
The percentage of quadrilaterals with angles between \(80^{\circ}\) and \(100^{\circ}\) in \(\mathcal{T}\) is marked with  
\[\xi(\mathcal{T})=100\frac{|\{q\in\mathcal{T}_{q}\,:\,\,80^{\circ}\leq\alpha_{ i}(q)\leq 100^{\circ},i=1,2,3,4\}|}{|\mathcal{T}|}\]  
and the measure of the portion of the elements in the mesh which are not triangles is defined as \(\tau(\mathcal{T})=100(1-\frac{|\mathcal{T}_{1}|}{|\mathcal{T}|})\). Finally, we define the quantity \(\delta(\mathcal{T})\) as the percentage of irregular elements.