solutionControl.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::solutionControl
26 
27 Description
28  Solution control class
29 
30 SourceFiles
31  solutionControlI.H
32  solutionControl.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef solutionControl_H
37 #define solutionControl_H
38 
39 #include "Time.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class solutionControl Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class solutionControl
51 :
52  public regIOobject
53 {
54 protected:
55 
56  // Protected data
57 
58  //- Reference to the time
59  const Time& time_;
60 
61  //- Name of the algorithm
62  const word algorithmName_;
63 
64  //- Whitespace the same length as the algorithm name
65  const string algorithmSpaceStr_;
66 
67 
68  // Protected Member Functions
69 
70  //- Dummy write for regIOobject
71  virtual bool writeData(Ostream&) const;
72 
73 
74 public:
75 
76  // Static Data Members
77 
78  //- Run-time type information
79  TypeName("solutionControl");
80 
81 
82  // Constructors
83 
84  //- Construct from the time, the name of the algorithm and a registry
86  (
87  const objectRegistry& registry,
88  const Time& time,
89  const word& algorithmName
90  );
91 
92 
93  //- Destructor
94  virtual ~solutionControl();
95 
96 
97  // Member Functions
98 
99  // IO
100 
101  //- Dummy read
102  virtual bool read();
103 
104 
105  // Access
106 
107  //- Return the time
108  inline const Time& time() const;
109 
110  //- Return the name of the algorithm
111  inline const word& algorithmName() const;
112 
113  //- Return some whitespace the same length as the algorithm name
114  inline const char* algorithmSpace() const;
115 
116  //- Return the dictionary
117  virtual const dictionary& dict() const = 0;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #include "solutionControlI.H"
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
const char * algorithmSpace() const
Return some whitespace the same length as the algorithm name.
virtual const dictionary & dict() const =0
Return the dictionary.
virtual bool writeData(Ostream &) const
Dummy write for regIOobject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Solution control class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
A class for handling words, derived from string.
Definition: word.H:59
const string algorithmSpaceStr_
Whitespace the same length as the algorithm name.
virtual bool read()
Dummy read.
solutionControl(const objectRegistry &registry, const Time &time, const word &algorithmName)
Construct from the time, the name of the algorithm and a registry.
const word algorithmName_
Name of the algorithm.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const Time & time() const
Return the time.
const Time & time_
Reference to the time.
virtual ~solutionControl()
Destructor.
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:65
TypeName("solutionControl")
Run-time type information.
const word & algorithmName() const
Return the name of the algorithm.
Registry of regIOobjects.
Namespace for OpenFOAM.