Salome HOME
23373: [CEA 1170] Optimization of a 3D mesh using MG-Tetra (note 0022387)
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_OptimizerHypothesis.cxx
index e4e0c65cc85db417a2b5e2b41cc7ce12b1e58da6..88f8f003dc670ad4b8298fead711f45d356d4129 100644 (file)
@@ -24,9 +24,8 @@
 #include <SMESH_Gen.hxx>
 
 GHS3DPlugin_OptimizerHypothesis::GHS3DPlugin_OptimizerHypothesis(int         hypId,
-                                                                 int         studyId,
                                                                  SMESH_Gen * gen)
-  :GHS3DPlugin_Hypothesis( hypId, studyId, gen ),
+  :GHS3DPlugin_Hypothesis( hypId, gen ),
    myOptimization( YES ),
    mySplitOverConstrained( NO ),
    mySmoothOffSlivers( false ),
@@ -156,6 +155,12 @@ std::string GHS3DPlugin_OptimizerHypothesis::CommandToRun(const GHS3DPlugin_Opti
 {
   SMESH_Comment cmd( GetExeName() );
 
+  cmd << " --max_memory "
+      << (( hyp && hyp->myMaximumMemory > 0 ) ? hyp->myMaximumMemory : DefaultMaximumMemory());
+
+  cmd << " --automatic_memory "
+      << (( hyp && hyp->myInitialMemory > 0 ) ? hyp->myInitialMemory : 100.0 );
+
   if ( hyp )
   {
     const char* mode[3] = { "no", "yes", "only" };
@@ -188,12 +193,6 @@ std::string GHS3DPlugin_OptimizerHypothesis::CommandToRun(const GHS3DPlugin_Opti
     if ( !hyp->myToCreateNewNodes )
       cmd << " --no_internal_points";
 
-    if ( hyp->myMaximumMemory > 0 )
-      cmd << " --max_memory " << hyp->myMaximumMemory;
-
-    if ( hyp->myInitialMemory > 0 )
-      cmd << " --automatic_memory " << hyp->myInitialMemory;
-
     cmd << " --verbose " << hyp->myVerboseLevel;
     
     cmd << " " << hyp->myTextOption;