From 9ff592686b5dc6e501be5d939313f9482afd11f3 Mon Sep 17 00:00:00 2001
From: Amaury Johnen <amaury.johnen@uclouvain.be>
Date: Fri, 2 Jun 2017 20:31:21 +0200
Subject: [PATCH] fix bug progress display

---
 Plugin/AnalyseCurvedMesh.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/Plugin/AnalyseCurvedMesh.cpp b/Plugin/AnalyseCurvedMesh.cpp
index 207f9329a3..7489f3ddee 100644
--- a/Plugin/AnalyseCurvedMesh.cpp
+++ b/Plugin/AnalyseCurvedMesh.cpp
@@ -325,6 +325,7 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeMinMaxJandValidity(int dim)
     double initial, time = initial = Cpu();
     unsigned int percentage = 0, nextCheck = 0;
 
+    _data.reserve(_data.size()+num);
     for (unsigned i = 0; i < num; ++i) {
       MElement *el = entity->getMeshElement(i);
       double min, max;
@@ -335,14 +336,14 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeMinMaxJandValidity(int dim)
       }
 
       if (i >= nextCheck) {
-        nextCheck += _data.size() / 100;
+        nextCheck += num / 100;
         double curTime = Cpu();
-        unsigned int curPercentage = i*100/_data.size();
+        unsigned int curPercentage = i*100/num;
         if ((curTime - time > 10. && curPercentage > percentage + 4) ||
             (curTime - time > 15. && curPercentage < 5)) {
           percentage = curPercentage;
           time = curTime;
-          const double remaining = (time-initial) / (i+1) * (_data.size() - i-1);
+          const double remaining = (time-initial) / (i+1) * (num - i-1);
           if (remaining < 60*2)
             Msg::StatusBar(true, "%d%% (remaining time ~%g seconds)",
                 percentage, remaining);
-- 
GitLab