negEntry.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-2019 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::functionEntries::negEntry
26 
27 Description
28  Negate a dictionary variable by prefixing with \c #neg
29 
30  E.g.
31  \verbatim
32  Umean 5.75;
33  .
34  .
35  .
36  inlet
37  {
38  type uniformFixedValue;
39  uniformValue (#neg $Umean 0 0);
40  }
41  \endverbatim
42  Note the space required between the \c #neg and the '$'
43 
44 SourceFiles
45  negEntry.C
46 
47 \*---------------------------------------------------------------------------*/
48 
49 #ifndef negEntry_H
50 #define negEntry_H
51 
52 #include "functionEntry.H"
53 
54 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 
56 namespace Foam
57 {
58 namespace functionEntries
59 {
60 
61 /*---------------------------------------------------------------------------*\
62  Class negEntry Declaration
63 \*---------------------------------------------------------------------------*/
64 
65 class negEntry
66 :
67  public functionEntry
68 {
69  // Private Member Functions
70 
71  //- Lookup variable, negate and return as a string
72  static string negateVariable
73  (
74  const dictionary& parentDict,
75  Istream& is
76  );
77 
78 
79 public:
80 
81  //- Runtime type information
82  ClassName("neg");
83 
84 
85  // Constructors
86 
87  //- Disallow default bitwise copy construction
88  negEntry(const negEntry&) = delete;
89 
90 
91  // Member Functions
92 
93  //- Execute the functionEntry in a sub-dict context
94  static bool execute(dictionary& parentDict, Istream&);
95 
96  //- Execute the functionEntry in a primitiveEntry context
97  static bool execute
98  (
99  const dictionary& parentDict,
101  Istream&
102  );
103 
104 
105  // Member Operators
106 
107  //- Disallow default bitwise assignment
108  void operator=(const negEntry&) = delete;
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace functionEntries
115 } // End namespace Foam
116 
117 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
118 
119 #endif
120 
121 // ************************************************************************* //
Negate a dictionary variable by prefixing with neg.
Definition: negEntry.H:64
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
static bool execute(dictionary &parentDict, Istream &)
Execute the functionEntry in a sub-dict context.
Definition: negEntry.C:133
negEntry(const negEntry &)=delete
Disallow default bitwise copy construction.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
A keyword and a list of tokens is a &#39;primitiveEntry&#39;. An primitiveEntry can be read, written and printed, and the types and values of its tokens analysed.
A functionEntry causes entries to be added/manipulated on the specified dictionary given an input str...
Definition: functionEntry.H:63
void operator=(const negEntry &)=delete
Disallow default bitwise assignment.
ClassName("neg")
Runtime type information.
Namespace for OpenFOAM.