1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Abstract base-class for Time/database function objects.
31 Foam::OutputFilterFunctionObject
36 \*---------------------------------------------------------------------------*/
38 #ifndef functionObject_H
39 #define functionObject_H
43 #include "runTimeSelectionTables.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of classes
53 /*---------------------------------------------------------------------------*\
54 Class functionObject Declaration
55 \*---------------------------------------------------------------------------*/
65 // Private Member Functions
67 //- Disallow default bitwise copy construct
68 functionObject(const functionObject&);
70 //- Disallow default bitwise assignment
71 void operator=(const functionObject&);
76 //- Runtime type information
77 virtual const word& type() const = 0;
82 // Declare run-time constructor selection tables
84 declareRunTimeSelectionTable
89 (const word& name, const Time& t, const dictionary& dict),
96 //- Construct from components
97 functionObject(const word& name);
100 autoPtr<functionObject> clone() const
102 notImplemented("functionObject::clone() const");
103 return autoPtr<functionObject>(NULL);
106 //- Return a pointer to a new functionObject created on freestore
119 autoPtr<functionObject> operator()
129 //- Select from dictionary, based on its "type" entry
130 static autoPtr<functionObject> New
139 virtual ~functionObject();
145 virtual const word& name() const;
147 //- Called at the start of the time-loop
148 virtual bool start() = 0;
150 //- Called at each ++ or += of the time-loop. forceWrite overrides the
151 // outputControl behaviour.
152 virtual bool execute(const bool forceWrite) = 0;
154 //- Called when Time::run() determines that the time-loop exits.
155 // By default it simply calls execute().
158 //- Read and set the function object if its data have changed
159 virtual bool read(const dictionary&) = 0;
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 } // End namespace Foam
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 // ************************************************************************* //