From d8ee702704cb0f2b587316ce294321f95d062baa Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 7 Jun 2011 06:45:41 +0000 Subject: [PATCH] 0021294: EDF 1890 : Problem with groups on geometry when dealing with split into tetrahedra In SplitVolumesIntoTetra(), fix setting new nodes on shape --- src/SMESH/SMESH_MeshEditor.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index db3d48077..0fa391777 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -1615,6 +1615,7 @@ void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, helper.SetIsQuadratic( false ); } vector nodes( (*elem)->begin_nodes(), (*elem)->end_nodes() ); + helper.SetElementsOnShape( true ); if ( splitMethod._baryNode ) { // make a node at barycenter @@ -1642,7 +1643,6 @@ void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, } // make tetras - helper.SetElementsOnShape( true ); vector tetras( splitMethod._nbTetra ); // splits of a volume const int* tetConn = splitMethod._connectivity; for ( int i = 0; i < splitMethod._nbTetra; ++i, tetConn += 4 ) @@ -1670,6 +1670,12 @@ void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, helper.SetElementsOnShape( false ); vector< const SMDS_MeshElement* > triangles; + // find submesh to add new triangles in + if ( !fSubMesh || !fSubMesh->Contains( face )) + { + int shapeID = FindShape( face ); + fSubMesh = GetMeshDS()->MeshElements( shapeID ); + } map::iterator iF_n = splitMethod._faceBaryNode.find(iF); if ( iF_n != splitMethod._faceBaryNode.end() ) { @@ -1681,6 +1687,9 @@ void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, if ( !volTool.IsFaceExternal( iF )) swap( n2, n3 ); triangles.push_back( helper.AddFace( n1,n2,n3 )); + + if ( n3->getshapeId() < 1 ) + fSubMesh->AddNode( n3 ); } } else @@ -1719,12 +1728,6 @@ void SMESH_MeshEditor::SplitVolumesIntoTetra (const TIDSortedElemSet & theElems, volNodes[ facet->_n3 ])); } } - // find submesh to add new triangles in - if ( !fSubMesh || !fSubMesh->Contains( face )) - { - int shapeID = FindShape( face ); - fSubMesh = GetMeshDS()->MeshElements( shapeID ); - } for ( int i = 0; i < triangles.size(); ++i ) { if ( !triangles[i] ) continue; -- 2.39.2