From a2cc1028493272ca1f267d70a2f2c31524fdbc5b Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Fri, 4 Jun 2021 13:31:44 +0200 Subject: [PATCH] delaunay - stay consistent with code on master --- libsrc/meshing/delaunay.cpp | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/libsrc/meshing/delaunay.cpp b/libsrc/meshing/delaunay.cpp index 88c6cd7e..045fd1ba 100644 --- a/libsrc/meshing/delaunay.cpp +++ b/libsrc/meshing/delaunay.cpp @@ -737,14 +737,10 @@ namespace netgen } - void DelaunayRemoveDegenerated( const Mesh::T_POINTS & points, NgArray & tempels ) + void DelaunayRemoveDegenerated( const Mesh::T_POINTS & points, NgArray & tempels, NgBitArray & badnode, int np ) { static Timer tdegenerated("Delaunay - remove degenerated"); RegionTimer rt(tdegenerated); - auto np = points.Size(); - - NgBitArray badnode(np); - badnode.Clear(); int ndeg = 0; for (int i = 1; i <= tempels.Size(); i++) { @@ -795,12 +791,10 @@ namespace netgen } // Remove flat tets containing two adjacent surface trigs - void DelaunayRemoveTwoTriaTets( const Mesh & mesh, NgArray & tempels, NgArray & openels ) + void DelaunayRemoveTwoTriaTets( const Mesh & mesh, NgArray & tempels, NgArray & openels, NgBitArray & badnode, int np ) { 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); @@ -887,9 +881,6 @@ namespace netgen // cout << "tetedges:"; // tetedges.PrintMemInfo (cout); - NgBitArray badnode(np); - badnode.Clear(); - for (INDEX_2_HASHTABLE::Iterator it = twotrias.Begin(); it != twotrias.End(); it++) { @@ -1622,11 +1613,13 @@ namespace netgen tempels.Append (el); } + NgBitArray badnode(mesh.GetNP()); + badnode.Clear(); - DelaunayRemoveDegenerated(mesh.Points(), tempels); + DelaunayRemoveDegenerated(mesh.Points(), tempels, badnode, np); NgArray openels; - DelaunayRemoveTwoTriaTets(mesh, tempels, openels); + DelaunayRemoveTwoTriaTets(mesh, tempels, openels, badnode, np); DelaunayRemoveIntersecting(mesh, tempels, openels, pmin, pmax); DelaunayRemoveOuter(mesh, tempels, adfront);