From 69360e2565048cc88b082c13e5c8d41db64b6c35 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 14 Oct 2020 13:53:12 +0300 Subject: [PATCH] fix a bug of excess nodes creation w/o Renumber hypothesis --- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 29 +++++++++++++++++---------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 26b22cae1..db2f66880 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -824,23 +824,22 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, pointsOnShapes[ SMESH_Block::ID_V111 ] = fTop->GetXYZ( X, Y ); gp_XYZ params; // normalized parameters of an internal node within the unit box - for ( x = 0; x < xSize; ++x ) + + if ( toRenumber ) + for ( y = 0; y < ySize; ++y ) + { + vector< const SMDS_MeshNode* >& column0y = columns[ colIndex( 0, y )]; + for ( z = 0; z < zSize; ++z ) + renumHelper.AddReplacingNode( column0y[ z ] ); + } + + for ( x = 1; x < xSize-1; ++x ) { if ( toRenumber ) { vector< const SMDS_MeshNode* >& columnX0 = columns[ colIndex( x, 0 )]; for ( z = 0; z < zSize; ++z ) renumHelper.AddReplacingNode( columnX0[ z ] ); - if ( x == 0 || x == X ) - { - for ( y = 1; y < ySize; ++y ) - { - vector< const SMDS_MeshNode* >& column0Y = columns[ colIndex( x, y )]; - for ( z = 0; z < zSize; ++z ) - renumHelper.AddReplacingNode( column0Y[ z ] ); - } - continue; - } } const double rX = x / double(X); @@ -912,6 +911,14 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, } } // x loop + if ( toRenumber ) + for ( y = 0; y < ySize; ++y ) + { + vector< const SMDS_MeshNode* >& columnXy = columns[ colIndex( X, y )]; + for ( z = 0; z < zSize; ++z ) + renumHelper.AddReplacingNode( columnXy[ z ] ); + } + // side data no more needed, free memory for ( int i = 0; i < 6; ++i ) SMESHUtils::FreeVector( aCubeSide[i]._columns ); -- 2.39.2