From: michael Date: Fri, 10 Dec 2021 13:21:31 +0000 (+0100) Subject: Avoid duplication in group name list X-Git-Tag: V9_8_0~21 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5d30ac6fa19de5ba5c050eff2fffe26e691e17d0;p=tools%2Fsolverlab.git Avoid duplication in group name list --- diff --git a/CDMATH/mesh/src/Face.cxx b/CDMATH/mesh/src/Face.cxx old mode 100644 new mode 100755 index 64946d8..003a76e --- a/CDMATH/mesh/src/Face.cxx +++ b/CDMATH/mesh/src/Face.cxx @@ -8,7 +8,7 @@ #include "Face.hxx" #include "CdmathException.hxx" -#include +#include using namespace std; @@ -121,8 +121,13 @@ Face::getGroupName(int igroup) const void Face::setGroupName(const string groupName) { - _groupNames.insert(_groupNames.begin(),groupName); - _region=0; + if(std::find(_groupNames.begin(), _groupNames.end(), groupName) == _groupNames.end())//No group named groupName + { + _groupNames.insert(_groupNames.begin(),groupName); + _region=0; + } + else + cout<<"Warning Face::setGroupName, group name "<< groupName <<" is already present. No duplication"<