ENH: added timeFunctionObject virtual class in inheritance hierarchy

- simply a functionObject with an additional Time reference, which is
  a combination frequently used by concrete functionObjects
This commit is contained in:
Mark Olesen
2019-01-25 08:56:21 +01:00
parent 8433ddee0e
commit ad7f29466a
27 changed files with 225 additions and 178 deletions

View File

@ -284,14 +284,17 @@ $(dll)/dynamicCode/dynamicCode.C
$(dll)/dynamicCode/dynamicCodeContext.C $(dll)/dynamicCode/dynamicCodeContext.C
$(dll)/codedBase/codedBase.C $(dll)/codedBase/codedBase.C
db/functionObjects/functionObject/functionObject.C funcObjs = db/functionObjects
db/functionObjects/functionObjectList/functionObjectList.C
db/functionObjects/stateFunctionObject/stateFunctionObject.C $(funcObjs)/functionObject/functionObject.C
db/functionObjects/writeFile/writeFile.C $(funcObjs)/functionObjectList/functionObjectList.C
db/functionObjects/logFiles/logFiles.C $(funcObjs)/stateFunctionObject/stateFunctionObject.C
db/functionObjects/timeControl/timeControl.C $(funcObjs)/timeFunctionObject/timeFunctionObject.C
db/functionObjects/timeControl/timeControlFunctionObject.C $(funcObjs)/writeFile/writeFile.C
db/functionObjects/regionFunctionObject/regionFunctionObject.C $(funcObjs)/logFiles/logFiles.C
$(funcObjs)/timeControl/timeControl.C
$(funcObjs)/timeControl/timeControlFunctionObject.C
$(funcObjs)/regionFunctionObject/regionFunctionObject.C
Time = db/Time Time = db/Time
$(Time)/TimePaths.C $(Time)/TimePaths.C

View File

@ -102,12 +102,6 @@ Foam::functionObjects::logFiles::logFiles
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::logFiles::~logFiles()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::wordList& Foam::functionObjects::logFiles::names() const const Foam::wordList& Foam::functionObjects::logFiles::names() const

View File

@ -51,7 +51,7 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class logFiles Declaration Class functionObjects::logFiles Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class logFiles class logFiles
@ -116,7 +116,7 @@ public:
//- Destructor //- Destructor
virtual ~logFiles(); virtual ~logFiles() = default;
// Member Functions // Member Functions

View File

@ -48,14 +48,14 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes // Forward declarations
class objectRegistry; class objectRegistry;
namespace functionObjects namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class regionFunctionObject Declaration Class functionObjects::regionFunctionObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class regionFunctionObject class regionFunctionObject
@ -65,7 +65,7 @@ class regionFunctionObject
protected: protected:
// Protected member data // Protected Member Data
//- Reference to the region objectRegistry //- Reference to the region objectRegistry
const objectRegistry& obr_; const objectRegistry& obr_;
@ -76,7 +76,7 @@ protected:
const objectRegistry& subObr_; const objectRegistry& subObr_;
// Protected member functions // Protected Member Functions
//- Selector for alternative sub-registry, //- Selector for alternative sub-registry,
// when the keyword %subRegion is present in the dictionary // when the keyword %subRegion is present in the dictionary
@ -148,10 +148,6 @@ protected:
bool clearObject(const word& fieldName); bool clearObject(const word& fieldName);
private:
// Private Member Functions
//- No copy construct //- No copy construct
regionFunctionObject(const regionFunctionObject&) = delete; regionFunctionObject(const regionFunctionObject&) = delete;

View File

