Commit 6aba1d08 authored by andy's avatar andy
Browse files

ENH: Updated moving mesh support in function objects

parent 4cf65554
......@@ -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);
}
};
......
......@@ -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<OutputFilter>::read
}
template<class OutputFilter>
void Foam::OutputFilterFunctionObject<OutputFilter>::updateMesh
(
const mapPolyMesh& mpm
)
{
if (active() && mpm.mesh().name() == regionName_)
{
ptr_->updateMesh(mpm);
}
}
template<class OutputFilter>
void Foam::OutputFilterFunctionObject<OutputFilter>::movePoints
(
const polyMesh& mesh
)
{
if (active() && mesh.name() == regionName_)
{
ptr_->movePoints(mesh);
}
}
// ************************************************************************* //
......@@ -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);
};
......
......@@ -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;
};
......
......@@ -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);
}
}
}
// ************************************************************************* //
......@@ -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);
};
......
......@@ -1173,6 +1173,8 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
).movePoints(points_);
}
const_cast<Time&>(time()).functionObjects().movePoints(*this);
return sweptVols;
}
......
......@@ -109,6 +109,8 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
)
).updateMesh(mpm);
}
const_cast<Time&>(time()).functionObjects().updateMesh(mpm);
}
......
Supports Markdown
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