From: eap Date: Wed, 24 Aug 2016 17:48:33 +0000 (+0300) Subject: 53538: Salome application crashes after computing mesh X-Git-Tag: V8_1_0rc1~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b29ad43bc8f527208b97548dbc42ba1174988ee9;p=plugins%2Fhybridplugin.git 53538: Salome application crashes after computing mesh --- diff --git a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx index dfb1b40..02b9e78 100644 --- a/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx +++ b/src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx @@ -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 ); diff --git a/src/HYBRIDPlugin/MG_HYBRID_API.cxx b/src/HYBRIDPlugin/MG_HYBRID_API.cxx index 199a067..93d769f 100644 --- a/src/HYBRIDPlugin/MG_HYBRID_API.cxx +++ b/src/HYBRIDPlugin/MG_HYBRID_API.cxx @@ -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; }