From 17af3d009117bc4516a247a92abc7ef48bb56976 Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 4 Jun 2021 10:51:43 +0200 Subject: [PATCH] Timers, cleanup in delaunay --- libsrc/meshing/delaunay.cpp | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) 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);