Salome HOME
23447: EDF 10549 - Problem with python hypothesis Before_multi_study_removal_06072017 V8_4_0a1 V8_4_0a2
authoreap <eap@opencascade.com>
Wed, 7 Jun 2017 14:32:30 +0000 (17:32 +0300)
committereap <eap@opencascade.com>
Wed, 7 Jun 2017 14:32:30 +0000 (17:32 +0300)
 Set memory as float instead of integer

idl/GHS3DPlugin_Algorithm.idl
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx
src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx
src/GUI/GHS3DPluginGUI_AdvWidget_QTD.ui
src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx
src/GUI/GHS3DPluginGUI_HypothesisCreator.h

index a697472db2abb9dabf0c9cfdee386adbd32902eb..262d08209249ad5e1cf044c2cd746228404f408a 100644 (file)
@@ -82,15 +82,15 @@ module GHS3DPlugin
      * Maximal size of memory to be used by the algorithm (in Megabytes).
      * Negative value means not to use this option
      */
-    void SetMaximumMemory(in long MB) raises (SALOME::SALOME_Exception);
-    long GetMaximumMemory();
+    void SetMaximumMemory(in float MB) raises (SALOME::SALOME_Exception);
+    float GetMaximumMemory();
     /*!
      * Initial size of memory to be used by the algorithm (in Megabytes) in
      * automatic memory adjustment mode. Default is zero.
      * Negative value means not to use this option
      */
-    void SetInitialMemory(in long MB) raises (SALOME::SALOME_Exception);
-    long GetInitialMemory();
+    void SetInitialMemory(in float MB) raises (SALOME::SALOME_Exception);
+    float GetInitialMemory();
     /*!
      * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
      */
index a01a90e71e22e9070eda1c089298cd066c094e0a..b792999a4ef54f637f62e010a7f52e5cef207178 100644 (file)
@@ -1654,7 +1654,7 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   // MG-Tetra for domain indication
   SMESH_ProxyMesh::Ptr proxyMesh( new SMESH_ProxyMesh( theMesh ));
 
-  // make prisms on quadrangles
+  // make prisms on quadrangles and viscous layers
   if ( theMesh.NbQuadrangles() > 0 || _viscousLayersHyp )
   {
     vector<SMESH_ProxyMesh::Ptr> components;
@@ -1678,12 +1678,12 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
     proxyMesh.reset( new SMESH_ProxyMesh( components ));
   }
   // build viscous layers
