From 8cd443d18a48f745c5d927328ae6f402296e0b29 Mon Sep 17 00:00:00 2001
From: Thomas Toulorge <thomas.toulorge@mines-paristech.fr>
Date: Tue, 18 Nov 2014 17:09:22 +0000
Subject: [PATCH] Updated terminology in mesh optimizers (also changed API and
 GUI)

---
 Fltk/highOrderToolsWindow.cpp                 | 13 +++--
 contrib/HighOrderMeshOptimizer/OptHomRun.cpp  | 16 +++---
 contrib/MeshOptimizer/MeshOpt.cpp             |  6 +-
 contrib/MeshOptimizer/MeshOptCommon.h         | 14 ++---
 contrib/MeshOptimizer/MeshOptimizer.cpp       | 24 ++++----
 .../MeshOptimizer/doc/mesh_optimization.tex   | 57 ++++++++++---------
 .../MeshQualityOptimizer.cpp                  | 20 +++----
 .../MeshQualityOptimizer.h                    | 14 ++---
 8 files changed, 83 insertions(+), 81 deletions(-)

diff --git a/Fltk/highOrderToolsWindow.cpp b/Fltk/highOrderToolsWindow.cpp
index 9beebec87c..c07f816eb7 100644
--- a/Fltk/highOrderToolsWindow.cpp
+++ b/Fltk/highOrderToolsWindow.cpp
@@ -115,10 +115,10 @@ static void chooseopti_cb(Fl_Widget *w, void *data)
 static void chooseopti_strategy(Fl_Widget *w, void *data)
 {
   highOrderToolsWindow *o = FlGui::instance()->highordertools;
-  if (o->choice[3]->value() == 0)
-    for (int i=9;i<=11;i++) o->value[i]->deactivate();
-  else
+  if (o->choice[3]->value() == 1)
     for (int i=9;i<=11;i++) o->value[i]->activate();
+  else
+    for (int i=9;i<=11;i++) o->value[i]->deactivate();
 }
 
 static void highordertools_runopti_cb(Fl_Widget *w, void *data)
@@ -350,7 +350,7 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
 
   y += BH;
   value[4] = new Fl_Value_Input
-    (x, y, IW, BH, "Max. number of optimization passes");
+    (x, y, IW, BH, "Max. number of barrier updates");
   value[4]->minimum(1);
   value[4]->maximum(100);
   value[4]->step(1);
@@ -358,8 +358,9 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
   value[4]->value(50);
 
   static Fl_Menu_Item menu_strategy[] = {
-    {"Connected blobs", 0, 0, 0},
+    {"Disjoint strong", 0, 0, 0},
     {"Adaptive one-by-one", 0, 0, 0},
+    {"Disjoint weak", 0, 0, 0},
     {0}
   };
 
@@ -372,7 +373,7 @@ highOrderToolsWindow::highOrderToolsWindow(int deltaFontSize)
 
   y += BH;
   value[9] = new Fl_Value_Input
-    (x, y, IW, BH, "Max. number of blob adaptation iter.");
+    (x, y, IW, BH, "Max. number of patch adaptation iter.");
   value[9]->minimum(1);
   value[9]->maximum(100);
   value[9]->step(1);
diff --git a/contrib/HighOrderMeshOptimizer/OptHomRun.cpp b/contrib/HighOrderMeshOptimizer/OptHomRun.cpp
index 340620daf0..69e612606e 100644
--- a/contrib/HighOrderMeshOptimizer/OptHomRun.cpp
+++ b/contrib/HighOrderMeshOptimizer/OptHomRun.cpp
@@ -723,14 +723,14 @@ HOPatchDefParameters::HOPatchDefParameters(const OptHomParameters &p)
   jacMin = p.BARRIER_MIN;
   jacMax = (p.BARRIER_MAX > 0.) ? p.BARRIER_MAX : 1.e300;
   strategy = (p.strategy == 1) ? MeshOptPatchDef::STRAT_ONEBYONE :
-                                 MeshOptPatchDef::STRAT_CONNECTED;
+                                 MeshOptPatchDef::STRAT_DISJOINT;
   minLayers = (p.dim == 3) ? 1 : 0;
   maxLayers = p.nbLayers;
   distanceFactor = p.distanceFactor;
