From: eap Date: Wed, 19 Aug 2020 08:56:22 +0000 (+0300) Subject: #19913 [CEA] Crash when compute mesh with body fitting and shared faces X-Git-Tag: V9_6_0a1~7^2~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66de7ed40f01db7bc27e197078720481fcdc5210;p=modules%2Fsmesh.git #19913 [CEA] Crash when compute mesh with body fitting and shared faces 1) fix the crash 2) fix missing volumes when taking shared faces into account overlapping volumes remain to fix --- diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 7e444be89..e0c8ec025 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -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() ) {