//------------------------------------------------------
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
}
#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 ) {
#ifndef _DEXCEPT_
}catch(const std::exception& exc){
INFOS("Following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
}catch(...){
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if(!anIsValidConnect)
#ifndef _DEXCEPT_
} catch(const std::exception& exc) {
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
} catch(...) {
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if (!anElement) {
catch(const std::exception& exc)
{
INFOS("The following exception was caught:\n\t"<<exc.what());
- aResult = DRS_FAIL;
+ aResult = addMessage( exc.what(), /*isFatal=*/true );
}
catch(...)
{
INFOS("Unknown exception was caught !!!");
- aResult = DRS_FAIL;
+ aResult = addMessage( "Unknown exception", /*isFatal=*/true );
}
#endif
if (myMesh)
#include "MED_V2_2_Wrapper.hxx"
#include <stdio.h>
+#include <errno.h>
#include <sstream>
#include <med.h>
#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)
std::string aCommand = aStr.str();
int aStatus = system(aCommand.c_str());
- BEGMSG(MYDEBUG,"aCommand = '"<<aCommand<<"'; aStatus = "<<aStatus<<std::endl);
- if(aStatus != 0)
+ BEGMSG( MYDEBUG,"aCommand = '" << aCommand << "'; aStatus = " << aStatus
+ << "; errno = " << errno << " = " << strerror( errno ) << std::endl );
+ if ( aStatus != 0 && errno != EAGAIN && errno != ENOMEM ) // "Cannot allocate memory" is OK
return aVersion;
}
#endif
MESSAGE("MEDToMesh - _myMeshDS->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<TNameAndType> aGroupNames = myReader.GetGroupNamesAndTypes();
}
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;
//=============================================================================
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() );
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);
# 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
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