From: eap Date: Thu, 22 Nov 2018 12:35:17 +0000 (+0300) Subject: [GPUSPHGUI] #511: Spheric2 with dynamic boundaries - Mesh offset failed X-Git-Tag: V9_3_0a1~43 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=1dadb7d2e2350c62b25efa48135d55cd0b704c83;p=modules%2Fsmesh.git [GPUSPHGUI] #511: Spheric2 with dynamic boundaries - Mesh offset failed --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index 87dca725d..495370151 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -6789,7 +6789,9 @@ SMESH_MeshEditor::PGroupIDs SMESH_MeshEditor::Offset( TIDSortedElemSet & theElem for ( size_t i = 0; i < new2OldNodes.size(); ++i ) if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first ) { +#ifndef _DEBUG_ if ( n->NbInverseElements() > 0 ) +#endif { const SMDS_MeshNode* n2 = tgtMeshDS->AddNodeWithID( n->X(), n->Y(), n->Z(), idShift + n->GetID() ); diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index faefc439d..33d5b1c78 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -2747,8 +2747,9 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt, normals[i].SetCoord( 0,0,0 ); // TODO find norm by neighbors } - const double tol = 1e-3 * Sqrt( minNodeDist ); const double sign = ( theOffset < 0 ? -1 : +1 ); + const double tol = Min( 1e-3 * Sqrt( minNodeDist ), + 1e-2 * theOffset * sign ); // translate new nodes by normal to input faces gp_XYZ newXYZ;