SIMPLEControlSingleRun.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) 2007-2019 PCOpt/NTUA
9 Copyright (C) 2013-2019 FOSS GP
10 Copyright (C) 2019 OpenCFD Ltd.
11-------------------------------------------------------------------------------
12License
13 This file is part of OpenFOAM.
14
15 OpenFOAM is free software: you can redistribute it and/or modify it
16 under the terms of the GNU General Public License as published by
17 the Free Software Foundation, either version 3 of the License, or
18 (at your option) any later version.
19
20 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
21 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
22 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 for more details.
24
25 You should have received a copy of the GNU General Public License
26 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
27
28
29Class
30 Foam::SIMPLEControlSingleRun
31
32Description
33 SIMPLE control class for single runs (i.e. not optimisation).
34 Time acts as in simpleFoam, with all solver control read through
35 optimisationDict
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef SIMPLEControlSingleRun_H
40#define SIMPLEControlSingleRun_H
41
42#include "SIMPLEControl.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49/*---------------------------------------------------------------------------*\
50 Class SIMPLEControlSingleRun Declaration
51\*---------------------------------------------------------------------------*/
54:
55 public SIMPLEControl
56{
57protected:
58
59 // Protected Data
60
61 //- Start time
62 scalar startTime_;
63
64 //- End time
65 scalar endTime_;
66
67
68 // Protected Member Functions
69
70 //- Read controls from optimisationDict
71 virtual bool read();
72
73 //- Set end time if number of iters has changed
74 virtual void readIters();
75
76 //- Check whether endTime has been overwritten by a run-time
77 //- modification of controlDict
78 void checkEndTime(bool& isRunning);
79
80
81private:
82
83 //- No copy construct
85
86 //- No copy assignment
87 void operator=(const SIMPLEControlSingleRun&) = delete;
88
89
90public:
91
92 // Static Data Members
93
94 //- Run-time type information
95 TypeName("singleRun");
96
97
98 // Constructors
99
100 //- Construct from mesh
102 (
103 fvMesh& mesh,
104 const word& managerType,
105 const solver& solver
106 );
107
108
109 //- Destructor
110 virtual ~SIMPLEControlSingleRun() = default;
111
112
113 // Member Functions
114
115 // Solution control
116
117 //- Whether to call time.write() or not
118 virtual bool write(const bool valid = true) const;
119
120 //- Write fields, even if it is not a writeTime
121 void writeNow();
122
123 // Evolution
124
125 //- Loop
126 virtual bool loop();
127};
128
129
130// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132} // End namespace Foam
133
134// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135
136#endif
137
138// ************************************************************************* //
SIMPLE control class for single runs (i.e. not optimisation). Time acts as in simpleFoam,...
void writeNow()
Write fields, even if it is not a writeTime.
virtual void readIters()
Set end time if number of iters has changed.
TypeName("singleRun")
Run-time type information.
void checkEndTime(bool &isRunning)
virtual ~SIMPLEControlSingleRun()=default
Destructor.
virtual bool read()
Read controls from optimisationDict.
SIMPLE control class to supply convergence information/checks for the SIMPLE loop.
Definition: SIMPLEControl.H:56
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Base class for solution control classes.
Definition: solver.H:54
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
runTime write()
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73