# Evolution of Fidelity Pointwise T-Rex Meshing for Resolving Viscous Layers

Fidelity^{™}* * Pointwise* ^{®}* T-Rex meshing, predominantly used for near body or boundary layer meshing with special handling of symmetry boundaries, sharp edges (in multiple marching directions), and baffles or thin surfaces has evolved over these years using different cell combination algorithms. Using the simplest cell combination algorithm in T-Rex, an 11% reduction in cell count is achieved while the latest tet-based combination with quad-dominant surface formation can reduce the cell count by about 70%. This significant reduction in cell count is accomplished while improving or maintaining the cell quality and addressing the geometry needs for mixed cell-type meshes, that is, by improving the degrees of tet combination into hex, prisms, and pyramids. Further, using tet-based data storage algorithms can reduce the CPU time for combined cell formation by a factor of 5.6 with an 80% reduction in coding requirements over vertex-based methods.

# T-Rex Meshing

The anisotropic tetrahedral extrusion (T-Rex) mesh algorithm has been in use within the Fidelity Pointwise mesh generation software for more than eight years. It employs an open mesh algorithm, generating tets that may be post-processed into hexes, prisms, and pyramids.

**What is an “open” mesh algorithm?**

“Open” means that the anisotropic portion of the mesh is first generated using an advancing layer or advancing normal approach, with the remaining void filled with isotropic elements, such as tets or voxels (hexahedra).

Early and midterm development of T-Rex focused heavily on techniques to achieve cell quality and on adjusting vertex positions to extend the growth of anisotropic layers to capture the entire boundary layer. More recent development has shown a gradual transition in effort from grid construction and quality improvements to methods of reducing the overall cell count via the combination of tets into hexes, prisms, and pyramids.

# Initial T-Rex Algorithms

The initial T-Rex algorithms summarized below were based on the concept of watertight sets of triangular fronts advancing inward into the meshing domain, filling voids made by deformed front vertices with carefully defined tetrahedra.

**i. Multiple normals**

For sharp convex bend angles on advancing layer surfaces, the direction of deformation, defined nominally as the average normal of adjacent tri faces, can be nearly perpendicular to the normal of adjacent vertices. The net effect of this algorithm is to reduce the maximum angle present at the edges to values closer to 90 degrees.

*Figure 1. Multiple normals emanating from sharp edges reduce the maximum bend angle in the mesh.*

**ii. Baffles**

The term “baffle” indicates a non-closed collection of surfaces that is either interior or adjacent to closed outer or inner surface fronts. Their exposed, non-watertight edges distinguish them from regular surfaces and are generally used to represent infinitely thin geometry (sheet metal) or as a false geometric boundary, to control grid point sizing on the mesh interior.

*Figure 2. Examples of baffles used as front and match surfaces.*

**iii. Quads as match surfaces**

T-Rex meshes are usually stored as unstructured meshes, but frequently abut structured hex volume grids via quads on the shared surfaces. When quad surfaces are assigned a front boundary condition in T-Rex (cells advanced away from the surface), tets are created on each layer under the deforming surfaces. If a match condition is applied to the quads instead, the presence of the pyramid tip vertex would prevent the front/match vertex from advancing up the side of the quad surfaces.

