0020872: [CEA] Script fails

* improve error repport in case of non-quadrangular elements
This commit is contained in:
eap 2010-05-12 11:59:35 +00:00
parent c985e18383
commit e53ee3bc5f

View File

@ -205,7 +205,7 @@ public: //** Access to member fields **//
private: private:
bool error(std::string& text, int code = COMPERR_ALGO_FAILED) bool error(const std::string& text, int code = COMPERR_ALGO_FAILED)
{ myError = SMESH_ComputeError::New( code, text ); return false; } { myError = SMESH_ComputeError::New( code, text ); return false; }
bool error(const SMESH_ComputeErrorPtr& err) bool error(const SMESH_ComputeErrorPtr& err)
@ -987,6 +987,13 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
if ( !myGrid.empty() ) if ( !myGrid.empty() )
return true; return true;
SMESHDS_SubMesh* faceSubMesh = mesh.GetSubMesh( myFace )->GetSubMeshDS();
// check that all faces are quadrangular
SMDS_ElemIteratorPtr fIt = faceSubMesh->GetElements();
while ( fIt->more() )
if ( fIt->next()->NbNodes() % 4 > 0 )
return error("Non-quadrangular mesh faces are not allowed on sides of a composite block");
myIndexer._xSize = 1 + mySides.GetSide( Q_BOTTOM )->GetNbSegments( mesh ); myIndexer._xSize = 1 + mySides.GetSide( Q_BOTTOM )->GetNbSegments( mesh );
myIndexer._ySize = 1 + mySides.GetSide( Q_LEFT )->GetNbSegments( mesh ); myIndexer._ySize = 1 + mySides.GetSide( Q_LEFT )->GetNbSegments( mesh );
@ -997,8 +1004,6 @@ bool _QuadFaceGrid::LoadGrid( SMESH_Mesh& mesh )
// store the rest nodes row by row // store the rest nodes row by row
SMESHDS_SubMesh* faceSubMesh = mesh.GetSubMesh( myFace )->GetSubMeshDS();
SMDS_MeshNode dummy(0,0,0); SMDS_MeshNode dummy(0,0,0);
const SMDS_MeshElement* firstQuad = &dummy;// most left face above the last row of found nodes const SMDS_MeshElement* firstQuad = &dummy;// most left face above the last row of found nodes