diff --git a/libsrc/meshing/improve2.hpp b/libsrc/meshing/improve2.hpp index 4a6e49ea..dad6a3ae 100644 --- a/libsrc/meshing/improve2.hpp +++ b/libsrc/meshing/improve2.hpp @@ -84,16 +84,16 @@ extern void CalcTriangleBadness (double x2, double x3, double y3, -extern double CalcTriangleBadness (const Point3d & p1, - const Point3d & p2, - const Point3d & p3, +extern double CalcTriangleBadness (const Point<3> & p1, + const Point<3> & p2, + const Point<3> & p3, double metricweight, double h); -extern double CalcTriangleBadness (const Point3d & p1, - const Point3d & p2, - const Point3d & p3, - const Vec3d & n, +extern double CalcTriangleBadness (const Point<3> & p1, + const Point<3> & p2, + const Point<3> & p3, + const Vec<3> & n, double metricweight, double h); diff --git a/libsrc/meshing/improve3.cpp b/libsrc/meshing/improve3.cpp index 4215c169..435ba4cd 100644 --- a/libsrc/meshing/improve3.cpp +++ b/libsrc/meshing/improve3.cpp @@ -416,14 +416,8 @@ void MeshOptimize3d :: SplitImprove (Mesh & mesh, if (el[l] == pi2) has2 = 1; } if (has1 && has2) - { // only once - for (l = 0; l < hasbothpoints.Size(); l++) - if (hasbothpoints[l] == elnr) - has1 = 0; - - if (has1) - hasbothpoints.Append (elnr); - } + if (!hasbothpoints.Contains (elnr)) + hasbothpoints.Append (elnr); } bad1 = 0; diff --git a/libsrc/meshing/meshfunc2d.cpp b/libsrc/meshing/meshfunc2d.cpp index 40bab905..c3f2573e 100644 --- a/libsrc/meshing/meshfunc2d.cpp +++ b/libsrc/meshing/meshfunc2d.cpp @@ -6,18 +6,15 @@ namespace netgen DLL_HEADER void Optimize2d (Mesh & mesh, MeshingParameters & mp) { - int i; + static int timer = NgProfiler::CreateTimer ("optimize2d"); + NgProfiler::RegionTimer reg(timer); - //double h = mp.maxh; - mesh.CalcSurfacesOfNode(); const char * optstr = mp.optimize2d; int optsteps = mp.optsteps2d; - // cout << "optstr = " << optstr << endl; - - for (i = 1; i <= optsteps; i++) + for (int i = 1; i <= optsteps; i++) for (size_t j = 1; j <= strlen(optstr); j++) { if (multithread.terminate) break;