From 1344797239c6491f689c0d028c0c8c6eb3f116ea Mon Sep 17 00:00:00 2001 From: Pascal Beckstein Date: Wed, 10 Feb 2016 18:50:02 +0100 Subject: [PATCH] Fix: Correct REMOVE option for setSet utility --- .../mesh/manipulation/setSet/setSet.C | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 86ace70ca..abdfe6ba1 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -325,7 +325,7 @@ void printAllSets(const polyMesh& mesh, Ostream& os) // Physically remove a set -void removeSet +bool removeSet ( const polyMesh& mesh, const word& setType, @@ -346,7 +346,11 @@ void removeSet fileName object = objects[setName]->objectPath(); Info<< "Removing file " << object << endl; rm(object); + + return true; } + + return false; } @@ -392,11 +396,7 @@ bool doCommand IOobject::readOption r; - if (action == topoSetSource::REMOVE) - { - removeSet(mesh, setType, setName); - } - else if + if ( (action == topoSetSource::NEW) || (action == topoSetSource::CLEAR) @@ -414,7 +414,11 @@ bool doCommand currentSet.resize(max(currentSet.size(), typSize)); } - if (!currentSetPtr.valid()) + if (action == topoSetSource::REMOVE) + { + ok = removeSet(mesh, setType, setName); + } + else if (!currentSetPtr.valid()) { Info<< " Cannot construct/load set " << topoSet::localPath(mesh, setName) << endl;