X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDLoader%2FSauvWriter.cxx;h=c56016ddfa9a5f142f54c94c412a40d06d9e0031;hb=ac1df6b0ba8b337555fb39610c89f678d889580d;hp=474059de7ac9d83e6abf40252ef70851ee51e236;hpb=5da72d398d0eb1820c3ce6dd90b8579b6b14edf5;p=tools%2Fmedcoupling.git diff --git a/src/MEDLoader/SauvWriter.cxx b/src/MEDLoader/SauvWriter.cxx index 474059de7..c56016ddf 100644 --- a/src/MEDLoader/SauvWriter.cxx +++ b/src/MEDLoader/SauvWriter.cxx @@ -450,17 +450,21 @@ void SauvWriter::fillGroupSubMeshes() ++k; } } + if ( k == 0 ) + continue; // if a family exists but has no element, no submesh has been found for this family // => we have to resize famSubMeshes with the number of submeshes stored if (k != famNames.size()) - famSubMeshes.resize(k); + famSubMeshes.resize(k); SubMesh* grpSubMesh = addSubMesh( groupName, famSubMeshes[0]->_dimRelExt ); - if(!_cpy_grp_if_on_single_family) - grpSubMesh->_subs.swap( famSubMeshes ); + if( ! _cpy_grp_if_on_single_family ) + { + grpSubMesh->_subs.swap( famSubMeshes ); + } else { - /* If a group sub mesh consists of only one family, the group is written as - * a copy of this family. + /* If a group sub mesh consists of only one family, the group is written as + * a copy of this family. * A mesh composed of only one submesh may cause an issue with some Gibi operators.*/ if (famSubMeshes.size() == 1) { @@ -1166,7 +1170,7 @@ void SauvWriter::writeNodalFields(map& fldNamePrefixMap) fcount.stop(); } } - } // loop on fiels + } // loop on files } //================================================================================