Before the morphing of the CAD geometry can begin, the undeformed mesh needs to be related back to the original CAD
geometry and its node parentage needs to be determined to ensure that the nodal displacements from the analysis are applied
to the correct areas of the CAD model. Most meshes do not carry the geometry parent information, so this needs to be recovered by
matching the mesh to the geometry.

The initial mesh-to-geometry matching algorithm was based on a simple geometric proximity algorithm, projecting nodes onto the
CAD model edges to partition the mesh. This method works well for meshes that are perfectly aligned with the geometry, however
many meshes are not. A new matching algorithm that can handle a wide range of industrial meshes has been developed to deal with
the matching failures caused by the misalignment of the mesh and CAD.

The new matching algorithm makes use of both geometric and topological data to match the mesh to the geometry. The algorithm
traces out the edges of the CAD topology onto the mesh; the tracing of an edge onto the mesh is called the edge image. These edge
images are used to segment the regions of nodes and elements which are then parented to appropriate faces in the CAD model.

The tracing process does not require the mesh to have nodes exactly on the CAD edges, meaning that the matching is far more
robust for misaligned meshes.

#### Fig. 2 - Misaligned mesh and topology

#### Fig. 3 - The CAD edges (orange) both use the same element edge (blue) in their edge images

Fig. 2 shows a misaligned mesh where the top edge is aligned with the mesh, but the bottom edge is not and crosses several
elements. It is possible to find an image of the bottom edge, but it requires a large matching tolerance.

There are cases where no unique images of the edges exist in the mesh, where the mesh topology does not match the topology
of the geometry. These cases can broadly be divided into two groups: abstracted edges and virtual topology.
Abstracted edges typically occur in meshes near sharp faces or narrow regions. In these cases, the faces are so narrow that the
mesh generator cannot position two distinct nodes on the opposite edges of the face, and so collapses them onto a single node,
removing elements from the mesh to avoid making degenerate or poor-quality elements. Fig. 3 shows an example of an abstracted
edge.

The matching algorithm does not require each edge image to be unique for every edge, allowing it to trace out two images from the
same edge in the mesh, leading to a full match, even when face regions have been pinched into two distinct regions on the mesh.
Virtual topology (VT) consists of deliberately misaligned mesh spanning several elements and multiple CAD faces. This often
occurs in regions of tight curvature or where there are many small CAD faces and the mesh generator cannot mesh the geometry with
acceptable element quality. Fig. 4 shows an example of a mesh from a VT region.

In this case, it is not possible to determine the edge images and to match the mesh exactly to the geometry. The nodes within a
VT region can still be parented to a unique face, but the elements cannot where they span multiple faces. The lack of element-to-face
parenting results means there is insufficient information to morph the geometry, but it does allow for a mesh-to-CAD comparison
based on node proximity only. The matching algorithm can discover the extent of the VT regions and identify groups of CAD
faces that belong to the VT region. Future enhancements are planned to enable nodal deformations to be interpolated from
the VT region onto the edges and faces that they cover, thereby enabling morphing.

For morphing to provide valuable benefits in industrial use cases it is required to handle large CAD models with complex geometries
and very large meshes. The limiting step in processing very large models is the mesh-to-CAD matching stage. The initial
implementation, using just geometric proximity data, limited the matching process to working with a single body, or multiple
bodies that did not touch. Coincident meshes from contacting bodies were too complex to untangle, and models containing
several bodies could not be morphed as the deformation data could not be applied to the correct surface in touching regions.

Fig. 5 shows an example of a large mesh after CAD geometry/ topology matching. The improved matching algorithm achieves
greater robustness by making use of the topology of the CAD model and enables the contacting bodies and mesh to be correctly
segmented and parented for morphing.

Performance is also significantly improved by the use of the CAD model’s topology. The number of geometrical queries is greatly
reduced, allowing the matching algorithm to run in a few seconds, compared to the original basic proximity approach which can
require several hours.

#### Fig. 4 - Mesh on a virtual topology region