Commit 1abacf0d authored by mattijs's avatar mattijs
Browse files

ENH: topoSet: check write status. Fixes #952

parent a6b84927
......@@ -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;
}
}
}
}
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment