timeFunctionObject.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2019 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::functionObjects::timeFunctionObject
28
29Description
30 Virtual base class for function objects with a reference to Time.
31
32See also
33 Foam::functionObject
34
35SourceFiles
36 timeFunctionObject.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef functionObjects_timeFunctionObject_H
41#define functionObjects_timeFunctionObject_H
42
43#include "functionObject.H"
44#include "Time.H"
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48namespace Foam
49{
50namespace functionObjects
51{
52
53/*---------------------------------------------------------------------------*\
54 Class timeFunctionObject Declaration
55\*---------------------------------------------------------------------------*/
58:
59 public functionObject
60{
61protected:
62
63 // Protected Member Data
64
65 //- Reference to the time database
66 const Time& time_;
67
68
69 // Protected Member Functions
70
71 //- Remove specified items from "functionObjectObjects"
72 void clearOutputObjects(const wordList& objNames);
73
74
75 //- No copy construct
77
78 //- No copy assignment
79 void operator=(const timeFunctionObject&) = delete;
80
81
82public:
83
84 // Constructors
85
86 //- Construct from Time
87 timeFunctionObject(const word& name, const Time& runTime);
88
89
90 //- Destructor
91 virtual ~timeFunctionObject() = default;
92
93
94 // Member Functions
95
96 //- Return time database
97 const Time& time() const
98 {
99 return time_;
100 }
101
102 //- Write access to the output objects ("functionObjectObjects")
103 //- registered on Time
105
106 //- Const access to the output objects ("functionObjectObjects")
107 //- registered on Time
108 const objectRegistry& storedObjects() const;
109};
110
111
112// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113
114} // End namespace functionObjects
115} // End namespace Foam
116
117
118// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119
120#endif
121
122// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Abstract base-class for Time/database function objects.
const word & name() const noexcept
Return the name of this functionObject.
Virtual base class for function objects with a reference to Time.
const Time & time_
Reference to the time database.
const Time & time() const
Return time database.
timeFunctionObject(const timeFunctionObject &)=delete
No copy construct.
virtual ~timeFunctionObject()=default
Destructor.
void clearOutputObjects(const wordList &objNames)
Remove specified items from "functionObjectObjects".
void operator=(const timeFunctionObject &)=delete
No copy assignment.
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.