exprResultStored.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) 2012-2018 Bernhard Gschaider <bgschaid@hfd-research.com>
9 Copyright (C) 2019-2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::expressions::exprResultStored
29
30Description
31 An exprResult with persistence.
32
33 \heading Dictionary parameters
34 \table
35 Property | Description | Required | Default
36 name | The result name | yes |
37 initialValue | The initial value | yes |
38 value | The expression result (dictionary) | no |
39 \endtable
40
41SourceFiles
42 StoredExpressionResult.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef expressions_exprResultStored_H
47#define expressions_exprResultStored_H
48
49#include "exprResult.H"
50#include "exprString.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56namespace expressions
57{
58
59/*---------------------------------------------------------------------------*\
60 Class exprResultStored Declaration
61\*---------------------------------------------------------------------------*/
62
63class exprResultStored
64:
65 public expressions::exprResult
66{
67 // Private Data
68
69 //- The name of the expression
70 word name_;
71
72 //- The initial value expression
73 expressions::exprString startExpr_;
74
75
76protected:
77
78 // Protected Member Functions
79
80 //- Reset at new timestep - disabling locally
81 virtual void resetImpl() {}
83
84public:
85
86 //- Runtime type information
87 TypeNameNoDebug("exprResultStored");
88
89
90 // Constructors
91
92 //- Default construct
94
95 //- Copy construct
97
98 //- Construct from a dictionary
99 explicit exprResultStored(const dictionary& dict);
101
102 // Selectors
103
104 virtual autoPtr<exprResult> clone() const
105 {
107 (
108 new exprResultStored(*this)
109 );
110 }
111
112
113 //- Destructor
114 virtual ~exprResultStored() = default;
115
116
117 // Member Functions
118
119 //- The name of the expression
120 const word& name() const
121 {
122 return name_;
124
125 //- The initial value expression
127 {
128 return startExpr_;
129 }
130
131
132 void writeDict(Ostream& os) const;
134
135 // Member Operators
136
137 //- Copy assignment
138 void operator=(const exprResultStored& rhs);
140 //- Copy assignment
141 void operator=(const exprResult& rhs);
142};
143
144
145// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146
147} // End namespace expressions
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151// IO Operators
154
155// Comparison
156inline bool operator!=
157(
160)
161{
162 return (&a != &b);
163}
164
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168} // End namespace Foam
169
170// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171
172#endif
173
174// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Database for solution data, solver performance and other reduced data.
Definition: data.H:58
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
An exprResult with persistence.
const word & name() const
The name of the expression.
virtual ~exprResultStored()=default
Destructor.
virtual autoPtr< exprResult > clone() const
Clone.
void operator=(const exprResultStored &rhs)
Copy assignment.
const expressions::exprString & initialValueExpression() const
The initial value expression.
void writeDict(Ostream &os) const
virtual void resetImpl()
Reset at new timestep - disabling locally.
TypeNameNoDebug("exprResultStored")
Runtime type information.
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:127
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
dictionary dict
volScalarField & b
Definition: createFields.H:27
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition: typeInfo.H:68