From 5d30ac6fa19de5ba5c050eff2fffe26e691e17d0 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 10 Dec 2021 14:21:31 +0100 Subject: [PATCH] Avoid duplication in group name list --- CDMATH/mesh/src/Face.cxx | 11 ++++++++--- CDMATH/mesh/src/Node.cxx | 9 +++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) mode change 100644 => 100755 CDMATH/mesh/src/Face.cxx mode change 100644 => 100755 CDMATH/mesh/src/Node.cxx 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"<