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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::functionObjects::timeFunctionObject
28 
29 Description
30  Virtual base class for function objects with a reference to Time.
31 
32 See also
33  Foam::functionObject
34 
35 SourceFiles
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 
48 namespace Foam
49 {
50 namespace functionObjects
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class timeFunctionObject Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public functionObject
60 {
61 protected:
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
76  timeFunctionObject(const timeFunctionObject&) = delete;
77 
78  //- No copy assignment
79  void operator=(const timeFunctionObject&) = delete;
80 
81 
82 public:
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 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::functionObjects::timeFunctionObject::~timeFunctionObject
virtual ~timeFunctionObject()=default
Destructor.
Foam::functionObjects::timeFunctionObject::storedObjects
objectRegistry & storedObjects()
Definition: timeFunctionObject.C:63
Foam::functionObjects::timeFunctionObject::time_
const Time & time_
Reference to the time database.
Definition: timeFunctionObject.H:65
Foam::functionObjects::timeFunctionObject
Virtual base class for function objects with a reference to Time.
Definition: timeFunctionObject.H:56
Foam::functionObjects::timeFunctionObject::timeFunctionObject
timeFunctionObject(const timeFunctionObject &)=delete
No copy construct.
Foam::functionObject
Abstract base-class for Time/database function objects.
Definition: functionObject.H:321
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::functionObjects::timeFunctionObject::operator=
void operator=(const timeFunctionObject &)=delete
No copy assignment.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Time.H
Foam::functionObjects::timeFunctionObject::time
const Time & time() const
Return time database.
Definition: timeFunctionObject.H:96
Foam::functionObject::name
const word & name() const
Return the name of this functionObject.
Definition: functionObject.C:131
Foam::List< word >
Foam::functionObjects::timeFunctionObject::clearOutputObjects
void clearOutputObjects(const wordList &objNames)
Remove specified items from "functionObjectObjects".
Definition: timeFunctionObject.C:47
functionObject.H