CGNS_ENUMT( GridLocation_t ) location = CGNS_ENUMV( Vertex );
if ( group->GetType() != SMDSAbs_Node )
{
-#if CGNS_VERSION > 3130
- location = CGNS_ENUMV( CellCenter );
-#else
switch ( meshDim ) {
case 3:
switch ( group->GetType() ) {
- case SMDSAbs_Volume: location = CGNS_ENUMV( FaceCenter ); break; // !!!
- case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break; // OK
- case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break; // OK
+#if CGNS_VERSION > 3130
+ case SMDSAbs_Volume: location = CGNS_ENUMV( CellCenter ); break;
+#else
+ case SMDSAbs_Volume: location = CGNS_ENUMV( FaceCenter ); break;
+#endif
+ case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break;
+ case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break;
default:;
}
break;
case 2:
switch ( group->GetType() ) {
- case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break; // ???
- case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break; // OK
+#if CGNS_VERSION > 3130
+ case SMDSAbs_Face: location = CGNS_ENUMV( CellCenter ); break;
+#else
+ case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break;
+#endif
+ case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break;
default:;
}
break;
case 1:
- location = CGNS_ENUMV( EdgeCenter ); break; // ???
+#if CGNS_VERSION > 3130
+ location = CGNS_ENUMV( CellCenter ); break;
+#else
+ location = CGNS_ENUMV( EdgeCenter ); break;
+#endif
break;
}
-#endif
}
// 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() );
return addMessage( cg_get_error(), /*fatal = */true);
// write BC location
- if ( location != CGNS_ENUMV( Vertex ))
+ if ( location != CGNS_ENUMV( Vertex ) || meshDim == 1 )
{
if ( cg_boco_gridlocation_write( _fn, iBase, iZone, iBC, location) != CG_OK )
return addMessage( cg_get_error(), /*fatal = */false);