Salome HOME
53538: Salome application crashes after computing mesh
authoreap <eap@opencascade.com>
Wed, 24 Aug 2016 17:48:33 +0000 (20:48 +0300)
committereap <eap@opencascade.com>
Wed, 24 Aug 2016 17:48:33 +0000 (20:48 +0300)
src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx
src/HYBRIDPlugin/MG_HYBRID_API.cxx

index dfb1b405d208ee6ba5139df1c4dfe12c1a0cdf6e..02b9e78c3d4c2065d70a7e6c228c1608c6c16e77 100644 (file)
@@ -3257,12 +3257,12 @@ bool HYBRIDPlugin_HYBRID::Compute(SMESH_Mesh&         theMesh,
   HYBRIDPlugin_Hypothesis::TSetStrings groupsToRemove = HYBRIDPlugin_Hypothesis::GetGroupsToRemove(_hyp);
   const bool toMakeGroupsOfDomains = HYBRIDPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
 
-  Ok = readGMFFile(&mgHybrid,
-                   aResultFileName.ToCString(),
-                   this,
-                   theHelper, aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
-                   aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
-                   groupsToRemove, toMakeGroupsOfDomains);
+  Ok = Ok && readGMFFile(&mgHybrid,
+                         aResultFileName.ToCString(),
+                         this,
+                         theHelper, aNodeByHybridId, aFaceByHybridId, aNodeToHybridIdMap,
+                         aNodeGroupByHybridId, anEdgeGroupByHybridId, aFaceGroupByHybridId,
+                         groupsToRemove, toMakeGroupsOfDomains);
 
   updateMeshGroups(theHelper->GetMesh(), groupsToRemove);
   //removeEmptyGroupsOfDomains( theHelper->GetMesh(), notEmptyAsWell );
index 199a067b695b31130bf44fdb3fc2a1c84539f113..93d769fd4207addb3b6a552969f1831a97185f2b 100644 (file)
@@ -494,12 +494,12 @@ struct MG_HYBRID_API::LibData
 
   int IsVertexRequired( int iNode )
   {
-    return ! ( iNode < int( _xyz.size() - _nodeSize.size() ));
+    return ! ( iNode < int( NbNodes() - _nodeSize.size() ));
   }
 
   double GetSizeAtVertex( int iNode )
   {
-    return IsVertexRequired( iNode ) ? _nodeSize[ iNode - _xyz.size() + _nodeSize.size() ] : 0.;
+    return IsVertexRequired( iNode ) ? _nodeSize[ iNode - NbNodes() + _nodeSize.size() ] : 0.;
   }
 };
 
@@ -808,7 +808,12 @@ bool MG_HYBRID_API::Compute( const std::string& cmdLine, std::string& errStr )
     }
 
     // compute
-    return _libData->Compute();
+    bool ok =  _libData->Compute();
+
+    GetLog(); // write a log file
+    _logFile = ""; // not to write it again
+
+    return ok;
 #endif
   }
 
@@ -818,9 +823,6 @@ bool MG_HYBRID_API::Compute( const std::string& cmdLine, std::string& errStr )
     errStr = SMESH_Comment("system(mg-hybrid.exe ...) command failed with error: ")
       << strerror( errno );
 
-  GetLog(); // write a log file
-  _logFile = ""; // not to write it again
-
   return !err;
 
 }