+#if CGNS_VERSION >= 4000
+ if ( nbPolygones > 0 )
+ {
+ faceOffset.push_back((cgsize_t) faceData.size() );
+ if ( cg_poly_section_write(_fn, iBase, iZone, "Faces of Polyhedrons", CGNS_ENUMV( NGON_n ),
+ cgID - nbPolygones, cgID-1, /*nbndry=*/0,
+ faceData.data(), faceOffset.data(), &iSec) != CG_OK )
+ return addMessage( cg_get_error(), /*fatal = */true );
+ }
+
+ polyOffset.push_back((cgsize_t) elemData.size() );
+ if ( cg_poly_section_write(_fn, iBase, iZone, "Polyhedrons",
+ CGNS_ENUMV( NFACE_n ), cgID, cgID+nbPolyhTreated-1,
+ /*nbndry=*/0, &elemData[0], polyOffset.data(), &iSec) != CG_OK )
+ return addMessage( cg_get_error(), /*fatal = */true );
+#else