diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.C b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.C index e56fc33635..c104d3d71b 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.C @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ #include "codeProperties.H" -#include "Time.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // defineTypeNameAndDebug(Foam::codeProperties, 0); + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::codeProperties::codeProperties(const IOobject& io) @@ -41,6 +41,20 @@ Foam::codeProperties::codeProperties(const IOobject& io) // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +bool Foam::codeProperties::modified() const +{ + modified_ = modified_ || regIOobject::modified(); + + return modified_; +} + + +void Foam::codeProperties::setUnmodified() const +{ + modified_ = false; +} + + bool Foam::codeProperties::read() { if (regIOobject::read()) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.H b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.H index 6916fa362f..f8d855274f 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/codedFixedValue/codeProperties.H @@ -25,7 +25,7 @@ Class Foam::codeProperties Description - IOdictionary + flag whether file has changed. + IOdictionary with an internal flag to explicitly track when a file changed. SourceFiles codeProperties.C @@ -35,7 +35,6 @@ SourceFiles #ifndef codeProperties_H #define codeProperties_H -#include "MeshObject.H" #include "IOdictionary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -53,7 +52,7 @@ class codeProperties { // Private data - //- File change + //- Monitor file change mutable bool modified_; public: @@ -69,15 +68,12 @@ public: // Member Functions - bool modified() const - { - return modified_; - } + //- A sticky version of regIOobject::modified() + // Must explicitly clear with setUnmodified() + virtual bool modified() const; - void setUnmodified() const - { - modified_ = false; - } + //- Make modification unsticky + void setUnmodified() const; //- Read the dictionary virtual bool read();