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  Original code Copyright (C) 2010-2018 Bernhard Gschaider
9  Copyright (C) 2019 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  // Private 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 
99  // Controls, tracing etc.
100 
101  //- Internal bookkeeping as "look-behind" parsing context
102  mutable int stashedTokenId_;
103 
104  //- Request debugging for scanner
105  bool debugScanner_;
106 
107  //- Request debugging for parser
108  bool debugParser_;
109 
110  //- Allow variable names to mask field names
111  bool allowShadowing_;
112 
113  //- Use value of previous iteration when oldTime is requested
114  bool prevIterIsOldTime_;
115 
116  //- Keep fields read from disc in memory
117  bool cacheReadFields_;
118 
119  //- Search in registry before looking on disk
120  bool searchInMemory_;
121 
122  //- Search on disk (eg, for a standalone application)
123  bool searchFiles_;
124 
125 
126 protected:
127 
128  // Protected Member Functions
129 
130  //- Read an interpolation table
131  template<typename TableType>
132  static bool readTable
133  (
134  const word& name,
135  const dictionary& dict,
137  bool clear=true
138  );
139 
140  //- Write an interpolation table
141  template<class TableType>
142  static void writeTable
143  (
144  Ostream& os,
145  const word& name,
146  const HashTable<TableType>& tbl
147  );
148 
149 
150  // Variables
151 
152  //- Non-const access to the named variable (sub-classes only)
153  inline virtual exprResult& variable(const word& name);
154 
155 
156  // Fields
157 
158  //- Fill a random field
159  //
160  // \param field the field to populate
161  // \param seed the seed value.
162  // \param gaussian generate a Gaussian distribution
163  void fill_random
164  (
166  label seed = 0,
167  const bool gaussian = false
168  ) const;
169 
170  //- The (global) weighted average of a field, with stabilisation
171  template<class Type>
172  static Type weightedAverage
173  (
174  const scalarField& weights,
175  const Field<Type>& fld
176  );
177 
178  //- The (global) weighted sum (integral) of a field
179  template<class Type>
180  static Type weightedSum
181  (
182  const scalarField& weights,
183  const Field<Type>& fld
184  );
185 
186  //- Return the location of the min value
188  (
189  const scalarField& vals,
190  const pointField& locs
191  );
192 
193  //- Return the location of the max value
195  (
196  const scalarField& vals,
197  const pointField& locs
198  );
199 
200 
201  // Updating
202 
203  //- Update things
204  virtual bool update();
205 
206  //- Examine current variable values and update stored variables
207  virtual void updateSpecialVariables(bool force=false);
208 
209 
210  // Results
211 
212  //- Get the result from another driver.
213  // Override to allow mapping
214  virtual exprResult getRemoteResult(const exprDriver& other) const;
215 
216 
217  //- No copy assignment
218  void operator=(const exprDriver&) = delete;
219 
220 
221 public:
222 
223  //- Runtime type information
224  TypeName("exprDriver");
225 
226 
227  // Constructors
228 
229  //- Null constructor, and null construct with search preferences
230  explicit exprDriver
231  (
232  bool cacheReadFields = false,
233  bool searchInMemory = true,
234  bool searchFiles = false,
236  );
237 
238  //- Copy construct
239  exprDriver(const exprDriver&);
240 
241  //- Construct from a dictionary
242  explicit exprDriver(const dictionary& dict);
243 
244 
245  //- Destructor
246  virtual ~exprDriver() = default;
247 
248 
249  // Public Member Functions
250 
251  //- The underlying field size for the expression
252  virtual label size() const
253  {
254  return 1;
255  }
256 
257  //- The underlying point field size for the expression
258  virtual label pointSize() const
259  {
260  return 1;
261  }
262 
263  //- The dictionary with all input data/specification
264  const dictionary& dict() const
265  {
266  return dict_;
267  }
268 
269  //- Const access to expression result
270  virtual const exprResult& result() const
271  {
272  return result_;
273  }
274 
275  //- Non-const access to expression result
276  virtual exprResult& result()
277  {
278  return result_;
279  }
280 
281  //- Clear the result
282  void clearResult();
283 
284  //- Return the expression result as a tmp field
285  template<class Type>
286  tmp<Field<Type>> getResult(bool isPointVal=false);
287 
288  //- The result type as word - same as result().valueType()
289  virtual word getResultType() const
290  {
291  return result_.valueType();
292  }
293 
294 
295  // General Controls
296 
297  //- Get "look-behind" parsing context (internal bookkeeping)
298  inline int stashedTokenId() const;
299 
300  //- Reset "look-behind" parsing context (mutable operation)
301  // \return the previous value
302  inline int resetStashedTokenId(int tokenId=0) const;
303 
304 
305  //- Set the scanner/parser debug
306  void setDebugging(bool scannerDebug, bool parserDebug);
307 
308  //- Set the scanner/parser debug to match the input
309  void setDebugging(const exprDriver& rhs);
310 
311  //- Set search behaviour
312  void setSearchBehaviour
313  (
314  bool cacheReadFields,
315  bool searchInMemory,
316  bool searchFiles
317  );
318 
319  //- Set search behaviour to be identical to rhs
320  void setSearchBehaviour(const exprDriver& rhs);
321 
322  //- Read access to scanner debug
323  bool debugScanner() const { return debugScanner_; }
324 
325  //- Read access to parser debug
326  bool debugParser() const { return debugParser_; }
327 
328  bool cacheReadFields() const { return cacheReadFields_; }
329  bool searchInMemory() const { return searchInMemory_; }
330  bool searchFiles() const { return searchFiles_; }
331  bool prevIterIsOldTime() const { return prevIterIsOldTime_; }
332 
333 
334  // Variables
335 
336  //- Clear temporary variables and resets from expression strings
337  virtual void clearVariables();
338 
339  //- True if named variable exists
340  inline virtual bool hasVariable(const word& name) const;
341 
342  //- Return const-access to the named variable
343  inline virtual const exprResult& variable(const word& name) const;
344 
345  //- Add/set string expressions for variables
346  // Can include multiple definitions inline
347  void addVariables
348  (
349  const expressions::exprString& expr,
350  bool clear = true
351  );
352 
353  //- Add/set string expressions for variables
354  // Can include multiple definitions inline
355  void addVariables
356  (
358  bool clear = true
359  );
360 
361  //- Add a uniform variable from an outside caller
362  template<class T>
363  inline void addUniformVariable
364  (
365  const word& name,
366  const T& val
367  );
368 
369 
370  // Fields
371 
372  //- Test existence of a local variable
373  template<class T>
374  bool isLocalVariable
375  (
376  const word& name,
377  bool isPointVal,
378  label expectedSize = -1
379  ) const;
380 
381  //- Retrieve local/global variable as a tmp field
382  //
383  // \param name The name of the local/global field
384  // \param expectSize The size check on the variable, -1 to ignore
385  // \param mandatory A missing variable is Fatal, or return
386  // an invalid tmp
387  template<class Type>
389  (
390  const word& name,
391  label expectSize,
392  const bool mandatory = true
393  ) const;
394 
395 
396  // Evaluation
397 
398  //- Execute the parser.
399  // The return value currently has no meaning.
400  virtual unsigned parse
401  (
402  const std::string& expr,
403  size_t pos = 0,
404  size_t len = std::string::npos
405  ) = 0;
406 
407  //- Evaluate the expression and return the field
408  template<class Type>
409  inline tmp<Field<Type>>
410  evaluate
411  (
412  const expressions::exprString& expr,
413  bool isPointVal = false
414  );
415 
416  //- Evaluate the expression and return a single value
417  template<class Type>
418  inline Type evaluateUniform
419  (
420  const expressions::exprString& expr,
421  bool isPointVal = false
422  );
423 
424 
425  //- Evaluate the expression
426  //- and save as the specified named variable
427  void evaluateVariable
428  (
429  const word& varName,
430  const expressions::exprString& expr
431  );
432 
433  //- Evaluate an expression on a remote
434  //- and save as the specified named variable
435  virtual void evaluateVariableRemote
436  (
437  string remote,
438  const word& varName,
439  const expressions::exprString& expr
440  );
441 
442 
443  // Fields
444 
445  //- Return a new field with the size()
446  template<class Type>
448  newField(const Type& val = pTraits<Type>::zero) const;
449 
450  //- Return a new field with the pointSize()
451  template<class Type>
453  newPointField(const Type& val = pTraits<Type>::zero) const;
454 
455 
456  // Reading
457 
458  //- Read an expression string and do substitutions
460  (
461  const word& name,
462  const dictionary& dict
463  );
464 
465  //- Read the list of variable strings
466  // (or initialize with a single string)
468  (
469  const dictionary& dict,
470  const word& name = "variables",
471  bool mandatory = false
472  );
473 
474  //- Read an expression string (with the current dictionary)
475  //- and do substitutions
477 
478 
479  //- Read variables, tables etc.
480  // Also usable for objects not constructed from a dictionary.
481  virtual bool readDict(const dictionary& dict);
482 
483  //- Read "variables" and assigns to the list of expression strings
484  // \return the number variable strings read.
486  (
487  const dictionary& dict,
488  bool mandatory = false
489  );
490 
491 
492  // Writing
493 
494  //- Write "variables"
496  (
497  Ostream& os,
498  const word& keyword = ""
499  ) const;
500 };
501 
502 
503 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
504 
505 } // End namespace expressions
506 } // End namespace Foam
507 
508 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
509 
510 #include "exprDriverI.H"
511 
512 #ifdef NoRepository
513  #include "exprDriverTemplates.C"
514 #endif
515 
516 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
517 
518 #endif
519 
520 // ************************************************************************* //
Foam::expressions::exprDriver::updateSpecialVariables
virtual void updateSpecialVariables(bool force=false)
Examine current variable values and update stored variables.
Definition: exprDriver.C:186
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:148
Foam::expressions::exprDriver::~exprDriver
virtual ~exprDriver()=default
Destructor.
Foam::val
label ListType::const_reference val
Definition: ListOps.H:407
Foam::expressions::exprDriver::debugParser_
bool debugParser_
Request debugging for parser.
Definition: exprDriver.H:142
Foam::expressions::exprDriver::addVariables
void addVariables(const expressions::exprString &expr, bool clear=true)
Add/set string expressions for variables.
Definition: exprDriver.C:238
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:154
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::expressions::exprDriver::isLocalVariable
bool isLocalVariable(const word &name, bool isPointVal, label expectedSize=-1) const
Test existence of a local variable.
Definition: exprDriverTemplates.C:167
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
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:156
Foam::expressions::exprDriver::setSearchBehaviour
void setSearchBehaviour(bool cacheReadFields, bool searchInMemory, bool searchFiles)
Set search behaviour.
Definition: exprDriver.C:373
Foam::expressions::exprResult::valueType
const word & valueType() const
Basic type for the field or single value.
Definition: exprResultI.H:250
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:157
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:198
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:323
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:139
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:352
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:363
Foam::expressions::exprDriver::allowShadowing_
bool allowShadowing_
Allow variable names to mask field names.
Definition: exprDriver.H:145
Foam::expressions::exprDriver::pointSize
virtual label pointSize() const
The underlying point field size for the expression.
Definition: exprDriver.H:292
primitiveFields.H
Specialisations of Field<T> for scalar, vector and tensor.
Foam::expressions::exprDriver::searchFiles
bool searchFiles() const
Definition: exprDriver.H:364
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:362
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:228
Foam::expressions::exprDriver::getResult
tmp< Field< Type > > getResult(bool isPointVal=false)
Return the expression result as a tmp field.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
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:310
Foam::expressions::exprDriver::addUniformVariable
void addUniformVariable(const word &name, const T &val)
Add a uniform variable from an outside caller.
Foam::expressions::exprDriver::evaluateUniform
Type evaluateUniform(const expressions::exprString &expr, bool isPointVal=false)
Evaluate the expression and return a single value.
Definition: exprDriverI.H:90
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
field
rDeltaTY field()
Foam::expressions::exprDriver::prevIterIsOldTime
bool prevIterIsOldTime() const
Definition: exprDriver.H:365
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:360
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::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:357
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:136
Foam::expressions::exprDriver::clearVariables
virtual void clearVariables()
Clear temporary variables and resets from expression strings.
Definition: exprDriver.C:190
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:151
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::dict
const dictionary & dict() const
The dictionary with all input data/specification.
Definition: exprDriver.H:298
Foam::expressions::exprDriver::evaluate
tmp< Field< Type > > evaluate(const expressions::exprString &expr, bool isPointVal=false)
Evaluate the expression and return the field.
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: HashTable.H:102
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:52
Foam::expressions::exprDriver::result
virtual const exprResult & result() const
Const access to expression result.
Definition: exprDriver.H:304
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:216
Foam::expressions::exprDriver::clearResult
void clearResult()
Clear the result.
Definition: exprDriver.C:174
Foam::expressions::exprDriver::size
virtual label size() const
The underlying field size for the expression.
Definition: exprDriver.H:286
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:180
Foam::expressions::exprDriver::result_
exprResult result_
The result.
Definition: exprDriver.H:124
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177