Salome HOME
#19913 [CEA] Crash when compute mesh with body fitting and shared faces
authoreap <eap@opencascade.com>
Wed, 19 Aug 2020 08:56:22 +0000 (11:56 +0300)
committereap <eap@opencascade.com>
Wed, 19 Aug 2020 08:56:22 +0000 (11:56 +0300)
  1) fix the crash
  2) fix missing volumes when taking shared faces into account

  overlapping volumes remain to fix

src/StdMeshers/StdMeshers_Cartesian_3D.cxx

index 7e444be893672c8d92438e4a8bc527f2f06ccf0d..e0c8ec0250c6c5936b331d3583c1eb7f95d6a569 100644 (file)
@@ -2388,6 +2388,7 @@ namespace
   {
     _i = i; _j = j; _k = k;
 
+    bool isCompute = solid;
     if ( !solid )
       solid = _grid->GetSolid();
 
@@ -2417,6 +2418,9 @@ namespace
     _intNodes.clear();
     _vIntNodes.clear();
 
+    if ( !isCompute )
+      return;
+
     if ( _nbFaceIntNodes + _eIntPoints.size()                  > 0 &&
          _nbFaceIntNodes + _eIntPoints.size() + _nbCornerNodes > 3)
     {
@@ -2596,7 +2600,8 @@ namespace
       } // loop on _eIntPoints
     }
 
-    else if ( 3 < _nbCornerNodes && _nbCornerNodes < 8 ) // _nbFaceIntNodes == 0
+    else if (( 3 < _nbCornerNodes && _nbCornerNodes < 8 ) || // _nbFaceIntNodes == 0
+             ( !_grid->_geometry.IsOneSolid() ))
     {
       _Link split;
       // create sub-links (_splits) of whole links
@@ -3331,7 +3336,9 @@ namespace
       if ( hex ) // split hexahedron
       {
         intHexa.push_back( hex );
-        if ( hex->_nbFaceIntNodes > 0 || hex->_eIntPoints.size() > 0 )
+        if ( hex->_nbFaceIntNodes > 0 ||
+             hex->_eIntPoints.size() > 0 ||
+             hex->getSolids( solidIDs ) > 1 )
           continue; // treat intersected hex later in parallel
         this->init( hex->_i, hex->_j, hex->_k );
       }
@@ -4464,10 +4471,13 @@ namespace
         {
           curIntPnt._paramOnLine = coords[ ijk[ iDir ]] - coords[0] + _grid->_tol;
           const GridLine& line = _grid->_lines[ iDir ][ lineIndex[ iL ]];
-          multiset< F_IntersectPoint >::const_iterator ip =
-            line._intPoints.upper_bound( curIntPnt );
-          --ip;
-          firstIntPnt = &(*ip);
+          if ( !line._intPoints.empty() )
+          {
+            multiset< F_IntersectPoint >::const_iterator ip =
+              line._intPoints.upper_bound( curIntPnt );
+            --ip;
+            firstIntPnt = &(*ip);
+          }
         }
         else if ( !link._fIntPoints.empty() )
         {