- map< SMDSAbs_ElementType, set<string> > aGroupNames;
- char aString [256];
- int maxNbIter = 10000; // to guarantee cycle finish
- for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
- SMESH_Group* aGroup = it->second;
- SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
- if ( aGroupDS ) {
- SMDSAbs_ElementType aType = aGroupDS->GetType();
- string aGroupName0 = aGroup->GetName();
- aGroupName0.resize(MAX_MED_GROUP_NAME_LENGTH);
- string aGroupName = aGroupName0;
- for (int i = 1; !aGroupNames[aType].insert(aGroupName).second && i < maxNbIter; i++) {
- sprintf(&aString[0], "GR_%d_%s", i, aGroupName0.c_str());
- aGroupName = aString;
- aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
+ if ( !meshPart )
+ {
+ map< SMDSAbs_ElementType, set<string> > aGroupNames;
+ char aString [256];
+ int maxNbIter = 10000; // to guarantee cycle finish
+ for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
+ SMESH_Group* aGroup = it->second;
+ SMESHDS_GroupBase* aGroupDS = aGroup->GetGroupDS();
+ if ( aGroupDS ) {
+ SMDSAbs_ElementType aType = aGroupDS->GetType();
+ string aGroupName0 = aGroup->GetName();
+ aGroupName0.resize(MAX_MED_GROUP_NAME_LENGTH);
+ string aGroupName = aGroupName0;
+ for (int i = 1; !aGroupNames[aType].insert(aGroupName).second && i < maxNbIter; i++) {
+ sprintf(&aString[0], "GR_%d_%s", i, aGroupName0.c_str());
+ aGroupName = aString;
+ aGroupName.resize(MAX_MED_GROUP_NAME_LENGTH);
+ }
+ aGroupDS->SetStoreName( aGroupName.c_str() );
+ myWriter.AddGroup( aGroupDS );