exprDriver.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) 2010-2018 Bernhard Gschaider
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::expressions::exprDriver
29 
30 Description
31  Base driver for parsing (field) values.
32 
33  Largely based on code and ideas from swak4foam
34 
35  Properties
36  \table
37  Property | Description | Required | Default
38  variables | List of variables for expressions | no | ()
39  allowShadowing | Allow variables to shadow field names | no | false
40  \endtable
41 
42  Debug Properties
43  \table
44  Property | Description | Required | Default
45  debugBaseDriver | Debug level (int) for base driver | no |
46  debugScanner | Add debug for scanner | no | false
47  debugParser | Add debug for parser | no | false
48  \endtable
49 
50 SourceFiles
51  exprDriverI.H
52  exprDriver.C
53  exprDriverFields.C
54  exprDriverIO.C
55  exprDriverTemplates.C
56 
57 \*---------------------------------------------------------------------------*/
58 
59 #ifndef expressions_exprDriver_H
60 #define expressions_exprDriver_H
61 
62 #include "exprString.H"
63 #include "exprResult.H"
64 #include "pointField.H"
65 #include "primitiveFields.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace expressions
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class exprDriver Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class exprDriver
79 {
80 protected:
81 
82  // Protected Data
83 
84  // Stored Data
85 
86  //- The dictionary with all input data/specification
87  const dictionary& dict_;
88 
89  //- The result
90  exprResult result_;
91 
92  //- Variable definitions, as read from a dictionary
93  List<expressions::exprString> variableStrings_;
94 
95  //- The variables table
96  HashTable<exprResult> variables_;
97 
98  //- Special-purpose scalar reference argument
99  scalar arg1Value_;
100 
101 
102  // Controls, tracing etc.
103 
104  //- Internal bookkeeping as "look-behind" parsing context
105  mutable int stashedTokenId_;
106 
107  //- Request debugging for scanner
108  bool debugScanner_;
109 
110  //- Request debugging for parser
111  bool debugParser_;
112 
113  //- Allow variable names to mask field names
114  bool allowShadowing_;
115 
116  //- Use value of previous iteration when oldTime is requested
117  bool prevIterIsOldTime_;
118 
119  //- Keep fields read from disc in memory
120  bool cacheReadFields_;
121 
122  //- Search in registry before looking on disk
123  bool searchInMemory_;
124 
125  //- Search on disk (eg, for a standalone application)
126  bool searchFiles_;
127 
128 
129  // Protected Member Functions
130 
131  //- Read an interpolation table
132  template<typename TableType>
133  static bool readTable
134  (
135  const word& name,
136  const dictionary& dict,
138  bool clear=true
139  );
140 
141  //- Write an interpolation table
142  template<class TableType>
143  static void writeTable
144  (
145  Ostream& os,
146  const word& name,
147  const HashTable<TableType>& tbl
148  );
149 
150 
151  // Variables
152 
153  //- Non-const access to the named variable (sub-classes only)
154  inline virtual exprResult& variable(const word& name);
155 
156 
157  // Fields
158 
159  //- Fill a random field
160  //
161  // \param field the field to populate
162  // \param seed the seed value.
163  // \param gaussian generate a Gaussian distribution
164  void fill_random
165  (
167  label seed = 0,
168  const bool gaussian = false
169  ) const;
170 
171  //- The (global) weighted average of a field, with stabilisation
172  template<class Type>
173  static Type weightedAverage
174  (
175  const scalarField& weights,
176  const Field<Type>& fld
177  );
178 
179  //- The (global) weighted sum (integral) of a field
180  template<class Type>
181  static Type weightedSum
182  (
183  const scalarField& weights,
184  const Field<Type>& fld
185  );
186 
187  //- Return the location of the min value
189  (
190  const scalarField& vals,
191  const pointField& locs
192  );
193 
194  //- Return the location of the max value
196  (
197  const scalarField& vals,
198  const pointField& locs
199  );
200 
201 
202  // Updating
203 
204  //- Update things
205  virtual bool update();
206 
207  //- Examine current variable values and update stored variables
208  virtual void updateSpecialVariables(bool force=false);
209 
210 
211  // Results
212 
213  //- Get the result from another driver.
214  // Override to allow mapping
215  virtual exprResult getRemoteResult(const exprDriver& other) const;
216 
217 
218  //- No copy assignment
219  void operator=(const exprDriver&) = delete;
220 
221 
222 public:
223 
224  //- Runtime type information
225  TypeName("exprDriver");
226 
227 
228  // Constructors
229 
230  //- Null constructor, and null construct with search preferences
231  explicit exprDriver
232  (
233  bool cacheReadFields = false,
234  bool searchInMemory = true,
235  bool searchFiles = false,
237  );
238 
239  //- Copy construct
240  exprDriver(const exprDriver&);
241 
242  //- Construct from a dictionary
243  explicit exprDriver(const dictionary& dict);
244 
245 
246  //- Destructor
247  virtual ~exprDriver() = default;
248 
249 
250  // Public Member Functions
251 
252  //- The underlying field size for the expression
253  virtual label size() const
254  {
255  return 1;
256  }
257 
258  //- The underlying point field size for the expression
259  virtual label pointSize() const
260  {
261  return 1;
262  }
263 
264  //- The dictionary with all input data/specification
265  const dictionary& dict() const
266  {
267  return dict_;
268  }
269 
270  //- Const access to expression result
271  virtual const exprResult& result() const
272  {
273  return result_;
274  }
275 
276  //- Non-const access to expression result
277  virtual exprResult& result()
278  {
279  return result_;
280  }
281 
282  //- Clear the result
283  void clearResult();
284 
285  //- Return the expression result as a tmp field
286  template<class Type>
287  tmp<Field<Type>> getResult(bool wantPointData=false);
288 
289  //- The result type as word - same as result().valueType()
290  virtual word getResultType() const
291  {
292  return result_.valueType();
293  }
294 
295 
296  // Globals, Mesh Related
297 
298  //- Set special-purpose scalar reference argument.
299  // Typically available as \c arg() in an expression and
300  // may corrspond to table index, time value etc.
301  scalar argValue() const;
302 
303 
304  // General Controls
305 
306  //- Get "look-behind" parsing context (internal bookkeeping)
307  inline int stashedTokenId() const;
308 
309  //- Reset "look-behind" parsing context (mutable operation)
310  // \return the previous value
311  inline int resetStashedTokenId(int tokenId=0) const;
312 
313 
314  //- Set the scanner/parser debug
315  void setDebugging(bool scannerDebug, bool parserDebug);
316 
317  //- Set the scanner/parser debug to match the input
318  void setDebugging(const exprDriver& rhs);
319 
320  //- Set search behaviour
321  void setSearchBehaviour
322  (
323  bool cacheReadFields,
325  bool searchFiles
326  );
327 
328  //- Set search behaviour to be identical to rhs
329  void setSearchBehaviour(const exprDriver& rhs);
330 
331  //- Read access to scanner debug
332  bool debugScanner() const { return debugScanner_; }
333 
334  //- Read access to parser debug
335  bool debugParser() const { return debugParser_; }
336 
337  bool cacheReadFields() const { return cacheReadFields_; }
338  bool searchInMemory() const { return searchInMemory_; }
339  bool searchFiles() const { return searchFiles_; }
340  bool prevIterIsOldTime() const { return prevIterIsOldTime_; }
341 
342 
343  // Variables
344 
345  //- Clear temporary variables and resets from expression strings
346  virtual void clearVariables();
347 
348  //- Set special-purpose scalar reference argument.
349  // Typically available as \c arg() in an expression and
350  // may corrspond to table index, time value etc.
351  virtual void setArgument(const scalar val);
352 
353  //- True if named variable exists
354  inline virtual bool hasVariable(const word& name) const;
355 
356  //- Return const-access to the named variable
357  inline virtual const exprResult& variable(const word& name) const;
358 
359  //- Add/set string expressions for variables
360  // Can include multiple definitions inline
361  void addVariables
362  (
363  const expressions::exprString& expr,
364  bool clear = true
365  );
366 
367  //- Add/set string expressions for variables
368  // Can include multiple definitions inline
370  (
372  bool clear = true
373  );
374 
375  //- Add a uniform variable from an outside caller
376  template<class T>
377  inline void addUniformVariable
378  (
379  const word& name,
380  const T& val
381  );
382 
383 
384  // Fields
385 
386  //- Test existence of a local variable
387  template<class T>
388  bool isLocalVariable
389  (
390  const word& name,
391  bool wantPointData = false,
392  label expectedSize = -1
393  ) const;
394 
395  //- Retrieve local/global variable as a tmp field
396  //
397  // \param name The name of the local/global field
398  // \param expectSize The size check on the variable, -1 to ignore
399  // \param mandatory A missing variable is Fatal, or return
400  // an invalid tmp
401  template<class Type>
403  (
404  const word& name,
405  label expectSize,
406  const bool mandatory = true
407  ) const;
408 
409 
410  // Evaluation
411 
412  //- Execute the parser.
413  // The return value currently has no meaning.
414  virtual unsigned parse
415  (
416  const std::string& expr,
417  size_t pos = 0,
418  size_t len = std::string::npos
419  ) = 0;
420 
421  //- Evaluate the expression and return the field
422  template<class Type>
423  inline tmp<Field<Type>>
424  evaluate
425  (
426  const expressions::exprString& expr,
427  bool wantPointData = false
428  );
429 
430  //- Evaluate the expression and return a single value
431  template<class Type>
432  inline Type evaluateUniform
433  (
434  const expressions::exprString& expr,
435  bool wantPointData = false
436  );
437 
438 
439  //- Evaluate the expression
440  //- and save as the specified named variable
441  void evaluateVariable
442  (
443  const word& varName,
444  const expressions::exprString& expr
445  );
446 
447  //- Evaluate an expression on a remote
448  //- and save as the specified named variable
449  virtual void evaluateVariableRemote
450  (
451  string remote,
452  const word& varName,
453  const expressions::exprString& expr
454  );
455 
456 
457  // Fields
458 
459  //- Return a new field with the size()
460  template<class Type>
462  newField(const Type& val = pTraits<Type>::zero) const;
463 
464  //- Return a new field with the pointSize()
465  template<class Type>
467  newPointField(const Type& val = pTraits<Type>::zero) const;
468 
469 
470  // Reading
471 
472  //- Read an expression string and do substitutions
474  (
475  const word& name,
476  const dictionary& dict
477  );
478 
479  //- Read the list of variable strings
480  // (or initialize with a single string)
482  (
483  const dictionary& dict,
484  const word& name = "variables",
485  bool mandatory = false
486  );
487 
488  //- Read an expression string (with the current dictionary)
489  //- and do substitutions
491 
492 
493  //- Read variables, tables etc.
494  // Also usable for objects not constructed from a dictionary.
495  virtual bool readDict(const dictionary& dict);
496 
497  //- Read "variables" and assigns to the list of expression strings
498  // \return the number variable strings read.
499  label setVariableStrings
500  (
501  const dictionary& dict,
502  bool mandatory = false
503  );
504 
505 
506  // Writing
507 
508  //- Write "variables"
510  (
511  Ostream& os,
512  const word& keyword = ""
513  ) const;
514 };
515 
516 
517 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
518 
519 } // End namespace expressions
520 } // End namespace Foam
521 
522 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
523 
524 #include "exprDriverI.H"
525 
526 #ifdef NoRepository
527  #include "exprDriverTemplates.C"
528 #endif
529 
530 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
531 
532 #endif
533 
534 // ************************************************************************* //
Foam::expressions::exprDriver::updateSpecialVariables
virtual void updateSpecialVariables(bool force=false)
Examine current variable values and update stored variables.
Definition: exprDriver.C:188
Foam::expressions::exprDriver::stashedTokenId
int stashedTokenId() const
Get "look-behind" parsing context (internal bookkeeping)
Definition: exprDriverI.H:104
Foam::expressions::exprDriver::prevIterIsOldTime_
bool prevIterIsOldTime_
Use value of previous iteration when oldTime is requested.
Definition: exprDriver.H:151
Foam::expressions::exprDriver::~exprDriver
virtual ~exprDriver()=default
Destructor.
Foam::expressions::exprDriver::debugParser_
bool debugParser_
Request debugging for parser.
Definition: exprDriver.H:145
Foam::expressions::exprDriver::addVariables
void addVariables(const expressions::exprString &expr, bool clear=true)
Add/set string expressions for variables.
Definition: exprDriver.C:252
Foam::expressions::exprDriver::readExpression
static expressions::exprString readExpression(const word &name, const dictionary &dict)
Read an expression string and do substitutions.
Definition: exprDriverIO.C:75
Foam::expressions::exprDriver::searchInMemory_
bool searchInMemory_
Search in registry before looking on disk.
Definition: exprDriver.H:157
Foam::expressions::exprDriver::evaluateUniform
Type evaluateUniform(const expressions::exprString &expr, bool wantPointData=false)
Evaluate the expression and return a single value.
Definition: exprDriverI.H:90
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::expressions::exprDriver::parse
virtual unsigned parse(const std::string &expr, size_t pos=0, size_t len=std::string::npos)=0
Execute the parser.
exprString.H
Foam::expressions::exprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: exprDriver.C:158
Foam::expressions::exprDriver::setSearchBehaviour
void setSearchBehaviour(bool cacheReadFields, bool searchInMemory, bool searchFiles)
Set search behaviour.
Definition: exprDriver.C:387
Foam::expressions::exprResult::valueType
const word & valueType() const
Basic type for the field or single value.
Definition: exprResultI.H:243
Foam::expressions::exprDriver::getResult
tmp< Field< Type > > getResult(bool wantPointData=false)
Return the expression result as a tmp field.
Foam::expressions::exprDriver::newField
tmp< Field< Type > > newField(const Type &val=pTraits< Type >::zero) const
Return a new field with the size()
Foam::expressions::exprDriver::searchFiles_
bool searchFiles_
Search on disk (eg, for a standalone application)
Definition: exprDriver.H:160
Foam::expressions::exprDriver::operator=
void operator=(const exprDriver &)=delete
No copy assignment.
Foam::expressions::exprDriver::evaluateVariable
void evaluateVariable(const word &varName, const expressions::exprString &expr)
Definition: exprDriver.C:212
Foam::expressions::exprDriver::getLocalVariable
tmp< Field< Type > > getLocalVariable(const word &name, label expectSize, const bool mandatory=true) const
Retrieve local/global variable as a tmp field.
Foam::expressions::exprDriver::getResultType
virtual word getResultType() const
The result type as word - same as result().valueType()
Definition: exprDriver.H:324
Foam::expressions::exprDriver::getPositionOfMaximum
static point getPositionOfMaximum(const scalarField &vals, const pointField &locs)
Return the location of the max value.
Definition: exprDriverFields.C:65
Foam::expressions::exprDriver::resetStashedTokenId
int resetStashedTokenId(int tokenId=0) const
Reset "look-behind" parsing context (mutable operation)
Definition: exprDriverI.H:111
Foam::expressions::exprDriver::debugScanner_
bool debugScanner_
Request debugging for scanner.
Definition: exprDriver.H:142
Foam::expressions::exprDriver::dict_
const dictionary & dict_
The dictionary with all input data/specification.
Definition: exprDriver.H:121
Foam::expressions::exprDriver::setDebugging
void setDebugging(bool scannerDebug, bool parserDebug)
Set the scanner/parser debug.
Definition: exprDriver.C:366
Foam::expressions::exprDriver::readVariableStrings
static List< expressions::exprString > readVariableStrings(const dictionary &dict, const word &name="variables", bool mandatory=false)
Read the list of variable strings.
Definition: exprDriverIO.C:96
Foam::expressions::exprDriver::searchInMemory
bool searchInMemory() const
Definition: exprDriver.H:372
Foam::expressions::exprDriver::allowShadowing_
bool allowShadowing_
Allow variable names to mask field names.
Definition: exprDriver.H:148
Foam::expressions::exprDriver::pointSize
virtual label pointSize() const
The underlying point field size for the expression.
Definition: exprDriver.H:293
primitiveFields.H
Specialisations of Field<T> for scalar, vector and tensor.
Foam::expressions::exprDriver::setArgument
virtual void setArgument(const scalar val)
Set special-purpose scalar reference argument.
Definition: exprDriver.C:199
Foam::expressions::exprDriver::searchFiles
bool searchFiles() const
Definition: exprDriver.H:373
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
Foam::expressions::exprDriver::getPositionOfMinimum
static point getPositionOfMinimum(const scalarField &vals, const pointField &locs)
Return the location of the min value.
Definition: exprDriverFields.C:55
Foam::expressions::exprDriver::TypeName
TypeName("exprDriver")
Runtime type information.
Foam::expressions::exprDriver::hasVariable
virtual bool hasVariable(const word &name) const
True if named variable exists.
Definition: exprDriverI.H:32
Foam::expressions::exprDriver::cacheReadFields
bool cacheReadFields() const
Definition: exprDriver.H:371
Foam::expressions::exprDriver::newPointField
tmp< Field< Type > > newPointField(const Type &val=pTraits< Type >::zero) const
Return a new field with the pointSize()
Foam::expressions::exprDriver::getRemoteResult
virtual exprResult getRemoteResult(const exprDriver &other) const
Get the result from another driver.
Definition: exprDriver.C:242
Foam::expressions::exprResult
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:128
Foam::Field< scalar >
Foam::expressions::exprDriver::setVariableStrings
label setVariableStrings(const dictionary &dict, bool mandatory=false)
Read "variables" and assigns to the list of expression strings.
Definition: exprDriverIO.C:107
Foam::expressions::exprDriver::weightedAverage
static Type weightedAverage(const scalarField &weights, const Field< Type > &fld)
The (global) weighted average of a field, with stabilisation.
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::expressions::exprDriver::result
virtual exprResult & result()
Non-const access to expression result.
Definition: exprDriver.H:311
Foam::expressions::exprDriver::addUniformVariable
void addUniformVariable(const word &name, const T &val)
Add a uniform variable from an outside caller.
Foam::expressions::exprDriver::variables_
HashTable< exprResult > variables_
The variables table.
Definition: exprDriver.H:130
Foam::expressions::exprDriver
Base driver for parsing (field) values.
Definition: exprDriver.H:112
Foam::expressions::exprDriver::arg1Value_
scalar arg1Value_
Special-purpose scalar reference argument.
Definition: exprDriver.H:133
field
rDeltaTY field()
Foam::expressions::exprDriver::prevIterIsOldTime
bool prevIterIsOldTime() const
Definition: exprDriver.H:374
Foam::expressions::exprDriver::fill_random
void fill_random(scalarField &field, label seed=0, const bool gaussian=false) const
Fill a random field.
Definition: exprDriverFields.C:35
Foam::expressions::exprDriver::debugParser
bool debugParser() const
Read access to parser debug.
Definition: exprDriver.H:369
fld
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< ' ';}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< ' ';}gmvFile<< nl;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Definition: gmvOutputLagrangian.H:23
Foam::expressions::exprDriver::isLocalVariable
bool isLocalVariable(const word &name, bool wantPointData=false, label expectedSize=-1) const
Test existence of a local variable.
Definition: exprDriverTemplates.C:167
Foam::expressions::exprDriver::variable
virtual exprResult & variable(const word &name)
Non-const access to the named variable (sub-classes only)
Definition: exprDriverI.H:52
Foam::expressions::exprDriver::debugScanner
bool debugScanner() const
Read access to scanner debug.
Definition: exprDriver.H:366
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::expressions::exprDriver::stashedTokenId_
int stashedTokenId_
Internal bookkeeping as "look-behind" parsing context.
Definition: exprDriver.H:139
Foam::expressions::exprDriver::clearVariables
virtual void clearVariables()
Clear temporary variables and resets from expression strings.
Definition: exprDriver.C:192
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::exprDriver::writeTable
static void writeTable(Ostream &os, const word &name, const HashTable< TableType > &tbl)
Write an interpolation table.
Definition: exprDriverTemplates.C:64
Foam::expressions::exprDriver::readTable
static bool readTable(const word &name, const dictionary &dict, HashTable< TableType > &tbl, bool clear=true)
Read an interpolation table.
Definition: exprDriverTemplates.C:33
Foam::expressions::exprDriver::exprDriver
exprDriver(bool cacheReadFields=false, bool searchInMemory=true, bool searchFiles=false, const dictionary &dict=dictionary::null)
Null constructor, and null construct with search preferences.
Definition: exprDriver.C:84
Foam::expressions::exprDriver::cacheReadFields_
bool cacheReadFields_
Keep fields read from disc in memory.
Definition: exprDriver.H:154
Foam::expressions::exprDriver::variableStrings_
List< expressions::exprString > variableStrings_
Variable definitions, as read from a dictionary.
Definition: exprDriver.H:127
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
pointField.H
Foam::expressions::exprDriver::argValue
scalar argValue() const
Set special-purpose scalar reference argument.
Definition: exprDriver.C:205
Foam::expressions::exprDriver::dict
const dictionary & dict() const
The dictionary with all input data/specification.
Definition: exprDriver.H:299
clear
patchWriters clear()
Foam::Vector< scalar >
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
Foam::expressions::exprDriver::evaluate
tmp< Field< Type > > evaluate(const expressions::exprString &expr, bool wantPointData=false)
Evaluate the expression and return the field.
Foam::expressions::exprDriver::result
virtual const exprResult & result() const
Const access to expression result.
Definition: exprDriver.H:305
Foam::expressions::exprString
Definition: exprString.H:60
Foam::expressions::exprDriver::writeVariableStrings
Ostream & writeVariableStrings(Ostream &os, const word &keyword="") const
Write "variables".
Definition: exprDriverIO.C:119
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
exprDriverTemplates.C
Foam::expressions::exprDriver::evaluateVariableRemote
virtual void evaluateVariableRemote(string remote, const word &varName, const expressions::exprString &expr)
Definition: exprDriver.C:230
Foam::expressions::exprDriver::clearResult
void clearResult()
Clear the result.
Definition: exprDriver.C:176
Foam::expressions::exprDriver::size
virtual label size() const
The underlying field size for the expression.
Definition: exprDriver.H:287
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
exprDriverI.H
Foam::expressions::exprDriver::weightedSum
static Type weightedSum(const scalarField &weights, const Field< Type > &fld)
The (global) weighted sum (integral) of a field.
exprResult.H
Foam::expressions::exprDriver::update
virtual bool update()
Update things.
Definition: exprDriver.C:182
Foam::expressions::exprDriver::result_
exprResult result_
The result.
Definition: exprDriver.H:124
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177