@ -52,14 +52,7 @@ Foam::functionObjects::stateFunctionObject::stateFunctionObject
const Time& runTime const Time& runTime
) )
: :
functionObject(name), timeFunctionObject(name, runTime)
time_(runTime)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::stateFunctionObject::~stateFunctionObject()
{} {}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. \\/ M anipulation | Copyright (C) 2015-2019 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::functionObjectState Foam::functionObjects::stateFunctionObject
Description Description
Base class for function objects, adding functionality to read/write state Base class for function objects, adding functionality to read/write state
@ -46,7 +46,7 @@ SourceFiles
#ifndef functionObjects_stateFunctionObject_H #ifndef functionObjects_stateFunctionObject_H
#define functionObjects_stateFunctionObject_H #define functionObjects_stateFunctionObject_H
#include "functionObject.H" #include "timeFunctionObject.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -59,12 +59,12 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class stateFunctionObject Declaration Class functionObjects::stateFunctionObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class stateFunctionObject class stateFunctionObject
: :
public functionObject public functionObjects::timeFunctionObject
{ {
private: private:
@ -75,24 +75,9 @@ private:
static const word resultsName_; static const word resultsName_;
// Private Member Functions
//- No copy construct
stateFunctionObject(const stateFunctionObject&) = delete;
//- No copy assignment
void operator=(const stateFunctionObject&) = delete;
protected: protected:
// Protected Member Data // Protected Member Functions
//- Reference to the time database
const Time& time_;
// Protacted Member Functions
//- Return a const reference to the state dictionary //- Return a const reference to the state dictionary
const IOdictionary& stateDict() const; const IOdictionary& stateDict() const;
@ -101,6 +86,12 @@ protected:
IOdictionary& stateDict(); IOdictionary& stateDict();
//- No copy construct
stateFunctionObject(const stateFunctionObject&) = delete;
//- No copy assignment
void operator=(const stateFunctionObject&) = delete;
public: public:
@ -111,7 +102,7 @@ public:
//- Destructor //- Destructor
~stateFunctionObject(); virtual ~stateFunctionObject() = default;
// Member Functions // Member Functions

View File

@ -66,12 +66,6 @@ Foam::timeControl::timeControl
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::timeControl::~timeControl()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::timeControl::entriesPresent bool Foam::timeControl::entriesPresent
@ -82,12 +76,7 @@ bool Foam::timeControl::entriesPresent
{ {
const word controlName(prefix + "Control"); const word controlName(prefix + "Control");
if (dict.found(controlName)) return dict.found(controlName);
{
return true;
}
return false;
} }

View File

@ -116,7 +116,7 @@ public:
//- Destructor //- Destructor
~timeControl(); ~timeControl() = default;
// Member Functions // Member Functions

View File

@ -442,12 +442,11 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
Foam::functionObjects::timeControl::timeControl Foam::functionObjects::timeControl::timeControl
( (
const word& name, const word& name,
const Time& t, const Time& runTime,
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
time_(t),
dict_(dict), dict_(dict),
controlMode_(controlMode::TIME), controlMode_(controlMode::TIME),
timeStart_(-VGREAT), timeStart_(-VGREAT),
@ -455,9 +454,9 @@ Foam::functionObjects::timeControl::timeControl
triggerStart_(labelMax), triggerStart_(labelMax),
triggerEnd_(labelMax), triggerEnd_(labelMax),
nStepsToStartTimeChange_(labelMax), nStepsToStartTimeChange_(labelMax),
executeControl_(t, dict, "execute"), executeControl_(runTime, dict, "execute"),
writeControl_(t, dict, "write"), writeControl_(runTime, dict, "write"),
foPtr_(functionObject::New(name, t, dict_)), foPtr_(functionObject::New(name, runTime, dict_)),
executeTimeIndex_(-1), executeTimeIndex_(-1),
deltaT0_(0), deltaT0_(0),
seriesDTCoeff_(GREAT) seriesDTCoeff_(GREAT)

View File

@ -56,7 +56,7 @@ SourceFiles
#ifndef functionObjects_timeControl_H #ifndef functionObjects_timeControl_H
#define functionObjects_timeControl_H #define functionObjects_timeControl_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "dictionary.H" #include "dictionary.H"
#include "timeControl.H" #include "timeControl.H"
@ -68,12 +68,12 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class timeControl Declaration Class functionObjects::timeControl Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class timeControl class timeControl
: :
public functionObject public functionObjects::timeFunctionObject
{ {
public: public:
@ -96,9 +96,6 @@ private:
// Private data // Private data
//- Reference to the time database
const Time& time_;
//- Input dictionary //- Input dictionary
dictionary dict_; dictionary dict_;
@ -198,8 +195,8 @@ public:
timeControl timeControl
( (
const word& name, const word& name,
const Time&, const Time& runTime,
const dictionary& const dictionary& dict
); );
@ -207,9 +204,6 @@ public:
// Access // Access
//- Return time database
inline const Time& time() const;
//- Return the input dictionary //- Return the input dictionary
inline const dictionary& dict() const; inline const dictionary& dict() const;

View File

@ -25,12 +25,6 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::Time& Foam::functionObjects::timeControl::time() const
{
return time_;
}
inline const Foam::dictionary& Foam::functionObjects::timeControl::dict() const inline const Foam::dictionary& Foam::functionObjects::timeControl::dict() const
{ {
return dict_; return dict_;

View File

@ -0,0 +1,42 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "timeFunctionObject.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::functionObjects::timeFunctionObject::timeFunctionObject
(
const word& name,
const Time& runTime
)
:
functionObject(name),
time_(runTime)
{}
// ************************************************************************* //

View File

@ -0,0 +1,108 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::functionObjects::timeFunctionObject
Description
Virtual base class for function objects with a reference to Time.
See also
Foam::functionObject
SourceFiles
timeFunctionObject.C
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_timeFunctionObject_H
#define functionObjects_timeFunctionObject_H
#include "functionObject.H"
#include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace functionObjects
{
/*---------------------------------------------------------------------------*\
Class functionObjects::timeFunctionObject Declaration
\*---------------------------------------------------------------------------*/
class timeFunctionObject
:
public functionObject
{
protected:
// Protected Member Data
//- Reference to the time database
const Time& time_;
// Protected Member Functions
//- No copy construct
timeFunctionObject(const timeFunctionObject&) = delete;
//- No copy assignment
void operator=(const timeFunctionObject&) = delete;
public:
// Constructors
//- Construct from components
timeFunctionObject(const word& name, const Time& runTime);
//- Destructor
virtual ~timeFunctionObject() = default;
// Member Functions
//- Return time database
const Time& time() const
{
return time_;
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace functionObjects
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -51,7 +51,7 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class writeFile Declaration Class functionObjects::writeFile Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class writeFile class writeFile
@ -121,10 +121,6 @@ protected:
Omanip<int> valueWidth(const label offset = 0) const; Omanip<int> valueWidth(const label offset = 0) const;
private:
// Private Member Functions
//- No copy construct //- No copy construct
writeFile(const writeFile&) = delete; writeFile(const writeFile&) = delete;

View File

@ -508,9 +508,8 @@ Foam::functionObjects::externalCoupled::externalCoupled
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
externalFileCoupler(), externalFileCoupler(),
time_(runTime),
calcFrequency_(-1), calcFrequency_(-1),
lastTrigger_(-1), lastTrigger_(-1),
initialisedCoupling_(false) initialisedCoupling_(false)

View File

@ -146,7 +146,7 @@ SourceFiles
#ifndef functionObjects_externalCoupled_H #ifndef functionObjects_externalCoupled_H
#define functionObjects_externalCoupled_H #define functionObjects_externalCoupled_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "externalFileCoupler.H" #include "externalFileCoupler.H"
#include "DynamicList.H" #include "DynamicList.H"
#include "wordReList.H" #include "wordReList.H"
@ -173,7 +173,7 @@ namespace functionObjects
class externalCoupled class externalCoupled
: :
public functionObject, public functionObjects::timeFunctionObject,
public externalFileCoupler public externalFileCoupler
{ {
public: public:
@ -193,10 +193,7 @@ private:
//- State end names (NB, only selectable values itemized) //- State end names (NB, only selectable values itemized)
static const Enum<stateEnd> stateEndNames_; static const Enum<stateEnd> stateEndNames_;
// Private data // Private Member Data
//- Reference to the time database
const Time& time_;
//- Calculation frequency //- Calculation frequency
label calcFrequency_; label calcFrequency_;

View File

@ -138,8 +138,7 @@ Foam::functionObjects::abort::abort
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
time_(runTime),
file_(), file_(),
defaultAction_(Time::stopAtControls::saUnknown), defaultAction_(Time::stopAtControls::saUnknown),
triggered_(false) triggered_(false)

View File

@ -86,7 +86,7 @@ SourceFiles
#ifndef functionObjects_abort_H #ifndef functionObjects_abort_H
#define functionObjects_abort_H #define functionObjects_abort_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "Time.H" #include "Time.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -102,13 +102,10 @@ namespace functionObjects
class abort class abort
: :
public functionObject public functionObjects::timeFunctionObject
{ {
// Private Data // Private Data
//- Reference to the Time
const Time& time_;
//- The fully-qualified name of the trigger file //- The fully-qualified name of the trigger file
fileName file_; fileName file_;

View File

@ -124,13 +124,12 @@ Foam::functionObjects::codedFunctionObject::codeDict() const
Foam::functionObjects::codedFunctionObject::codedFunctionObject Foam::functionObjects::codedFunctionObject::codedFunctionObject
( (
const word& name, const word& name,
const Time& time, const Time& runTime,
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
codedBase(), codedBase(),
time_(time),
dict_(dict) dict_(dict)
{ {
read(dict_); read(dict_);
@ -140,12 +139,6 @@ Foam::functionObjects::codedFunctionObject::codedFunctionObject
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::codedFunctionObject::~codedFunctionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::functionObject& Foam::functionObject&

View File

@ -75,7 +75,7 @@ SourceFiles
#ifndef functionObjects_codedFunctionObject_H #ifndef functionObjects_codedFunctionObject_H
#define functionObjects_codedFunctionObject_H #define functionObjects_codedFunctionObject_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "codedBase.H" #include "codedBase.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,16 +91,13 @@ namespace functionObjects
class codedFunctionObject class codedFunctionObject
: :
public functionObject, public functionObjects::timeFunctionObject,
public codedBase public codedBase
{ {
protected: protected:
// Protected data // Protected data
//- Reference to the time database
const Time& time_;
//- Input dictionary //- Input dictionary
dictionary dict_; dictionary dict_;
@ -153,13 +150,13 @@ public:
codedFunctionObject codedFunctionObject
( (
const word& name, const word& name,
const Time& time, const Time& runTime,
const dictionary& dict const dictionary& dict
); );
//- Destructor //- Destructor
virtual ~codedFunctionObject(); virtual ~codedFunctionObject() = default;
// Member Functions // Member Functions

View File

@ -53,28 +53,14 @@ Foam::functionObjects::setTimeStepFunctionObject::setTimeStepFunctionObject
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime)
time_(runTime)
{ {
read(dict); read(dict);
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::setTimeStepFunctionObject::~setTimeStepFunctionObject()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
const Foam::Time&
Foam::functionObjects::setTimeStepFunctionObject::time() const
{
return time_;
}
bool Foam::functionObjects::setTimeStepFunctionObject::adjustTimeStep() bool Foam::functionObjects::setTimeStepFunctionObject::adjustTimeStep()
{ {
// Wanted timestep // Wanted timestep

View File

@ -69,7 +69,7 @@ SourceFiles
#ifndef functionObjects_setTimeStepFunctionObject_H #ifndef functionObjects_setTimeStepFunctionObject_H
#define functionObjects_setTimeStepFunctionObject_H #define functionObjects_setTimeStepFunctionObject_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "Function1.H" #include "Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -80,23 +80,20 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class setTimeStepFunctionObject Declaration Class functionObjects::setTimeStepFunctionObject Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class setTimeStepFunctionObject class setTimeStepFunctionObject
: :
public functionObject public functionObjects::timeFunctionObject
{ {
// Private data // Private Member Data
//- Reference to the time database
const Time& time_;
//- Time step function/table //- Time step function/table
autoPtr<Function1<scalar>> timeStepPtr_; autoPtr<Function1<scalar>> timeStepPtr_;
// Private member functions // Private Member Functions
//- No copy construct //- No copy construct
setTimeStepFunctionObject(const setTimeStepFunctionObject&) = delete; setTimeStepFunctionObject(const setTimeStepFunctionObject&) = delete;
@ -123,14 +120,11 @@ public:
// Destructor // Destructor
virtual ~setTimeStepFunctionObject(); virtual ~setTimeStepFunctionObject() = default;
// Member Functions // Member Functions
//- Return time database
const Time& time() const;
//- Called at the end of Time::adjustDeltaT() if adjustTime is true //- Called at the end of Time::adjustDeltaT() if adjustTime is true
virtual bool adjustTimeStep(); virtual bool adjustTimeStep();

View File

@ -89,8 +89,7 @@ Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
time_(runTime),
fileToUpdate_("unknown-fileToUpdate"), fileToUpdate_("unknown-fileToUpdate"),
timeVsFile_(), timeVsFile_(),
lastIndex_(-1), lastIndex_(-1),
@ -100,12 +99,6 @@ Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
} }
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::timeActivatedFileUpdate::~timeActivatedFileUpdate()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::timeActivatedFileUpdate::read bool Foam::functionObjects::timeActivatedFileUpdate::read

View File

@ -69,7 +69,7 @@ SourceFiles
#ifndef functionObjects_timeActivatedFileUpdate_H #ifndef functionObjects_timeActivatedFileUpdate_H
#define functionObjects_timeActivatedFileUpdate_H #define functionObjects_timeActivatedFileUpdate_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "Tuple2.H" #include "Tuple2.H"
#include "Switch.H" #include "Switch.H"
@ -85,17 +85,14 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class timeActivatedFileUpdate Declaration Class functionObjects::timeActivatedFileUpdate Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class timeActivatedFileUpdate class timeActivatedFileUpdate
: :
public functionObject public functionObjects::timeFunctionObject
{ {
// Private data // Private Member Data
//- Reference to Time
const Time& time_;
//- Name of file to update //- Name of file to update
fileName fileToUpdate_; fileName fileToUpdate_;
@ -140,7 +137,7 @@ public:
//- Destructor //- Destructor
virtual ~timeActivatedFileUpdate(); virtual ~timeActivatedFileUpdate() = default;
// Member Functions // Member Functions

View File

@ -122,8 +122,7 @@ Foam::functionObjects::vtkWrite::vtkWrite
const dictionary& dict const dictionary& dict
) )
: :
functionObject(name), timeFunctionObject(name, runTime),
time_(runTime),
outputDir_(), outputDir_(),
printf_(), printf_(),
writeOpts_(vtk::formatType::INLINE_BASE64), writeOpts_(vtk::formatType::INLINE_BASE64),

View File

@ -132,7 +132,7 @@ SourceFiles
#ifndef functionObjects_vtkWrite_H #ifndef functionObjects_vtkWrite_H
#define functionObjects_vtkWrite_H #define functionObjects_vtkWrite_H
#include "functionObject.H" #include "timeFunctionObject.H"
#include "foamVtkInternalWriter.H" #include "foamVtkInternalWriter.H"
#include "foamVtkPatchWriter.H" #include "foamVtkPatchWriter.H"
#include "foamVtkSeriesWriter.H" #include "foamVtkSeriesWriter.H"
@ -152,13 +152,10 @@ namespace functionObjects
class vtkWrite class vtkWrite
: :
public functionObject public functionObjects::timeFunctionObject
{ {
// Private Data // Private Data
//- Reference to the time database
const Time& time_;
//- The output directory //- The output directory
fileName outputDir_; fileName outputDir_;

View File

@ -99,7 +99,7 @@ namespace functionObjects
{ {
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class writeObjects Declaration Class functionObjects::writeObjects Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
class writeObjects class writeObjects
@ -125,7 +125,7 @@ private:
// Private data // Private data
//- Reference to Db //- Reference to registry
const objectRegistry& obr_; const objectRegistry& obr_;
//- To only write objects of defined writeOption //- To only write objects of defined writeOption