*Figure 3. Schematic of the decimation of quad match surfaces. (a) Vertices to be merged from match surface to front are identified (a,b,c to a',b',c'), (b) Vertices are merged and the front is reconnected together, (c) The remaining vertices on match/front edge are decimated.*

Shortly after T-Rex’s initial implementation, the benefits of using these algorithms for a larger purpose were understood; surface-constrained near-body prism blocks and the adjacent isotropic field blocks could now be replaced with a single anisotropic-isotropic block, covering the entire domain of interest.

# Advances to T-Rex Cell Combinations

For CFD accuracy and efficiency, prism elements were widely preferred over anisotropic tets, so techniques for combining raw anisotropic tet cells into a larger pyramid, prism, and hex forms were implemented and are briefly explained below:

**A. Vertex-based data storage**

The development of cell combination techniques helped build a collection of grids on which new cell combination methods could be tested and assessed. The vertex-based combined cell storage was well-suited for the extraction of full prism layers from T-Rex blocks and the evolving technique.

**i. Prism layer extraction**

This cell combination data structure was designed to facilitate the automatic post-processing of tet data into individual blocks corresponding to the component meshes generated before T-Rex.

**ii. Basic mixed element combination**

This cell combination eased the overly restrictive requirement that all vertices in a layer must advance for any cell combination to take place in that layer. This approach proved robust for the basic deformation, refinement, and aniso-to-iso decimation operators.

*Figure 4. Multiple normals emanating from convex edges (left) create tets between normals that combine into non-standard elements (right), each with 2 quad and 2 triangle faces.*

**iii. Optimal match surface combination**

The difficulties in capturing match surface triangles stifled the widespread applicability of mixed element combinations in T-Rex.

This was remedied by decimating vertices on the front-match edge in an order that forms cells that capture the match triangles, thereby allowing vertices to stop decimation locally without in-validating the tet and tri combination.

*Figure 5. Match surface triangles tri(b,c,b’) and tri(c,c’,b’) are not preserved when tet(b,e,c,c’) alone is formed. If tet (b,e,c’,b’) is also formed, the match tris are replaced by quad (b,c,c’,b’).*

**iv. Treatment of non-combinable elements**

During layer advancement, as soon as the first combined cell is rejected due to quality constraints, all cells on that layer and above could only be safely processed as tets. If a rejected combination occurred in the first layer, no cells at all would be combined.

*Figure 6. Schematic of optimal match/front edge decimation order.*

The solution to this problem was to modify the vertex processing order during layer advancement, essentially deferring any deformation, refinement, or decimation of a vertex/triangle if the potential combined element failed any quality criterion.

**v. Treatment of multiple normals**

The use of multiple normals at convex edges automatically precludes any chance for cell combination.

A reasonable compromise is to deform the multi-norm vertices first and advance the remainder of the surface vertices while enabling cell combination. The loss of cell combination is very low in this approach, limited to cells near the sharp convex corners, which generally occur only on a small percentage of surface edges.

**vi. Treatment of multiple blocks**

On match surfaces, a modicum of edge swapping and a larger degree of triangle-triangle merging is necessary to maximize cell combination. A bigger problem pertains to the combination of triangle pairs on match surfaces into quads.

The solution to this problem using vertex-based algorithms is to count the number of fully combinable layers in each block in the system and to restrict the combination in all blocks to the least number of layers in any of the blocks

**B. Tet-based data storage**

The tet type storage structure has both coding and maintainability advantages over vertex-based data storage, as follows:

- Prisms and pyramids can be formed directly from these arrays
- By orienting tet vertex definitions consistently, the combined cells can be formed very efficiently
- CPU time spent for combined cell formation is reduced by a factor of 5.6
- The tet-based technique requires only 1,000 lines of code

**i. Treatment of multiple blocks**

The benefit offered by tet-based algorithms is that it allows cells to combine independently between layers, and ease problems with multiple blocks sharing a matching surface.

For all layers, interior cells not touching a matching surface are fully combined, as are those touching match surfaces on layers without a mismatch.

*Figure 7. Tet-based multiple block cell combination (cross-section) – the degree of cell combination is reduced (cyan cells) only on layers of cells touching boundary faces that do not combine consistently across the blocks. Cell combination on block interiors is not affected.*

**ii. Hex cell combination**

To allow the combination of tets and pyramids into hexes, it was necessary to modify the order of deformation on front vertices. In the first layer, all pyramid tips are advanced first, and then the remaining front vertices are advanced.

*Figure 8. Large dihedral angles on surface pyramids with high aspect ratio. (Left) 3D representation, (Right) 2D representation.*

**iii. Hex cell recombination, version 2**

Using this new approach, the removal of the pyramid vertices increased the final front sizes by a factor of 2, reducing the number of isotropic tets formed. It also reduces the front complexity, particularly with high aspect ratio triangles. With the tips removed, the maximum triangle is closer to 90 degrees than 180.

*Figure 9. Prototypical maximum angles on fronts. (a) Hex combination version 1, (b) Hex combination version 2.*

**iv. Combined triangle quad-dominant surface cells**

To assess the generality of the hex combination algorithm, the ability to group surface front triangles into pairs was added using this cell combination, hence, treating them as quads before layer advancement.

**v. Algorithmic quad-dominant surface cells**

In this cell combination, the quads are formed with the full complement of meshing operators, including vertex insertion, decimation, smoothing, and repeated edge swapping. The result generally contains a larger percentage of quads in the completed surface mesh and the cell count is reduced by 70%.

# Conclusion

Fidelity Pointwise’s T-Rex advancing layer algorithm has proven to be a powerful and reliable tool for anisotropic mesh generation. Recent extensions to the method have expanded the range of geometries and the types of meshes than can now be meshed routinely. To improve cell quality while reducing cell count, significant effort has also been expended in improving the degree of tet combination into hex, prisms, and pyramids. The path toward the current state of cell combination has seen steady improvement over the past several years.

**Reference**

- Steinbrenner, John P., “Construction of Prism and Hex Layers from Anisotropic Tetrahedra,” AIAA paper no. 2015-2296, June 2015.

Request a free trial of Fidelity Pointwise and see how T-Rex improves your meshes!