From b29ad43bc8f527208b97548dbc42ba1174988ee9 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 24 Aug 2016 20:48:33 +0300 Subject: [PATCH] 53538: Salome application crashes after computing mesh --- src/HYBRIDPlugin/HYBRIDPlugin_HYBRID.cxx | 12 ++++++------ src/HYBRIDPlugin/MG_HYBRID_API.cxx | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) 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; } -- 2.39.2