mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: topoSet: check write status. Fixes #952
This commit is contained in:
@ -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:
|
||||
|
||||
Reference in New Issue
Block a user