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