diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 01c69dbb..df1a7902 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -795,17 +795,16 @@ namespace netgen } // Remove flat tets containing two adjacent surface trigs - NgArray DelaunayRemoveTwoTriaTets( const Mesh & mesh, NgArray & tempels ) + void DelaunayRemoveTwoTriaTets( const Mesh & mesh, NgArray & tempels, NgArray & openels ) { - static Timer topenel("Delaunay - find openel"); - topenel.Start(); + static Timer topenel("Delaunay - find openel"); RegionTimer rt(topenel); auto np = mesh.GetNP(); // find surface triangles which are no face of any tet INDEX_3_HASHTABLE openeltab(mesh.GetNOpenElements()+3); - NgArray openels; + openels.SetSize(0); for (int i = 1; i <= mesh.GetNOpenElements(); i++) { const Element2d & tri = mesh.OpenElement(i); @@ -837,9 +836,6 @@ namespace netgen } - - - // find open triangle with close edge (from halfening of surface squares) INDEX_2_HASHTABLE twotrias(mesh.GetNOpenElements()+5); @@ -931,16 +927,11 @@ namespace netgen badnode.Test(el[3]) ) tempels.DeleteElement(i); } - - - topenel.Stop(); - - return openels; } void DelaunayRemoveIntersecting( const Mesh & mesh, NgArray & tempels, NgArray & openels, Point3d pmin, Point3d pmax ) { - static Timer trem_intersect("Delaunay - remove intersecting"); RegionTimert(trem_intersect); + static Timer trem_intersect("Delaunay - remove intersecting"); RegionTimer rt(trem_intersect); // find intersecting: PrintMessage (3, "Remove intersecting"); @@ -1633,7 +1624,9 @@ namespace netgen DelaunayRemoveDegenerated(mesh.Points(), tempels); - auto openels = DelaunayRemoveTwoTriaTets(mesh, tempels); + + NgArray openels; + DelaunayRemoveTwoTriaTets(mesh, tempels, openels); DelaunayRemoveIntersecting(mesh, tempels, openels, pmin, pmax); DelaunayRemoveOuter(mesh, tempels, adfront);