Salome HOME
53538: Salome application crashes after computing mesh
authoreap <eap@opencascade.com>
Wed, 24 Aug 2016 17:47:44 +0000 (20:47 +0300)
committereap <eap@opencascade.com>
Wed, 24 Aug 2016 17:47:44 +0000 (20:47 +0300)
src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx
src/GHS3DPlugin/MG_Tetra_API.cxx

index f6dff504912b4430cec12e70a7947d3bc631a639..0aaf115392ba5eacc002546649a9a0b686276cc8 100644 (file)
@@ -1976,12 +1976,12 @@ bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh&         theMesh,
   GHS3DPlugin_Hypothesis::TSetStrings groupsToRemove = GHS3DPlugin_Hypothesis::GetGroupsToRemove(_hyp);
   const bool toMakeGroupsOfDomains = GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains( _hyp );
 
-  Ok = readGMFFile(&mgTetra,
-                   aResultFileName.ToCString(),
-                   this,
-                   theHelper, aNodeByGhs3dId, aFaceByGhs3dId, aNodeToGhs3dIdMap,
-                   aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId,
-                   groupsToRemove, toMakeGroupsOfDomains);
+  Ok = Ok && readGMFFile(&mgTetra,
+                         aResultFileName.ToCString(),
+                         this,
+                         theHelper, aNodeByGhs3dId, aFaceByGhs3dId, aNodeToGhs3dIdMap,
+                         aNodeGroupByGhs3dId, anEdgeGroupByGhs3dId, aFaceGroupByGhs3dId,
+                         groupsToRemove, toMakeGroupsOfDomains);
 
   updateMeshGroups(theHelper->GetMesh(), groupsToRemove);
   removeEmptyGroupsOfDomains( theHelper->GetMesh(), /*notEmptyAsWell =*/ !toMakeGroupsOfDomains );
index e5adee0c9d108d9239b3df50cd19344c6473056e..1ccd80730eee280102db349d7caa1a03faf77703 100644 (file)
@@ -398,12 +398,12 @@ struct MG_Tetra_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.;
   }
 };
 
@@ -739,7 +739,12 @@ bool MG_Tetra_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
   }
 
@@ -749,9 +754,6 @@ bool MG_Tetra_API::Compute( const std::string& cmdLine, std::string& errStr )
     errStr = SMESH_Comment("system(mg-tetra.exe ...) command failed with error: ")
       << strerror( errno );
 
-  GetLog(); // write a log file
-  _logFile = ""; // not to write it again
-
   return !err;
 
 }