diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 5141980c3d..fe8df71306 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -282,7 +282,10 @@ void removeZone // Remove last element zones.setSize(zones.size()-1); zones.clearAddressing(); - zones.write(); + if (!zones.write()) + { + WarningInFunction << "Failed writing zone " << setName << endl; + } } } @@ -535,7 +538,12 @@ bool doCommand { currentSet.instance() = mesh.time().timeName(); } - currentSet.write(); + if (!currentSet.write()) + { + WarningInFunction + << "Failed writing set " + << currentSet.objectPath() << endl; + } } } } diff --git a/applications/utilities/mesh/manipulation/topoSet/topoSet.C b/applications/utilities/mesh/manipulation/topoSet/topoSet.C index a0ad8a715f..0ceb92b3ef 100644 --- a/applications/utilities/mesh/manipulation/topoSet/topoSet.C +++ b/applications/utilities/mesh/manipulation/topoSet/topoSet.C @@ -87,7 +87,10 @@ void removeZone // Remove last element zones.setSize(zones.size()-1); zones.clearAddressing(); - zones.write(); + if (!zones.write()) + { + WarningInFunction << "Failed writing zone " << setName << endl; + } } } @@ -298,7 +301,12 @@ int main(int argc, char *argv[]) source().applyToSet(action, currentSet()); // Synchronize for coupled patches. if (!noSync) currentSet().sync(mesh); - currentSet().write(); + if (!currentSet().write()) + { + WarningInFunction + << "Failed writing set " + << currentSet().objectPath() << endl; + } } break; @@ -333,20 +341,35 @@ int main(int argc, char *argv[]) currentSet().subset(oldSet()); // Synchronize for coupled patches. if (!noSync) currentSet().sync(mesh); - currentSet().write(); + if (!currentSet().write()) + { + WarningInFunction + << "Failed writing set " + << currentSet().objectPath() << endl; + } } break; case topoSetSource::CLEAR: Info<< " Clearing " << currentSet().type() << endl; currentSet().clear(); - currentSet().write(); + if (!currentSet().write()) + { + WarningInFunction + << "Failed writing set " + << currentSet().objectPath() << endl; + } break; case topoSetSource::INVERT: Info<< " Inverting " << currentSet().type() << endl; currentSet().invert(currentSet().maxSize(mesh)); - currentSet().write(); + if (!currentSet().write()) + { + WarningInFunction + << "Failed writing set " + << currentSet().objectPath() << endl; + } break; case topoSetSource::REMOVE: