maxDurationCondition.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) 2018-2022 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::runTimeControls::maxDurationCondition
28
29Description
30 Activated after a user-specified duration
31
32SourceFiles
33 maxDurationCondition.H
34 maxDurationCondition.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef functionObjects_runTimeConditions_maxDurationCondition_H
39#define functionObjects_runTimeConditions_maxDurationCondition_H
40
41#include "runTimeCondition.H"
42
43// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44
45namespace Foam
46{
47namespace functionObjects
48{
49namespace runTimeControls
50{
51
52/*---------------------------------------------------------------------------*\
53 Class maxDurationCondition Declaration
54\*---------------------------------------------------------------------------*/
57:
58 public runTimeCondition
59{
60protected:
61
62 // Protected data
63
64 //- Duration
65 scalar duration_;
66
67 //- Time when the condition is activated
68 scalar startTime_;
69
70 //- Initialisation flag
71 bool initialised_;
72
73 //- Reset on restart (ignores any state information)
75
76
77public:
78
79 //- Runtime type information
80 TypeName("maxDuration");
81
82 //- Constructor
84 (
85 const word& name,
86 const objectRegistry& obr,
87 const dictionary& dict,
89 );
90
91 //- Destructor
92 virtual ~maxDurationCondition() = default;
93
94
95 // Public Member Functions
96
97 //- Apply the condition
98 virtual bool apply();
99
100 //- Write
101 virtual void write();
102
103 //- Reset
104 virtual void reset();
105};
106
107
108// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109
110} // End namespace runTimeControls
111} // End namespace functionObjects
112} // End namespace Foam
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116#endif
117
118// ************************************************************************* //
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:78
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
TypeName("maxDuration")
Runtime type information.
Switch resetOnRestart_
Reset on restart (ignores any state information)
scalar startTime_
Time when the condition is activated.
virtual const word & name() const
Return the condition name.
Base class for function objects, adding functionality to read/write state information (data required ...
Registry of regIOobjects.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73