From: eap Date: Wed, 24 Aug 2016 17:47:44 +0000 (+0300) Subject: 53538: Salome application crashes after computing mesh X-Git-Tag: V8_1_0rc1~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=dd492f9ab4f7f9e26d56b1770b144dd0d5d9326d;p=plugins%2Fghs3dplugin.git 53538: Salome application crashes after computing mesh --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index f6dff50..0aaf115 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -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 ); diff --git a/src/GHS3DPlugin/MG_Tetra_API.cxx b/src/GHS3DPlugin/MG_Tetra_API.cxx index e5adee0..1ccd807 100644 --- a/src/GHS3DPlugin/MG_Tetra_API.cxx +++ b/src/GHS3DPlugin/MG_Tetra_API.cxx @@ -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; }