From 0be76e8fb82d47077bf6621c2ff176fa40f2ee88 Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 1 Sep 2017 13:57:21 +0300 Subject: [PATCH] IPAL54303: CGNS export problems Change the way to assure group name uniqueness --- src/DriverCGNS/DriverCGNS_Write.cxx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/DriverCGNS/DriverCGNS_Write.cxx b/src/DriverCGNS/DriverCGNS_Write.cxx index 657cb529e..948b111b9 100644 --- a/src/DriverCGNS/DriverCGNS_Write.cxx +++ b/src/DriverCGNS/DriverCGNS_Write.cxx @@ -588,9 +588,16 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() // try to extract type of boundary condition from the group name string name = group->GetStoreName(); CGNS_ENUMT( BCType_t ) bcType = getBCType( name ); - while ( !groupNames.insert( name ).second ) - name = (SMESH_Comment( "Group_") << groupNames.size()); - + if ( !groupNames.insert( name ).second ) // assure name uniqueness + { + int index = 1; + string newName; + do { + newName = SMESH_Comment( name ) << "_" << index++; + } + while ( !groupNames.insert( newName ).second ); + name = newName; + } // write IDs of elements vector< cgsize_t > pnts; pnts.reserve( group->Extent() ); -- 2.30.2