Merge branch 'feature-readNow' into 'develop'

Feature read now

See merge request !102
This commit is contained in:
Andrew Heather
2017-04-19 17:22:28 +01:00
14 changed files with 117 additions and 30 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -146,6 +146,12 @@ bool Foam::functionObject::adjustTimeStep()
}
bool Foam::functionObject::filesModified() const
{
return false;
}
void Foam::functionObject::updateMesh(const mapPolyMesh&)
{}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -233,6 +233,9 @@ public:
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
virtual bool adjustTimeStep();
//- Did any file get changed during execution?
virtual bool filesModified() const;
//- Update for changes of mesh
virtual void updateMesh(const mapPolyMesh& mpm);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -819,6 +819,21 @@ bool Foam::functionObjectList::read()
}
bool Foam::functionObjectList::filesModified() const
{
bool ok = false;
if (execution_)
{
forAll(*this, objectI)
{
bool changed = operator[](objectI).filesModified();
ok = ok || changed;
}
}
return ok;
}
void Foam::functionObjectList::updateMesh(const mapPolyMesh& mpm)
{
if (execution_)

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -264,6 +264,9 @@ public:
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
bool adjustTimeStep();
//- Did any file get changed during execution?
bool filesModified() const;
//- Update for changes of mesh
void updateMesh(const mapPolyMesh& mpm);

View File

@ -220,6 +220,17 @@ bool Foam::functionObjects::timeControl::read
}
bool Foam::functionObjects::timeControl::filesModified() const
{
bool mod = false;
if (active())
{
mod = foPtr_->filesModified();
}
return mod;
}
void Foam::functionObjects::timeControl::updateMesh
(
const mapPolyMesh& mpm

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -177,6 +177,9 @@ public:
//- Called at the end of Time::adjustDeltaT() if adjustTime is true
virtual bool adjustTimeStep();
//- Did any file get changed during execution?
virtual bool filesModified() const;
//- Read and set the function object if its data have changed
virtual bool read(const dictionary&);