## 2 Methods
### Optimization Method
#### 2.4.5 Remeshing
The adapted mesh is obtained by connecting all surfaces of the cavity that do not contain vertex \(B\) with target vertex \(B\). In order to obtain a robust remeshing method, the first step is to test whether inverted tetrahedra are created during the filling process of the cavity operator. The filter-based orientation predicate described in [42] is used for this purpose. Secondly, when initially cutting the mesh with the level set functions based on the MT cases, a vertex can be zero, negative or positive instead of only positive or negative. A disadvantage of the cavity operator is the somewhat slower performance compared to explicitly implemented mesh operators. However, this disadvantage can be remedied by thread-based parallelization. In this paper, the vertex smoothing and the edge-collapse phase are parallelized. For the vertex smoothing phase, a heuristic graph coloring is used to  
Figure 8: (**a**) Mesh with classification of vertices into volume and boundary vertices based on [38]. (**b**) Invalid edge collapse since the collapse does not preserve the interface position (non-feature preserving). (**c**) Valid edge collapse since the collapse preserves the interface (feature preserving). Figure 9: Examples of cavity operations. (**a**) Edge collapse: the cavity is initialized with all adjacent elements (triangles or tetrahedra) of vertex \(A\), and vertex \(B\) serves as the target vertex for the meshing. (**b**) Edge swap: the cavity is initialized with all elements adjacent to edge BC, and node \(A\) serves as the target node for meshing. identify independent cavities. The vertices of each color are then processed using #threads. After the vertices of a color have been smoothed, the threads are synchronized [43]. The edge collapse phase is parallelized using the producer consumer pattern. We use #threads-1 producer and 1 consumer. After the edges with too short a length have been identified, the producers test all the preconditions described above and then attempt to perform the collapse virtually. If a collapse is valid, it is entered in a queue. The consumer removes the pre-selected collapses and executes them with renewed preliminary checks. The latter is necessary, as the mesh in the vicinity of the edge may have changed in the time between insertion into the queue and execution of the collapse due to other collapses executed by the worker, meaning that the collapse may no longer be valid. The parallelization strategy is based on the fact that only about 10% of the edge collapses per iteration are valid and can be executed. The cavity operator described only works inside the volume and not at the boundary. Since no extra operator is implemented for the boundary region and the method described requires a convex region, a mesh preparation step is necessary [38]. In the first step, the convex hull of the region is determined and an offset is then formed from this using the method described in [44]. The resulting volume is filled with tetrahedra. We use the fTetWild algorithm [45] for this. This preparation now makes it possible to apply the cavity operator described above to the entire area, as the filled offset means that the surface tetrahedra are surrounded by elements (see Figure 10) [38].