-  if (strategy == MeshOptPatchDef::STRAT_CONNECTED)
+  if (strategy == MeshOptPatchDef::STRAT_DISJOINT)
     weakMerge = (p.strategy == 2);
   else {
-    maxAdaptPatch = p.maxAdaptBlob;
+    maxPatchAdapt = p.maxAdaptBlob;
     maxLayersAdaptFact = p.adaptBlobLayerFact;
     distanceAdaptFact = p.adaptBlobDistFact;
   }
@@ -780,7 +780,7 @@ void HighOrderMeshOptimizerNew(GModel *gm, OptHomParameters &p)
   par.useGeomForOpt = false;
   HOPatchDefParameters patchDef(p);
   par.patchDef = &patchDef;
-  par.optDisplay = 30;
+  par.displayInterv = 30;
   par.verbose = 4;
 
   ObjContribScaledNodeDispSq<ObjContribFuncSimple> nodeDistFunc(p.weight,
@@ -793,8 +793,8 @@ void HighOrderMeshOptimizerNew(GModel *gm, OptHomParameters &p)
   CADDistFunc.setTarget(p.optCADDistMax);
 
   MeshOptPass minJacPass;
-  minJacPass.barrierIterMax = p.optPassMax;
-  minJacPass.optIterMax = p.itMax;
+  minJacPass.maxParamUpdates = p.optPassMax;
+  minJacPass.maxOptIter = p.itMax;
   minJacPass.contrib.push_back(&nodeDistFunc);
   minJacPass.contrib.push_back(&minJacBarFunc);
   if (p.optCAD) minJacPass.contrib.push_back(&CADDistFunc);
@@ -802,8 +802,8 @@ void HighOrderMeshOptimizerNew(GModel *gm, OptHomParameters &p)
 
   if (p.BARRIER_MAX > 0.) {
     MeshOptPass minMaxJacPass;
-    minMaxJacPass.barrierIterMax = p.optPassMax;
-    minMaxJacPass.optIterMax = p.itMax;
+    minMaxJacPass.maxParamUpdates = p.optPassMax;
+    minMaxJacPass.maxOptIter = p.itMax;
     minMaxJacPass.contrib.push_back(&nodeDistFunc);
     minMaxJacPass.contrib.push_back(&minMaxJacBarFunc);
     if (p.optCAD) minMaxJacPass.contrib.push_back(&CADDistFunc);
diff --git a/contrib/MeshOptimizer/MeshOpt.cpp b/contrib/MeshOptimizer/MeshOpt.cpp
index 6163d8f8f1..261a8611f6 100644
--- a/contrib/MeshOptimizer/MeshOpt.cpp
+++ b/contrib/MeshOptimizer/MeshOpt.cpp
@@ -177,7 +177,7 @@ void MeshOpt::runOptim(alglib::real_1d_array &x,
 
 int MeshOpt::optimize(const MeshOptParameters &par)
 {
-  _intervDisplay = par.optDisplay;
+  _intervDisplay = par.displayInterv;
   _verbose = par.verbose;
 
   // Set initial guess & result
@@ -213,10 +213,10 @@ int MeshOpt::optimize(const MeshOptParameters &par)
 
     // Loop for update of objective function parameters (barrier movement)
     bool targetReached = _objFunc->targetReached();
-    for (int iBar=0; (iBar<par.pass[_iPass].barrierIterMax) && (!targetReached); iBar++) {
+    for (int iBar=0; (iBar<par.pass[_iPass].maxParamUpdates) && (!targetReached); iBar++) {
       if (_verbose > 2) Msg::Info("--- Optimization run %d", iBar);
       _objFunc->updateParameters();
-      runOptim(x, gradObj, par.pass[_iPass].optIterMax);
+      runOptim(x, gradObj, par.pass[_iPass].maxOptIter);
       _objFunc->updateMinMax();
       targetReached = _objFunc->targetReached();
       if (_objFunc->stagnated()) {
diff --git a/contrib/MeshOptimizer/MeshOptCommon.h b/contrib/MeshOptimizer/MeshOptCommon.h
index 7c9aa9d0fb..151d115d1c 100644
--- a/contrib/MeshOptimizer/MeshOptCommon.h
+++ b/contrib/MeshOptimizer/MeshOptCommon.h
@@ -41,16 +41,16 @@ class ObjContrib;
 
 class MeshOptPatchDef {
 public:
-  enum { STRAT_CONNECTED, STRAT_ONEBYONE };
-  int strategy;                                         // Strategy: connected patches or adaptive one-by-one
+  enum { STRAT_DISJOINT, STRAT_ONEBYONE };
+  int strategy;                                         // Strategy: disjoint patches or adaptive one-by-one
   int minLayers, maxLayers;                             // Min. and max. nb. of layers around a bad element in patch
   union {
     struct {                                            // If adaptive strategy:
-      int maxAdaptPatch;                                // Max. nb. of adaptation iterations
+      int maxPatchAdapt;                                // Max. nb. of adaptation iterations
       int maxLayersAdaptFact;                           // Growth rate in number of layers around a bad element
       double distanceAdaptFact;                         // Growth rate in max. distance from bad element
     };
-    bool weakMerge;                                     // If connected strategy: weak or strong merging of patches
+    bool weakMerge;                                     // If disjoint strategy: weak or strong merging of patches
   };
   virtual ~MeshOptPatchDef() {}
   virtual double elBadness(MElement *el,                // Determine "badness" of a given element (for patch creation)
@@ -68,8 +68,8 @@ protected:
 
 struct MeshOptPass {                                    // Parameters controlling the optimization procedure in each pass
   std::vector<ObjContrib*> contrib;                     // Indices of contributions to objective function
-  int optIterMax;                                       // Max. number of opt. iterations each time the barrier is moved
-  int barrierIterMax;                                   // Max. number of times the barrier is moved
+  int maxOptIter;                                       // Max. number of opt. iterations each time the barrier is moved
+  int maxParamUpdates;                                  // Max. number of times the obj. func. parameters are updated (i.e. the barrier is moved)
 };
 
 
@@ -80,7 +80,7 @@ struct MeshOptParameters {                              // Parameters controllin
   bool useGeomForPatches, useGeomForOpt;                // Whether to use info from CAD for creation of patches and for optimization
   MeshOptPatchDef *patchDef;
   std::vector<MeshOptPass> pass;
-  int optDisplay;                                       // Sampling rate in opt. iterations for display
+  int displayInterv;                                    // Sampling rate in opt. iterations for display
   int verbose;                                          // Level of information displayed and written to disk
   int success;                                          // Success flag: -1 = fail, 0 = partial fail (target not reached), 1 = success
   double CPU;                                           // Time for optimization
diff --git a/contrib/MeshOptimizer/MeshOptimizer.cpp b/contrib/MeshOptimizer/MeshOptimizer.cpp
index d7041ea89a..f52165efd7 100644
--- a/contrib/MeshOptimizer/MeshOptimizer.cpp
+++ b/contrib/MeshOptimizer/MeshOptimizer.cpp
@@ -178,10 +178,10 @@ void calcElement2Entity(GEntity *entity, elEntMap &element2entity)
 }
 
 
-std::vector<elSetVertSetPair> getConnectedPatches(const vertElVecMap &vertex2elements,
-                                                  const elEntMap &element2entity,
-                                                  const elSet &badElements,
-                                                  const MeshOptParameters &par)
+std::vector<elSetVertSetPair> getDisjointPatches(const vertElVecMap &vertex2elements,
+                                                 const elEntMap &element2entity,
+                                                 const elSet &badElements,
+                                                 const MeshOptParameters &par)
 {
   Msg::Info("Starting patch generation from %i bad elements...", badElements.size());
 
@@ -253,16 +253,16 @@ std::vector<elSetVertSetPair> getConnectedPatches(const vertElVecMap &vertex2ele
 }
 
 
-void optimizeConnectedPatches(const vertElVecMap &vertex2elements,
-                              const elEntMap &element2entity,
-                              elSet &badasses, MeshOptParameters &par)
+void optimizeDisjointPatches(const vertElVecMap &vertex2elements,
+                             const elEntMap &element2entity,
+                             elSet &badasses, MeshOptParameters &par)
 {
   par.success = 1;
 
   const elEntMap &e2ePatch = par.useGeomForPatches ? element2entity : elEntMap();
   const elEntMap &e2eOpt = par.useGeomForOpt ? element2entity : elEntMap();
 
-  std::vector<elSetVertSetPair> toOptimize = getConnectedPatches(vertex2elements,
+  std::vector<elSetVertSetPair> toOptimize = getDisjointPatches(vertex2elements,
                                                                  e2ePatch, badasses, par);
 
   for (int iPatch = 0; iPatch < toOptimize.size(); ++iPatch) {
@@ -354,7 +354,7 @@ void optimizeOneByOne(const vertElVecMap &vertex2elements,
     int success;
 
     // Patch adaptation loop
-    for (int iAdapt=0; iAdapt<par.patchDef->maxAdaptPatch; iAdapt++) {
+    for (int iAdapt=0; iAdapt<par.patchDef->maxPatchAdapt; iAdapt++) {
 
       // Set up patch
       const double limDist = par.patchDef->maxDistance(worstEl);
@@ -394,7 +394,7 @@ void optimizeOneByOne(const vertElVecMap &vertex2elements,
       }
 
       // If (partial) success, update mesh and break adaptation loop, otherwise adapt
-      if ((success > 0) || (iAdapt == par.patchDef->maxAdaptPatch-1)) {
+      if ((success > 0) || (iAdapt == par.patchDef->maxPatchAdapt-1)) {
         opt.updateResults();
         if (success >= 0) {
           opt.patch.updateGEntityPositions();
@@ -461,8 +461,8 @@ void meshOptimizer(GModel *gm, MeshOptParameters &par)
     }
   }
 
-  if (par.patchDef->strategy == MeshOptPatchDef::STRAT_CONNECTED)
-    optimizeConnectedPatches(vertex2elements, element2entity, badElts, par);
+  if (par.patchDef->strategy == MeshOptPatchDef::STRAT_DISJOINT)
+    optimizeDisjointPatches(vertex2elements, element2entity, badElts, par);
   else if (par.patchDef->strategy == MeshOptPatchDef::STRAT_ONEBYONE)
     optimizeOneByOne(vertex2elements, element2entity, badElts, par);
   else
diff --git a/contrib/MeshOptimizer/doc/mesh_optimization.tex b/contrib/MeshOptimizer/doc/mesh_optimization.tex
index 472a277ac2..87b6038294 100644
--- a/contrib/MeshOptimizer/doc/mesh_optimization.tex
+++ b/contrib/MeshOptimizer/doc/mesh_optimization.tex
@@ -330,7 +330,7 @@ struct MeshOptParameters {
   bool useGeomForPatches, useGeomForOpt;
   MeshOptPatchDef *patchDef;
   std::vector<MeshOptPass> pass;
-  int optDisplay;
+  int displayInterv;
   int verbose;
   int success;
   double CPU;
@@ -364,7 +364,7 @@ Section~\ref{sec:patch-selec}).
 \item The vector \texttt{pass} contains instances of the structure
 \texttt{MeshOptPass}, which determines the optimization procedure
 for each pass, as described hereafter.
-\item The fields \texttt{optDisplay} and \texttt{verbose} control
+\item The fields \texttt{displayInterv} and \texttt{verbose} control
 the output (respectively the iteration interval at which the progress
 of the Conjugate Gradient procedure is printed to screen and the
 overall level of verbosity).
@@ -380,8 +380,8 @@ procedure for each pass, is as follows:
 \begin{verbatim}
 struct MeshOptPass {
   std::vector<ObjContrib*> contrib;
-  int optIterMax;
-  int barrierIterMax;
+  int maxOptIter;
+  int maxParamUpdates;
 };
 \end{verbatim}
 
@@ -392,10 +392,10 @@ where:
 of classes derived from \texttt{ObjContrib}, each instance
 describing a contribution to the objective function (see
 Section~\ref{sec:obj-func}).
-\item The field \texttt{optIterMax} gives the maximum number of
+\item The field \texttt{maxOptIter} gives the maximum number of
 Conjugate Gradient iterations to be performed for a given objective
 function (i.e. before a potential log barrier is moved).
-\item The field \texttt{barrierIterMax} determines the maximum
+\item The field \texttt{maxParamUpdates} determines the maximum
 number of times the objective function is changed, i.e. the number
 of times a potential log barrier is moved.
 \end{itemize}
@@ -414,7 +414,7 @@ public:
   int minLayers, maxLayers;
   union {
     struct {
-      int maxAdaptPatch;
+      int maxPatchAdapt;
       int maxLayersAdaptFact;
       double distanceAdaptFact;
     };
@@ -439,7 +439,7 @@ and the number of layers in the patch:
 
 \begin{itemize}
 \item The field \texttt{strategy} specifies the overall strategy
-with (\texttt{STRAT\_CONNECTED} for merging overlapping patches
+with (\texttt{STRAT\_DISJOINT} for merging overlapping patches
 or \texttt{STRAT\_ONEBYONE} for a sequential treatment, see
 Section~\ref{sec:strategy}).
 \item The fields \texttt{minLayers} and \texttt{maxLayers} give
@@ -448,14 +448,14 @@ surrounding the bad element to be included in the patch.
 \item Depending on the strategy chosen, additional information
 must be provided:
 \begin{itemize}
-\item If the strategy is \texttt{STRAT\_CONNECTED}, the field
+\item If the strategy is \texttt{STRAT\_DISJOINT}, the field
 \texttt{weakMerge} specifies whether two patches are merged if
 they overlap (value \texttt{false}), or only if a bad element
 of one patch is included in the other one (value \texttt{true}).
 \item If the strategy is \texttt{STRAT\_ONEBYONE}, an adaptive
 process loop is used: the patch size is progressively increased
 in case the optimization procedure fails. The maximum number of
-adaptations is then controlled by the field \texttt{maxAdaptPatch}.
+adaptations is then controlled by the field \texttt{maxPatchAdapt}.
 The growth factor in maximum number of layers and in the maximum
 distance criterion at each adaptation is specified by the fields
 \texttt{maxLayersAdaptFact} and \texttt{distanceAdaptFact}
@@ -694,17 +694,17 @@ of the node displacement contribution compared to the Jacobian
 contributions.
 \item \texttt{Maximum number of iterations} is the maximum number
 of iterations in the Conjugate Gradient algorithm (see
-\texttt{optIterMax} in Section~\ref{sec:input-param}).
-\item \texttt{Max. number of optimization passes} is the maximum number
-of times the log barriers are moved (see \texttt{barrierIterMax} in
+\texttt{maxOptIter} in Section~\ref{sec:input-param}).
+\item \texttt{Max. number of barrier updates} is the maximum number
+of times the log barriers are moved (see \texttt{maxParamUpdates} in
 Section~\ref{sec:input-param}).
 \item \texttt{Strategy} determines the strategy for the treatment of
 patches (see Sections~\ref{sec:strategy} and~\ref{sec:patch-selec}).
 \item \texttt{Max. number of blob adaptation iter.},
 \texttt{Num. layer adaptation factor} and
 \texttt{Distance adaptation factor} control the adaptation of the
-patch size with the ``adaptive one-by-one'' strategy (see
-\texttt{maxAdaptPatch}, \texttt{maxLayersAdaptFact} and
+patch size in the ``adaptive one-by-one'' strategy (see
+\texttt{maxPatchAdapt}, \texttt{maxLayersAdaptFact} and
 \texttt{distanceAdaptFact} in Section~\ref{sec:patch-selec}).
 \end{itemize}
 
@@ -735,15 +735,15 @@ struct MeshQualOptParameters {
   double weight;
   int nbLayers;
   int dim;
-  int optIterMax;
-  int barrierIterMax;
+  int maxOptIter;
+  int maxBarrierUpdates;
   bool onlyVisible;
   double distanceFactor;
   bool fixBndNodes;
   int strategy;
-  int maxAdaptBlob;
-  int adaptBlobLayerFact;
-  double adaptBlobDistFact;
+  int maxPatchAdapt;
+  int maxLayersAdaptFact;
+  double distanceAdaptFact;
   int SUCCESS;
   double minIdealJac, maxIdealJac;
   double minInvCondNum, maxInvCondNum;
@@ -753,12 +753,13 @@ struct MeshQualOptParameters {
     : onlyValidity(false), excludeQuad(false),
       excludeHex(false), excludePrism(false), excludeBL(false),
       minTargetIdealJac(0.1), minTargetInvCondNum(0.1),
-      weight(1.), nbLayers(6), dim(3), optIterMax(300),
-      barrierIterMax(50), onlyVisible(true), distanceFactor(12),
-      fixBndNodes(false), strategy(0), maxAdaptBlob(3),
-      adaptBlobLayerFact(2.), adaptBlobDistFact(2.), CPU(0.),
-      minIdealJac(0.), maxIdealJac(0.), minInvCondNum(0.),
-      maxInvCondNum(0.), SUCCESS(-1)
+      weight(1.), nbLayers(6), dim(3), maxOptIter(300),
+      maxBarrierUpdates(50), onlyVisible(true),
+      distanceFactor(12), fixBndNodes(false), strategy(0),
+      maxPatchAdapt(3), maxLayersAdaptFact(2),
+      distanceAdaptFact(2.), CPU(0.), minIdealJac(0.),
+      maxIdealJac(0.), minInvCondNum(0.), maxInvCondNum(0.),
+      SUCCESS(-1)
   {
   }
 };
@@ -790,9 +791,9 @@ or Jacobian contribution.
 \item The field \texttt{strategy} determines the strategy in the
 manner of the patch selection options in
 Section~\ref{sec:patch-selec}: $0$ corresponds to
-\texttt{STRAT\_CONNECTED} with \texttt{weakMerge} set to
+\texttt{STRAT\_DISJOINT} with \texttt{weakMerge} set to
 \texttt{false}, $1$ corresponds to \texttt{STRAT\_ONEBYONE}
-and $2$corresponds to \texttt{STRAT\_CONNECTED} with
+and $2$corresponds to \texttt{STRAT\_DISJOINT} with
 \texttt{weakMerge} set to \texttt{true}.
 \item The fields \texttt{minIdealJac} and \texttt{maxIdealJac}
 return the extrema of the ideal Jacobian in the output mesh
diff --git a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
index 0f4171fbf4..0faff2097a 100644
--- a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
+++ b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.cpp
@@ -44,16 +44,16 @@ QualPatchDefParameters::QualPatchDefParameters(const MeshQualOptParameters &p)
   _idealJacMin = p.minTargetIdealJac;
   _invCondNumMin = p.minTargetInvCondNum;
   strategy = (p.strategy == 1) ? MeshOptPatchDef::STRAT_ONEBYONE :
-                                 MeshOptPatchDef::STRAT_CONNECTED;
+                                 MeshOptPatchDef::STRAT_DISJOINT;
   minLayers = (p.dim == 3) ? 1 : 0;
   maxLayers = p.nbLayers;
   _distanceFactor = p.distanceFactor;
-  if (strategy == MeshOptPatchDef::STRAT_CONNECTED)
+  if (strategy == MeshOptPatchDef::STRAT_DISJOINT)
     weakMerge = (p.strategy == 2);
   else {
-    maxAdaptPatch = p.maxAdaptBlob;
-    maxLayersAdaptFact = p.adaptBlobLayerFact;
-    distanceAdaptFact = p.adaptBlobDistFact;
+    maxPatchAdapt = p.maxPatchAdapt;
+    maxLayersAdaptFact = p.maxLayersAdaptFact;
+    distanceAdaptFact = p.distanceAdaptFact;
   }
 }
 
@@ -128,7 +128,7 @@ void MeshQualityOptimizer(GModel *gm, MeshQualOptParameters &p)
   par.useGeomForOpt = false;
   QualPatchDefParameters patchDef(p);
   par.patchDef = &patchDef;
-  par.optDisplay = 20;
+  par.displayInterv = 20;
   par.verbose = 4;
 
   ObjContribScaledNodeDispSq<ObjContribFuncSimple> nodeDistFunc(p.weight,
@@ -141,15 +141,15 @@ void MeshQualityOptimizer(GModel *gm, MeshQualOptParameters &p)
   MeshOptPass minJacPass;
   MeshOptPass minInvCondNumPass;
   if (p.onlyValidity) {
-    minJacPass.barrierIterMax = p.barrierIterMax;
-    minJacPass.optIterMax = p.optIterMax;
+    minJacPass.maxParamUpdates = p.maxBarrierUpdates;
+    minJacPass.maxOptIter = p.maxOptIter;
     minJacPass.contrib.push_back(&nodeDistFunc);
     minJacPass.contrib.push_back(&minIdealJacBarFunc);
     par.pass.push_back(minJacPass);
   }
   else {
-    minInvCondNumPass.barrierIterMax = p.barrierIterMax;
-    minInvCondNumPass.optIterMax = p.optIterMax;
+    minInvCondNumPass.maxParamUpdates = p.maxBarrierUpdates;
+    minInvCondNumPass.maxOptIter = p.maxOptIter;
     minInvCondNumPass.contrib.push_back(&nodeDistFunc);
     minInvCondNumPass.contrib.push_back(&minInvCondNumBarFunc);
     par.pass.push_back(minInvCondNumPass);
diff --git a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
index a83a23f1ae..006159c25d 100644
--- a/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
+++ b/contrib/MeshQualityOptimizer/MeshQualityOptimizer.h
@@ -40,15 +40,15 @@ struct MeshQualOptParameters {
   double weight;                                                      // Weight of the node displacement contribution
   int nbLayers;                                                       // Number of layers taken around a bad element
   int dim;                                                            // Which dimension to optimize
-  int optIterMax;                                                     // Max number of iterations in the optimization process
-  int barrierIterMax;                                                 // Max number of barrier moves ("runs")
+  int maxOptIter;                                                     // Max. number of iterations in the optimization process
+  int maxBarrierUpdates;                                              // Max. number of barrier moves ("runs")
   bool onlyVisible;                                                   // If optimization applied to visible entities ONLY
   double distanceFactor;                                              // Distance criterion for patch creation
   bool fixBndNodes;                                                   // If points can move on boundaries
   int strategy;                                                       // 0 = connected blobs, 1 = adaptive one-by-one
-  int maxAdaptBlob;                                                   // Max. nb. of blob adaptation interations (if adaptive)
-  int adaptBlobLayerFact;                                             // Growth factor in number of layers for blob adaptation (if adaptive)
-  double adaptBlobDistFact;                                           // Growth factor in distance factor for blob adaptation (if adaptive)
+  int maxPatchAdapt;                                                  // Max. nb. of patch adaptation iterations (if adaptive)
+  int maxLayersAdaptFact;                                             // Growth factor in number of layers for patch adaptation (if adaptive)
+  double distanceAdaptFact;                                           // Growth factor in distance factor for patch adaptation (if adaptive)
 
   int SUCCESS ; // 0 --> success , 1 --> Not converged
   double minIdealJac, maxIdealJac; // after optimization, range of jacobians
@@ -59,9 +59,9 @@ struct MeshQualOptParameters {
     : onlyValidity(false), excludeQuad(false),
       excludeHex(false), excludePrism(false), excludeBL(false),
       minTargetIdealJac(0.1), minTargetInvCondNum(0.1), weight(1.),
-      nbLayers (6) , dim(3) , optIterMax(300), barrierIterMax(50),
+      nbLayers (6) , dim(3) , maxOptIter(300), maxBarrierUpdates(50),
       onlyVisible(true), distanceFactor(12), fixBndNodes(false), strategy(0),
-      maxAdaptBlob(3), adaptBlobLayerFact(2.), adaptBlobDistFact(2.), CPU(0.),
+      maxPatchAdapt(3), maxLayersAdaptFact(2), distanceAdaptFact(2.), CPU(0.),
       minIdealJac(0.), maxIdealJac(0.), minInvCondNum(0.), maxInvCondNum(0.),
       SUCCESS(-1)
   {
-- 
GitLab