Loading...
Searching...
No Matches
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
9 Copyright (C) 2019-2023 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 Foam_expressions_exprResultStored_H
47#define Foam_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
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() {}
82
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);
100
101
102 // Selectors
103
104 virtual autoPtr<exprResult> clone() const
105 {
107 (
108 new exprResultStored(*this)
109 );
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_;
123 }
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);
139
140 //- Copy assignment
141 void operator=(const exprResult& rhs);
142
143 //- Compare for inequality (need by Ulist)
144 bool operator!=(const exprResultStored& rhs) const noexcept
146 return (this != &rhs);
147 }
148};
149
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153} // End namespace expressions
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157// IO Operators
160
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164} // End namespace Foam
165
166// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167
168#endif
169
170// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
An exprResult with persistence.
const word & name() const
The name of the expression.
bool operator!=(const exprResultStored &rhs) const noexcept
Compare for inequality (need by Ulist).
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.
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:122
exprResult()
Default construct.
Definition exprResult.C:173
A variant of Foam::string with expansion of dictionary variables into a comma-separated form.
Definition exprString.H:58
A class for handling words, derived from Foam::string.
Definition word.H:66
OBJstream os(runTime.globalPath()/outputName)
A namespace for expression-related classes/traits etc.
Namespace for OpenFOAM.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
dictionary dict
#define TypeNameNoDebug(TypeNameString)
Declare a ClassNameNoDebug() with extra virtual type info.
Definition typeInfo.H:61