From 80d648c0055058adb2ed1ba27ca3ef3e3d58a0fc Mon Sep 17 00:00:00 2001 From: Matthias Hochsteger Date: Thu, 10 Jun 2021 09:54:38 +0200 Subject: [PATCH] parallel evaluation of localh in ImproveMesh() --- libsrc/meshing/smoothing3.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libsrc/meshing/smoothing3.cpp b/libsrc/meshing/smoothing3.cpp index b172ddaf..a5787cb1 100644 --- a/libsrc/meshing/smoothing3.cpp +++ b/libsrc/meshing/smoothing3.cpp @@ -1459,6 +1459,7 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal) static Timer tcalcbadmax("Calc badmax"); static Timer topt("optimize"); static Timer trange("range"); + static Timer tloch("loch"); // return ImproveMeshSequential(mp, goal); BuildBoundaryEdges(false); @@ -1502,12 +1503,16 @@ void Mesh :: ImproveMesh (const MeshingParameters & mp, OPTIMIZEGOAL goal) (*testout) << setprecision(8); - NgArray pointh (points.Size()); + Array pointh (points.Size()); if(lochfunc) { - for (PointIndex pi : points.Range()) - pointh[pi] = GetH(points[pi]); + RegionTimer rt(tloch); + ParallelForRange(points.Range(), [&] (auto myrange) + { + for(auto pi : myrange) + pointh[pi] = GetH(points[pi]); + }); } else {