-  else if ( _viscousLayersHyp )
-  {
-    proxyMesh = _viscousLayersHyp->Compute( theMesh, theShape );
-    if ( !proxyMesh )
-      return false;
-  }
+  // else if ( _viscousLayersHyp )
+  // {
+  //   proxyMesh = _viscousLayersHyp->Compute( theMesh, theShape );
+  //   if ( !proxyMesh )
+  //     return false;
+  // }
 
   int anInvalidEnforcedFlags = 0;
   Ok = writeGMFFile(&mgTetra,
index e5f3c4d1e054ef5f7285ae080bb1d73791699f43..eeafd0b39962f3a69f1117bae5b32352f5322da0 100644 (file)
@@ -137,7 +137,7 @@ bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothes
 //function : SetMaximumMemory
 //=======================================================================
 
-void GHS3DPlugin_Hypothesis::SetMaximumMemory(long MB)
+void GHS3DPlugin_Hypothesis::SetMaximumMemory(float MB)
 {
   if ( myMaximumMemory != MB ) {
     myMaximumMemory = MB;
@@ -150,7 +150,7 @@ void GHS3DPlugin_Hypothesis::SetMaximumMemory(long MB)
 //           * automatic memory adjustment mode. Default is zero
 //=======================================================================
 
-long GHS3DPlugin_Hypothesis::GetMaximumMemory() const
+float GHS3DPlugin_Hypothesis::GetMaximumMemory() const
 {
   return myMaximumMemory;
 }
@@ -159,7 +159,7 @@ long GHS3DPlugin_Hypothesis::GetMaximumMemory() const
 //function : SetInitialMemory
 //=======================================================================
 
-void GHS3DPlugin_Hypothesis::SetInitialMemory(long MB)
+void GHS3DPlugin_Hypothesis::SetInitialMemory(float MB)
 {
   if ( myInitialMemory != MB ) {
     myInitialMemory = MB;
@@ -171,7 +171,7 @@ void GHS3DPlugin_Hypothesis::SetInitialMemory(long MB)
 //function : GetInitialMemory
 //=======================================================================
 
-long GHS3DPlugin_Hypothesis::GetInitialMemory() const
+float GHS3DPlugin_Hypothesis::GetInitialMemory() const
 {
   return myInitialMemory;
 }
@@ -857,7 +857,7 @@ bool GHS3DPlugin_Hypothesis::DefaultToMakeGroupsOfDomains()
 #include <sys/sysinfo.h>
 #endif
 
-long GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
+float GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
 {
 #if defined(WIN32)
   // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
@@ -866,7 +866,7 @@ long GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
   long err = GlobalMemoryStatusEx (&statex);
   if (err != 0) {
     double totMB = (double)statex.ullAvailPhys / 1024. / 1024.;
-    return (long)( 0.7 * totMB );
+    return (float)( 0.7 * totMB );
   }
 #elif !defined(__APPLE__)
   struct sysinfo si;
@@ -883,7 +883,7 @@ long GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
 //function : DefaultInitialMemory
 //=======================================================================
 
-long  GHS3DPlugin_Hypothesis::DefaultInitialMemory()
+float GHS3DPlugin_Hypothesis::DefaultInitialMemory()
 {
   return DefaultMaximumMemory();
 }
@@ -892,7 +892,7 @@ long  GHS3DPlugin_Hypothesis::DefaultInitialMemory()
 //function : DefaultOptimizationLevel
 //=======================================================================
 
-short  GHS3DPlugin_Hypothesis::DefaultOptimizationLevel()
+short GHS3DPlugin_Hypothesis::DefaultOptimizationLevel()
 {
   return Medium;
 }
@@ -1485,13 +1485,13 @@ std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* h
   // Default memory is defined at MG-Tetra installation but it may be not enough,
   // so allow to use about all available memory
   if ( max_memory ) {
-    long aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
+    float aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
     cmd += " --max_memory ";
     if ( aMaximumMemory < 0 ) cmd += SMESH_Comment( DefaultMaximumMemory() );
     else                      cmd += SMESH_Comment( aMaximumMemory );
   }
   if ( auto_memory && !useBndRecovery ) {
-    long aInitialMemory = hyp ? hyp->myInitialMemory : -1;
+    float aInitialMemory = hyp ? hyp->myInitialMemory : -1;
     cmd += " --automatic_memory ";
     if ( aInitialMemory > 0 ) cmd += SMESH_Comment( aInitialMemory );
     else                      cmd += "100";
index afcc8089e8d54154ef6328406decfcf4326b2db0..f2e5a8ae131827fb5d6caf68c1e221181dda3a83 100644 (file)
@@ -134,14 +134,14 @@ public:
   /*!
    * Maximal size of memory to be used by the algorithm (in Megabytes)
    */
-  void SetMaximumMemory(long MB);
-  long GetMaximumMemory() const;
+  void SetMaximumMemory(float MB);
+  float GetMaximumMemory() const;
   /*!
    * Initial size of memory to be used by the algorithm (in Megabytes) in
    * automatic memory adjustment mode. Default is zero
    */
-  void SetInitialMemory(long MB);
-  long GetInitialMemory() const;
+  void SetInitialMemory(float MB);
+  float GetInitialMemory() const;
   /*!
    * Optimization level: 0-none, 1-light, 2-medium, 3-standard+, 4-strong. Default is medium
    */
@@ -290,8 +290,8 @@ public:
   
   static bool   DefaultMeshHoles();
   static bool   DefaultToMakeGroupsOfDomains();
-  static long   DefaultMaximumMemory();
-  static long   DefaultInitialMemory();
+  static float  DefaultMaximumMemory();
+  static float  DefaultInitialMemory();
   static short  DefaultOptimizationLevel();
   static std::string DefaultWorkingDirectory();
   static bool   DefaultKeepFiles();
@@ -338,8 +338,8 @@ protected:
 
   bool        myToMeshHoles;
   bool        myToMakeGroupsOfDomains;
-  long        myMaximumMemory;
-  long        myInitialMemory;
+  float       myMaximumMemory;
+  float       myInitialMemory;
   short       myOptimizationLevel;
   bool        myKeepFiles;
   std::string myWorkingDirectory;
index da36903fd1cafa82573fc4e4f3ba31a38859d55b..2da4c1055d78dd338801c8660d4dac9373f4fd33 100644 (file)
@@ -109,7 +109,7 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMakeGroupsOfDomains()
 //function : SetMaximumMemory
 //=======================================================================
 
-void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Long MB)
+void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Float MB)
   throw ( SALOME::SALOME_Exception )
 {
   if ( MB == 0 )
@@ -123,7 +123,7 @@ void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Long MB)
 //function : GetMaximumMemory
 //=======================================================================
 
-CORBA::Long GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
+CORBA::Float GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
 {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetMaximumMemory();
@@ -133,7 +133,7 @@ CORBA::Long GHS3DPlugin_Hypothesis_i::GetMaximumMemory()
 //function : SetInitialMemory
 //=======================================================================
 
-void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Long MB)
+void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Float MB)
   throw ( SALOME::SALOME_Exception )
 {
   if ( MB == 0 )
@@ -147,7 +147,7 @@ void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Long MB)
 //function : GetInitialMemory
 //=======================================================================
 
-CORBA::Long GHS3DPlugin_Hypothesis_i::GetInitialMemory()
+CORBA::Float GHS3DPlugin_Hypothesis_i::GetInitialMemory()
 {
   ASSERT(myBaseImpl);
   return this->GetImpl()->GetInitialMemory();
index d48a49d0bcfd38d48ce2268ef9d7f0a8940f44c5..d51500200e045798f496e0e42904ef00be84edeb 100644 (file)
@@ -65,14 +65,14 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
   /*!
    * Maximal size of memory to be used by the algorithm (in Megabytes)
    */
-  void SetMaximumMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
-  CORBA::Long GetMaximumMemory();
+  void SetMaximumMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
+  CORBA::Float GetMaximumMemory();
   /*!
    * Initial size of memory to be used by the algorithm (in Megabytes) in
    * automatic memory adjustment mode. Default is zero
    */
-  void SetInitialMemory(CORBA::Long MB) throw ( SALOME::SALOME_Exception );
-  CORBA::Long GetInitialMemory();
+  void SetInitialMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception );
+  CORBA::Float GetInitialMemory();
   /*!
    * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
    */
index 6d1ab70739564dbd1f97b22bcfc56c6ac1677cef..e589dc51d9e85b272ff2a16021bcd8174f263be2 100644 (file)
      <layout class="QGridLayout" name="gridLayout_3">
       <item row="3" column="4">
        <widget class="QLabel" name="maxMemoryLabel">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="text">
          <string>MB</string>
         </property>
       </item>
       <item row="0" column="4">
        <widget class="QLabel" name="initialMemoryLabel">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
         <property name="text">
          <string>MB</string>
         </property>
        </widget>
       </item>
       <item row="0" column="2" colspan="2">
-       <widget class="SalomeApp_IntSpinBox" name="initialMemorySpin">
+       <widget class="SMESHGUI_SpinBox" name="initialMemorySpin">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-          <horstretch>1</horstretch>
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
-        <property name="maximum" stdset="0">
-         <number>999999999</number>
+        <property name="maximum">
+         <double>1000000.000000000000000</double>
+        </property>
+        <property name="singleStep">
+         <double>10.000000000000000</double>
         </property>
        </widget>
       </item>
       <item row="3" column="2" colspan="2">
-       <widget class="SalomeApp_IntSpinBox" name="maxMemorySpin">
+       <widget class="SMESHGUI_SpinBox" name="maxMemorySpin">
         <property name="sizePolicy">
-         <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
-          <horstretch>1</horstretch>
+         <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
+          <horstretch>0</horstretch>
           <verstretch>0</verstretch>
          </sizepolicy>
         </property>
-        <property name="maximum" stdset="0">
-         <number>999999999</number>
+        <property name="maximum">
+         <double>1000000.000000000000000</double>
+        </property>
+        <property name="singleStep">
+         <double>10.000000000000000</double>
         </property>
        </widget>
       </item>
    <extends>QDoubleSpinBox</extends>
    <header location="global">SMESHGUI_SpinBox.h</header>
   </customwidget>
-  <customwidget>
-   <class>SalomeApp_IntSpinBox</class>
-   <extends>QLineEdit</extends>
-   <header location="global">SalomeApp_IntSpinBox.h</header>
-  </customwidget>
   <customwidget>
    <class>SMESH_AdvOptionsWdg</class>
    <extends>QWidget</extends>
index 0c989d297ad0aff901c56e3e119b2a9235e231ea..95dd9053be12ee55319ccddac336f410288663db 100644 (file)
@@ -1365,11 +1365,11 @@ void GHS3DPluginGUI_HypothesisCreator::retrieveParams() const
   myCreateNewNodesCheck                       ->setChecked    ( data.myToCreateNewNodes );
 
   myAdvWidget->maxMemoryCheck                 ->setChecked    ( data.myMaximumMemory > 0 );
-  myAdvWidget->maxMemorySpin                  ->setValue      ( qMax( (int)data.myMaximumMemory,
-                                                                      myAdvWidget->maxMemorySpin->minimum() ));
+  myAdvWidget->maxMemorySpin                  ->setValue      ( qMax( data.myMaximumMemory,
+                                                                      (float)myAdvWidget->maxMemorySpin->minimum() ));
   myAdvWidget->initialMemoryCheck             ->setChecked    ( data.myInitialMemory > 0 );
-  myAdvWidget->initialMemorySpin              ->setValue      ( qMax( (int)data.myInitialMemory,
-                                                                      myAdvWidget->initialMemorySpin->minimum() ));
+  myAdvWidget->initialMemorySpin              ->setValue      ( qMax( data.myInitialMemory,
+                                                                      (float)myAdvWidget->initialMemorySpin->minimum() ));
   myAdvWidget->workingDirectoryLineEdit       ->setText       ( data.myWorkingDir );
   myAdvWidget->keepWorkingFilesCheck           ->setChecked    ( data.myKeepFiles );
   myAdvWidget->verboseLevelSpin               ->setValue      ( data.myVerboseLevel );
index 4d7ce7523d0a33d53d95d0222576bacffb33b8af..84d03ffae84a64feea52225a75568b7e6d08533b 100644 (file)
@@ -144,8 +144,8 @@ typedef struct
 {
   bool    myToMeshHoles,myToMakeGroupsOfDomains,myKeepFiles,myToCreateNewNodes,myBoundaryRecovery,myFEMCorrection,myRemoveInitialCentralPoint,
           myLogInStandardOutput, myRemoveLogOnSuccess;
-  long    myMaximumMemory;
-  long    myInitialMemory;
+  float   myMaximumMemory;
+  float   myInitialMemory;
   int     myOptimizationLevel;
   QString myName,myWorkingDir,myTextOption;
   double  myGradation;