diff --git a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H index c115023a63..ab8872798a 100644 --- a/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H +++ b/src/OpenFOAM/db/functionObjects/IOOutputFilter/IOOutputFilter.H @@ -133,10 +133,10 @@ public: } //- Update for changes of mesh - virtual void movePoints(const pointField& points) + virtual void movePoints(const polyMesh& mesh) { read(); - OutputFilter::movePoints(points); + OutputFilter::movePoints(mesh); } }; diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C index 86a2867777..bd4d0b3d61 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "OutputFilterFunctionObject.H" #include "IOOutputFilter.H" #include "polyMesh.H" +#include "mapPolyMesh.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * Private Members * * * * * * * * * * * * * * // @@ -221,4 +222,30 @@ bool Foam::OutputFilterFunctionObject::read } +template +void Foam::OutputFilterFunctionObject::updateMesh +( + const mapPolyMesh& mpm +) +{ + if (active() && mpm.mesh().name() == regionName_) + { + ptr_->updateMesh(mpm); + } +} + + +template +void Foam::OutputFilterFunctionObject::movePoints +( + const polyMesh& mesh +) +{ + if (active() && mesh.name() == regionName_) + { + ptr_->movePoints(mesh); + } +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H index 0b264cb806..87ade4b282 100644 --- a/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H +++ b/src/OpenFOAM/db/functionObjects/OutputFilterFunctionObject/OutputFilterFunctionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,6 +204,12 @@ public: //- Read and set the function object if its data have changed virtual bool read(const dictionary&); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh& mpm); + + //- Update for changes of mesh + virtual void movePoints(const polyMesh& mesh); }; diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H index a9a026ea88..a7c027b5b3 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,6 +49,8 @@ namespace Foam // Forward declaration of classes class Time; +class polyMesh; +class mapPolyMesh; /*---------------------------------------------------------------------------*\ Class functionObject Declaration @@ -157,6 +159,12 @@ public: //- Read and set the function object if its data have changed virtual bool read(const dictionary&) = 0; + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh& mpm) = 0; + + //- Update for changes of mesh + virtual void movePoints(const polyMesh& mesh) = 0; }; diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 22d6d46097..799e4b626e 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,11 +25,15 @@ License #include "functionObjectList.H" #include "Time.H" +#include "mapPolyMesh.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // -Foam::functionObject* -Foam::functionObjectList::remove(const word& key, label& oldIndex) +Foam::functionObject* Foam::functionObjectList::remove +( + const word& key, + label& oldIndex +) { functionObject* ptr = 0; @@ -319,4 +323,28 @@ bool Foam::functionObjectList::read() } +void Foam::functionObjectList::updateMesh(const mapPolyMesh& mpm) +{ + if (execution_) + { + forAll(*this, objectI) + { + operator[](objectI).updateMesh(mpm); + } + } +} + + +void Foam::functionObjectList::movePoints(const polyMesh& mesh) +{ + if (execution_) + { + forAll(*this, objectI) + { + operator[](objectI).movePoints(mesh); + } + } +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 2f6e0a9f93..923e8501a4 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,6 +49,8 @@ SourceFiles namespace Foam { +class mapPolyMesh; + /*---------------------------------------------------------------------------*\ Class functionObjectList Declaration \*---------------------------------------------------------------------------*/ @@ -163,6 +165,12 @@ public: //- Read and set the function objects if their data have changed virtual bool read(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh& mpm); + + //- Update for changes of mesh + virtual void movePoints(const polyMesh& mesh); }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 0f4f93f940..63c23dc98f 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1173,6 +1173,8 @@ Foam::tmp Foam::polyMesh::movePoints ).movePoints(points_); } + const_cast(time()).functionObjects().movePoints(*this); + return sweptVols; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C index 0fdce95e37..aa4d2bb4b5 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshUpdate.C @@ -109,6 +109,8 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm) ) ).updateMesh(mpm); } + + const_cast(time()).functionObjects().updateMesh(mpm); }