ENH: postProcess - update function objects on mesh change rather than clear

This commit is contained in:
Andrew Heather 2019-10-10 20:56:36 +01:00
parent eb5b6fd7e4
commit 64ceecc4c9

View File

@ -112,18 +112,31 @@ if (argList::postProcess(argc, argv))
Info<< "Time = " << runTime.timeName() << endl;
if (mesh.readUpdate() != polyMesh::UNCHANGED)
switch (mesh.readUpdate())
{
// Update functionObjects if mesh changes
// Note clearing the dictionary to avoid merge warning
functionsDict.clear();
functionsPtr = functionObjectList::New
(
args,
runTime,
functionsDict,
selectedFields
);
case polyMesh::POINTS_MOVED:
{
functionsPtr->movePoints(mesh);
break;
}
case polyMesh::TOPO_CHANGE:
case polyMesh::TOPO_PATCH_CHANGE:
{
mapPolyMesh mpm(mesh);
functionsPtr->updateMesh(mpm);
break;
}
case polyMesh::UNCHANGED:
{
// No additional work
break;
}
default:
{
FatalErrorIn(args.executable())
<< "Unhandled enumeration"
<< abort(FatalError);
}
}
FatalIOError.throwExceptions();