Salome HOME
23061: [CEA 1488] Import 1D-2D fails sometimes in relation with the source face discr...
[modules/smesh.git] / src / StdMeshers / StdMeshers_Import_1D2D.cxx
index 17b5b5a9d0ae0f6194e3b016ee9d2fe1ecbd6850..505b85f729c0d8fd13105c8978087f8f79217870 100644 (file)
@@ -307,6 +307,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
       {
         SMESH_TNodeXYZ nXYZ = *node;
         nodeState[ i ] = TopAbs_UNKNOWN;
+        newNodes [ i ] = 0;
 
         it_isnew = n2n->insert( make_pair( *node, (SMDS_MeshNode*)0 ));
         n2nIt    = it_isnew.first;
@@ -679,7 +680,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
         seamHelper.SetSubShape( edges[ iE ]);
         seamHelper.SetElementsOnShape( true );
 
-        if ( (*checkedFaces.begin())->IsQuadratic() )
+        if ( !checkedFaces.empty() && (*checkedFaces.begin())->IsQuadratic() )
           for ( set< const SMDS_MeshElement* >::iterator fIt = checkedFaces.begin();
                 fIt != checkedFaces.end(); ++fIt )
             seamHelper.AddTLinks( static_cast<const SMDS_MeshFace*>( *fIt ));
@@ -708,8 +709,7 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape &
     //   sm->SetIsAlwaysComputed( true );
     sm->ComputeStateEngine(SMESH_subMesh::CHECK_COMPUTE_STATE);
     if ( sm->GetComputeState() != SMESH_subMesh::COMPUTE_OK )
-      return error(SMESH_Comment("Failed to create segments on the edge ")
-                   << tgtMesh->ShapeToIndex( edges[iE ]));
+      return error(SMESH_Comment("Failed to create segments on the edge #") << sm->GetId());
   }
 
   // ============