Salome HOME
IPAL54417: Hexahedron(ijk) crashes salome
authoreap <eap@opencascade.com>
Wed, 14 Aug 2019 10:42:11 +0000 (13:42 +0300)
committereap <eap@opencascade.com>
Wed, 14 Aug 2019 10:42:11 +0000 (13:42 +0300)
doc/salome/gui/SMESH/images/hypo_quad_params_dialog.png [new file with mode: 0644]
doc/salome/gui/SMESH/images/hypo_quad_params_dialog_corners.png [new file with mode: 0644]
src/SMDS/SMDS_Mesh.cxx
src/StdMeshers/StdMeshers_Hexa_3D.cxx

diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_dialog.png b/doc/salome/gui/SMESH/images/hypo_quad_params_dialog.png
new file mode 100644 (file)
index 0000000..f0c381a
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_dialog.png differ
diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_dialog_corners.png b/doc/salome/gui/SMESH/images/hypo_quad_params_dialog_corners.png
new file mode 100644 (file)
index 0000000..4f30c07
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_dialog_corners.png differ
index d720fb6311d73edbead6bea1abe31b4e216df7b7..25742c55bd3f31e4f94527665bccabecbfe109f0 100644 (file)
@@ -2980,6 +2980,7 @@ void SMDS_Mesh::Modified()
 {
   if (this->myModified)
   {
 {
   if (this->myModified)
   {
+    myGrid->Modified();
     this->myModifTime++;
     myModified = false;
   }
     this->myModifTime++;
     myModified = false;
   }
index 86f77bbd1a83d23f0db4d4d9ea1123b5f90178a6..edfca5ae541f8aa0b87da28646bd615836a03dd8 100644 (file)
@@ -167,7 +167,7 @@ namespace
     // map of (node parameter on EDGE) to (column (vector) of nodes)
     TParam2ColumnMap _u2nodesMap;
 
     // map of (node parameter on EDGE) to (column (vector) of nodes)
     TParam2ColumnMap _u2nodesMap;
 
-    // node column's taken form _u2nodesMap taking into account sub-shape orientation
+    // node column's taken from _u2nodesMap taking into account sub-shape orientation
     vector<TNodeColumn> _columns;
 
     // columns of normalized parameters of nodes within the unitary cube
     vector<TNodeColumn> _columns;
 
     // columns of normalized parameters of nodes within the unitary cube
@@ -542,18 +542,24 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
   _FaceGrid* fFront  = & aCubeSide[ B_FRONT  ];
   _FaceGrid* fBack   = & aCubeSide[ B_BACK   ];
 
   _FaceGrid* fFront  = & aCubeSide[ B_FRONT  ];
   _FaceGrid* fBack   = & aCubeSide[ B_BACK   ];
 
-  // compute normalized parameters of nodes on sides (PAL23189)
-  computeIJK( *fBottom, COO_X, COO_Y, /*z=*/0. );
-  computeIJK( *fRight,  COO_Y, COO_Z, /*x=*/1. );
-  computeIJK( *fTop,    COO_X, COO_Y, /*z=*/1. );
-  computeIJK( *fLeft,   COO_Y, COO_Z, /*x=*/0. );
-  computeIJK( *fFront,  COO_X, COO_Z, /*y=*/0. );
-  computeIJK( *fBack,   COO_X, COO_Z, /*y=*/1. );
-
   // cube size measured in nb of nodes
   // cube size measured in nb of nodes
-  int x, xSize = fBottom->_columns.size() , X = xSize - 1;
-  int y, ySize = fLeft->_columns.size()   , Y = ySize - 1;
-  int z, zSize = fLeft->_columns[0].size(), Z = zSize - 1;
+  size_t x, xSize = fBottom->_columns.size() , X = xSize - 1;
+  size_t y, ySize = fLeft->_columns.size()   , Y = ySize - 1;
+  size_t z, zSize = fLeft->_columns[0].size(), Z = zSize - 1;
+
+  // check sharing of FACEs (IPAL54417)
+  if ( fFront ->_columns.size()    != xSize ||
+       fBack  ->_columns.size()    != xSize ||
+       fTop   ->_columns.size()    != xSize ||
+
+       fRight ->_columns.size()    != ySize ||
+       fTop   ->_columns[0].size() != ySize ||
+       fBottom->_columns[0].size() != ySize ||
+
+       fRight ->_columns[0].size() != zSize ||
+       fFront ->_columns[0].size() != zSize ||
+       fBack  ->_columns[0].size() != zSize )
+    return error( COMPERR_BAD_SHAPE, "Not sewed faces" );
 
   // columns of internal nodes "rising" from nodes of fBottom
   _Indexer colIndex( xSize, ySize );
 
   // columns of internal nodes "rising" from nodes of fBottom
   _Indexer colIndex( xSize, ySize );
@@ -591,6 +597,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
     }
   }
 
     }
   }
 
+  // compute normalized parameters of nodes on sides (PAL23189)
+  computeIJK( *fBottom, COO_X, COO_Y, /*z=*/0. );
+  computeIJK( *fRight,  COO_Y, COO_Z, /*x=*/1. );
+  computeIJK( *fTop,    COO_X, COO_Y, /*z=*/1. );
+  computeIJK( *fLeft,   COO_Y, COO_Z, /*x=*/0. );
+  computeIJK( *fFront,  COO_X, COO_Z, /*y=*/0. );
+  computeIJK( *fBack,   COO_X, COO_Z, /*y=*/1. );
+
   // projection points of the internal node on cube sub-shapes by which
   // coordinates of the internal node are computed
   vector<gp_XYZ> pointsOnShapes( SMESH_Block::ID_Shell );
   // projection points of the internal node on cube sub-shapes by which
   // coordinates of the internal node are computed
   vector<gp_XYZ> pointsOnShapes( SMESH_Block::ID_Shell );