]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PR: debug a SIGSEGV case when using downward connectivity on a modified mesh.
authorprascle <prascle>
Wed, 11 May 2011 14:46:30 +0000 (14:46 +0000)
committerprascle <prascle>
Wed, 11 May 2011 14:46:30 +0000 (14:46 +0000)
src/SMDS/SMDS_UnstructuredGrid.cxx
src/SMESH/SMESH_MeshEditor.cxx

index 03b5d2337c676987b8237dffd32df6ebedf38ced..0a27784450c80203de1d47608622142049b3a4d1 100644 (file)
@@ -312,7 +312,12 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray *newTypes, std::vector
 
 int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId)
 {
-  // ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size()));
+  if((vtkCellId < 0) || (vtkCellId >= _cellIdToDownId.size()))
+    {
+      std::cerr << "SMDS_UnstructuredGrid::CellIdToDownId problem vtkCellId="
+          << vtkCellId << " max="<< _cellIdToDownId.size() << std::endl;
+      return -1;
+    }
   return _cellIdToDownId[vtkCellId];
 }
 
index db8f8a36d91b9535fb675074688e1a9c8fb46c99..be3ac4cc978f75cd4a01da22d2dedda99a7c8f32 100644 (file)
@@ -10968,6 +10968,8 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
                     continue;
                   int vtkType = grid->GetCellType(vtkId);
                   int downId = grid->CellIdToDownId(vtkId);
+                  if (downId < 0)
+                    continue;
                   DownIdType aCell(downId, vtkType);
                   if (celldom.count(vtkId))
                     continue;
@@ -11238,6 +11240,8 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vector<TIDSorted
               int vtkId = l.cells[i];
               int vtkType = grid->GetCellType(vtkId);
               int downId = grid->CellIdToDownId(vtkId);
+              if (downId < 0)
+                continue;
               DownIdType aCell(downId, vtkType);
               int volParents[1000];
               int nbvol = grid->GetParentVolumes(volParents, vtkId);