diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index 74c3e6da8..58f9c0ca0 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -172,7 +172,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() //------------------------------------------------------ PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo); if (!aNodeInfo) { - aResult = DRS_FAIL; + aResult = addMessage("No nodes", /*isFatal=*/true ); continue; } aMeshInfo->myDim=aMeshInfo->mySpaceDim;// ignore meshdim in MEDFile because it can be false @@ -365,9 +365,9 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() } #ifndef _DEXCEPT_ } catch(const std::exception& exc) { - aResult = DRS_FAIL; + aResult = addMessage( exc.what(), /*isFatal=*/true ); } catch (...) { - aResult = DRS_FAIL; + aResult = addMessage( "Unknown exception", /*isFatal=*/true ); } #endif if ( !anElement ) { @@ -522,10 +522,10 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #ifndef _DEXCEPT_ }catch(const std::exception& exc){ INFOS("Following exception was caught:\n\t"< +#include #include #include @@ -53,7 +54,7 @@ namespace MED #ifndef WIN32 if (access(theFileName.c_str(),F_OK)) return aVersion; - if(theDoPreCheckInSeparateProcess){ + if ( theDoPreCheckInSeparateProcess ) { // First check, is it possible to deal with the file std::ostringstream aStr; // File name is in quotes for the case of space(s) inside it (PAL13009) @@ -64,8 +65,9 @@ namespace MED std::string aCommand = aStr.str(); int aStatus = system(aCommand.c_str()); - BEGMSG(MYDEBUG,"aCommand = '"<NbFaces() = "<<_myMeshDS->NbFaces()); MESSAGE("MEDToMesh - _myMeshDS->NbVolumes() = "<<_myMeshDS->NbVolumes()); } +#ifdef _DEBUG_ + SMESH_ComputeErrorPtr er = myReader.GetError(); + if ( er && !er->IsOK() ) cout << er->myComment << endl; +#endif // Reading groups (sub-meshes are out of scope of MED import functionality) list aGroupNames = myReader.GetGroupNamesAndTypes(); diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 57a401df9..38a445708 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -438,7 +438,8 @@ const map < int, SMESH_subMesh * >& SMESH_subMesh::DependsOn() } break; case TopAbs_COMPSOLID: insertDependence( _subShape, TopAbs_SOLID ); break; - case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE ); break; + case TopAbs_SOLID: insertDependence( _subShape, TopAbs_FACE ); + { /*internal EDGE*/ insertDependence( _subShape, TopAbs_EDGE, TopAbs_WIRE ); break; } case TopAbs_SHELL: insertDependence( _subShape, TopAbs_FACE ); break; case TopAbs_FACE: insertDependence( _subShape, TopAbs_EDGE ); break; case TopAbs_WIRE: insertDependence( _subShape, TopAbs_EDGE ); break; @@ -477,9 +478,10 @@ namespace //============================================================================= void SMESH_subMesh::insertDependence(const TopoDS_Shape aShape, - TopAbs_ShapeEnum aSubType) + TopAbs_ShapeEnum aSubType, + TopAbs_ShapeEnum avoidType) { - TopExp_Explorer sub( aShape, aSubType ); + TopExp_Explorer sub( aShape, aSubType, avoidType ); for ( ; sub.More(); sub.Next() ) { SMESH_subMesh *aSubMesh = _father->GetSubMesh( sub.Current() ); diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index 24152268d..8f9f83c2c 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -281,7 +281,9 @@ public: protected: // ================================================================== - void insertDependence(const TopoDS_Shape aShape, TopAbs_ShapeEnum aSubType ); + void insertDependence(const TopoDS_Shape aShape, + TopAbs_ShapeEnum aSubType, + TopAbs_ShapeEnum avoidType=TopAbs_SHAPE); void removeSubMeshElementsAndNodes(); void updateDependantsState(const compute_event theEvent); diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 0dc3b25f0..2c98e1653 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1424,8 +1424,10 @@ class Mesh: # Treat compute errors computeErrors = self.smeshpyD.GetComputeErrors( self.mesh, geom ) + shapeText = "" for err in computeErrors: - shapeText = " on %s" % self.GetSubShapeName( err.subShapeID ) + if self.mesh.HasShapeToMesh(): + shapeText = " on %s" % self.GetSubShapeName( err.subShapeID ) errText = "" stdErrors = ["OK", #COMPERR_OK "Invalid input mesh", #COMPERR_BAD_INPUT_MESH diff --git a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx index a286e0e48..5eaaf6609 100644 --- a/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx +++ b/src/StdMeshers/StdMeshers_QuadToTriaAdaptor.cxx @@ -764,7 +764,7 @@ bool StdMeshers_QuadToTriaAdaptor::Compute(SMESH_Mesh& aMesh, else { for ( TopExp_Explorer exp(aShape,TopAbs_FACE); exp.More(); exp.Next() ) - if (( aSubMeshDSFace = aProxyMesh->GetSubMesh( exp.Current() ))) + if (( aSubMeshDSFace = meshDS->MeshElements( exp.Current() ))) itVec.push_back( aSubMeshDSFace->GetElements() ); } typedef