fvExprDriver.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::fvExprDriver
29 
30 Description
31  Base driver for parsing value expressions associated with an fvMesh.
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  delayedVariables | List of delayed variables | no | ()
40  storedVariables | List of stored variables | no | ()
41  globalScopes | Scopes for global variables | no | ()
42  allowShadowing | Allow variables to shadow field names | no | false
43  \endtable
44 
45  Debug Properties
46  \table
47  Property | Description | Required | Default
48  debugBaseDriver | Debug level (int) for base driver | no |
49  debugScanner | Add debug for scanner | no | false
50  debugParser | Add debug for parser | no | false
51  \endtable
52 
53 SourceFiles
54  fvExprDriverI.H
55  fvExprDriver.C
56  fvExprDriverFields.C
57  fvExprDriverIO.C
58  fvExprDriverNew.C
59  fvExprDriverTemplates.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef expressions_fvExprDriver_H
64 #define expressions_fvExprDriver_H
65 
66 #include "exprDriver.H"
67 #include "exprResultDelayed.H"
68 #include "exprResultStored.H"
69 #include "pointMesh.H"
70 #include "volFields.H"
71 #include "topoSetSource.H"
72 #include "runTimeSelectionTables.H"
73 
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 
76 namespace Foam
77 {
78 namespace expressions
79 {
80 
81 // Forward Declarations
82 class exprDriverWriter;
83 
84 /*---------------------------------------------------------------------------*\
85  Class fvExprDriver Declaration
86 \*---------------------------------------------------------------------------*/
87 
88 class fvExprDriver
89 :
90  public expressions::exprDriver
91 {
92  // Static Data
93 
94  //- Pointer to the "default" mesh
95  static const fvMesh *defaultMeshPtr_;
96 
97  //- Cache cellSets, faceSets instead of reading from disc each time
98  static bool cacheSets_;
99 
100 
101  // Private Data
102 
103  // Stored Data
104 
105  //- The scopes for global variables
106  List<word> globalScopes_;
107 
108  //- The (delayed) variables table
109  HashTable<exprResultDelayed> delayedVariables_;
110 
111  //- Stored expressions. Read from dictionary and updated as required
112  List<exprResultStored> storedVariables_;
113 
114  //- Time index when handling special variables
115  label specialVariablesIndex_;
116 
117  //- The name of the other mesh (if it is to be required)
118  word otherMeshName_;
119 
120  //- Writing and restoring
121  autoPtr<exprDriverWriter> writer_;
122 
123 
124  // Private Member Functions
125 
126  //- Read the IOobject and return the headerClassName
127  static word getHeaderClassName
128  (
129  const polyMesh& mesh,
130  const word& name
131  );
132 
133  //- Read the set IOobject and return its headerClassName
134  static word getSetClassName
135  (
136  const polyMesh& mesh,
137  const word& name
138  );
139 
140 
141  //- No copy assignment
142  void operator=(const fvExprDriver&) = delete;
143 
144 
145 protected:
146 
147  // Static Member Functions
148 
149  //- Determine mesh or region mesh as specified in the dictionary
150  //- with the keyword "region"
151  static const fvMesh& regionMesh
152  (
153  const dictionary& dict,
154  const fvMesh& mesh,
155  bool readIfNecessary
156  );
157 
158  //- Default boundary type is calculated
159  template<class T>
160  static inline word defaultBoundaryType(const T&)
161  {
162  return "calculated";
163  }
164 
165  //- Default boundary type for volume fields is zeroGradient
166  //- since they are essentially just internal fields.
167  template<class Type>
168  static inline word defaultBoundaryType
169  (
171  )
172  {
173  return "zeroGradient";
174  }
175 
176 
177  //- Apply correctBoundaryConditions (volume fields only)
178  template<class T>
179  static inline void correctField(T&) {}
180 
181  template<class Type>
182  static inline void correctField
183  (
184  GeometricField<Type, fvPatchField, volMesh>& fld
185  )
186  {
187  fld.correctBoundaryConditions();
188  }
189 
190 
191  // Protected Member Functions
192 
193  // Mesh related
194 
195  //- The mesh we are attached to
196  virtual const fvMesh& mesh() const = 0;
197 
198 
199  // Variables
200 
201  //- Define scopes for global variables
202  void setGlobalScopes(const wordUList& scopes)
203  {
204  globalScopes_ = scopes;
205  }
206 
207  //- Non-const access to the named variable (sub-classes only)
208  inline virtual exprResult& variable(const word& name);
209 
210  //- Test existence of a global variable
211  template<class T>
212  bool isGlobalVariable
213  (
214  const word& name,
215  const bool wantPointData = false,
216  const label expectedSize = -1
217  ) const;
218 
219  //- Return the global variable if available or a null result
220  const exprResult& lookupGlobal(const word& name) const;
221 
222 
223  // Fields
224 
225  //- Test for the existence of a mesh field
226  template<class Type>
227  bool isField
228  (
229  const word& name,
230  const bool wantPointData = false,
231  const label expectSize = -1
232  ) const;
233 
234 
235  //- Retrieve field from memory or disk
236  template<class GeomField>
238  (
239  const word& name,
240  const bool mandatory = true,
241  const bool getOldTime = false
242  );
243 
244  //- Retrieve point field from memory or disk
245  template<class GeomField>
247  (
248  const word& name,
249  const bool mandatory = true,
250  const bool getOldTime = false
251  );
252 
253  //- Retrieve field from memory or disk (implementation)
254  template<class GeomField, class MeshRef>
256  (
257  const word& name,
258  const MeshRef& meshRef,
259  const bool mandatory = true,
260  const bool getOldTime = false
261  );
262 
263  //- Helper function for getOrReadField
264  template<class GeomField, class MeshRef>
266  (
267  const word& name,
268  const MeshRef& meshRef
269  );
270 
271  //- Create a random field
272  //
273  // \param field the field to populate
274  // \param seed the seed value. If zero or negative, use as an offset
275  // to the current timeIndex
276  // \param gaussian generate a Gaussian distribution
277  void fill_random
278  (
280  label seed = 0,
281  const bool gaussian = false
282  ) const;
283 
284 
285  // Sets
286 
287  //- The origin of the topoSet
288  enum SetOrigin { INVALID = 0, NEW, FILE, MEMORY, CACHE };
289 
290  //- Get topoSet
291  template<class T>
293  (
294  const fvMesh& mesh,
295  const word& setName,
296  SetOrigin& origin
297  ) const;
298 
299  //- Update topoSet
300  template<class T>
301  inline bool updateSet
302  (
303  autoPtr<T>& setPtr,
304  const word& setName,
305  SetOrigin origin
306  ) const;
307 
308 
309  // Updating
310 
311  //- Examine current variable values and update stored variables
312  virtual void updateSpecialVariables(bool force=false);
313 
314  //- Do we need a data file to be written
315  virtual bool hasDataToWrite() const;
316 
317  //- Prepare/update special variables and add to dictionary,
318  //- normally via the reader/writer
319  virtual void prepareData(dictionary& dict) const;
320 
321  //- Read data from dictionary, normally via the reader/writer
322  virtual void getData(const dictionary& dict);
323 
324 
325 public:
326 
327  // Friends
328  friend class exprDriverWriter;
329 
330 
331  // Static Member Functions
332 
333  //- Get the default mesh, if one is defined
334  static const fvMesh& defaultMesh();
335 
336  //- Set the default mesh (if not already set)
337  static const fvMesh* resetDefaultMesh
338  (
339  const fvMesh& mesh,
340  const bool force = false
341  );
342 
343 
344  //- Runtime type information
345  TypeName("fvExprDriver");
346 
347 
348  // Run-time selection
349 
351  (
352  autoPtr,
353  fvExprDriver,
354  dictionary,
355  (
356  const dictionary& dict,
357  const fvMesh& mesh
358  ),
359  (dict,mesh)
360  );
361 
363  (
364  autoPtr,
365  fvExprDriver,
366  idName,
367  (
368  const word& ident,
369  const fvMesh& mesh
370  ),
371  (ident, mesh)
372  );
373 
374 
375  // Constructors
376 
377  //- Null constructor, and null construct with search preferences
378  explicit fvExprDriver
379  (
380  bool cacheReadFields = false,
381  bool searchInMemory = true,
382  bool searchFiles = false,
384  );
385 
386  //- Copy construct
387  fvExprDriver(const fvExprDriver&);
388 
389  //- Construct from a dictionary
390  explicit fvExprDriver(const dictionary& dict);
391 
392 
393  //- Return a reference to the selected value driver
395  (
396  const dictionary& dict,
397  const fvMesh& mesh
398  );
399 
400  //- Return a reference to the selected value driver
402  (
403  const dictionary& dict
404  );
405 
406  //- Return a reference to the selected value driver
408  (
409  const word& type,
410  const word& id,
411  const fvMesh& mesh
412  );
413 
414  //- Clone
415  virtual autoPtr<fvExprDriver> clone() const = 0;
416 
417 
418  //- Destructor
419  virtual ~fvExprDriver();
420 
421 
422  // Public Member Functions
423 
424  //- The underlying field size for the expression
425  virtual label size() const = 0;
426 
427  //- The underlying point field size for the expression
428  virtual label pointSize() const = 0;
429 
430 
431  // Globals, Mesh Related
432 
433  //- The Time associated with the mesh
434  const Time& runTime() const;
435 
436  //- The current time name
437  virtual word timeName() const;
438 
439  //- The current time value
440  virtual scalar timeValue() const;
441 
442 
443  // General Controls
444 
445  //- Status of cache-sets (static variable)
446  bool cacheSets() const { return cacheSets_; }
447 
448 
449  // Variables
450 
451  //- Clear temporary variables and resets from expression strings
452  virtual void clearVariables();
453 
454  //- True if named variable exists
455  inline virtual bool hasVariable(const word& name) const;
456 
457  //- Return const-access to the named variable
458  inline virtual const exprResult& variable(const word& name) const;
459 
460  //- Test for existence of a local/global variable or a field
461  template<class Type>
462  inline bool isVariableOrField
463  (
464  const word& name,
465  const bool wantPointData = false,
466  const label expectSize = -1
467  ) const;
468 
469  //- Retrieve local/global variable as a tmp field
470  //
471  // \param name The name of the local/global field
472  // \param expectSize The size check on the variable, -1 to ignore
473  // \param mandatory A missing variable is Fatal, or return
474  // an invalid tmp
475  template<class Type>
477  (
478  const word& name,
479  const label expectSize,
480  const bool mandatory = true
481  ) const;
482 
483 
484  //- Lookup the field class name (memory or read from disk)
485  //
486  // Return empty if the name cannot be resolved.
487  word getFieldClassName(const word& name) const;
488 
489 
490  // Types
491 
492  //- Return cell/face/point set type or unknown
494 
495  //- Return cell/face/point zone type or unknown
497 
498  //- Return cell/face/point zone/set type or unknown
500 
501  //- Read and return labels associated with the topo set
503  (
504  const word& name,
505  enum topoSetSource::sourceType setType
506  ) const;
507 
508  //- Test if name is a known cellZone
509  bool isCellZone(const word& name) const;
510 
511  //- Test if name is a known faceZone
512  bool isFaceZone(const word& name) const;
513 
514  //- Test if name is a known pointZone
515  bool isPointZone(const word& name) const;
516 
517  //- Test if name is a known cellSet
518  bool isCellSet(const word& name) const;
519 
520  //- Test if name is a known faceSet
521  bool isFaceSet(const word& name) const;
522 
523  //- Test if name is a known pointSet
524  bool isPointSet(const word& name) const;
525 
526 
527  // Evaluation
528 
529  //- Evaluate the expression
530  //- and save as the specified named variable
531  virtual void evaluateVariable
532  (
533  const word& varName,
534  const expressions::exprString& expr
535  );
536 
537  //- Evaluate an expression on a remote
538  //- and save as the specified named variable
539  //
540  // The fully qualified form of the remote is given as follows
541  // \verbatim
542  // type'name/region
543  // \endverbatim
544  //
545  // If not specified, the default type is "patch", which means the
546  // following are equivalent
547  // \verbatim
548  // patch'name/region
549  // name/region
550  // \endverbatim
551  //
552  // If region is identical to the current region, it can be omitted:
553  // \verbatim
554  // patch'name
555  // name (default is patch)
556  // \endverbatim
557  virtual void evaluateVariableRemote
558  (
559  string remote,
560  const word& varName,
561  const expressions::exprString& expr
562  );
563 
564 
565  // Fields
566 
567  //- Test existence of a local/global variable
568  template<class Type>
569  inline bool isVariable
570  (
571  const word& name,
572  bool wantPointData = false,
573  label expectSize = -1
574  ) const;
575 
576  //- Test if specified field can be found in memory or disk
577  template<class Type>
578  bool foundField(const word& name) const;
579 
580  //- Read the IOobject for fieldName and return its headerClassName
581  // Empty if the field could not be found.
582  word getTypeOfField(const word& fieldName) const;
583 
584 
585  // Handling remote data (future)
586 
587  // //- Access the other mesh name (future)
588  // const word& otherMeshName() const { return otherMeshName_; }
589  //
590  // //- Access the other mesh name (future)
591  // word& otherMeshName() { return otherMeshName_; }
592 
593 
594  // Reading
595 
596  //- Read variables, tables etc.
597  // Also usable for objects not constructed from a dictionary.
598  virtual bool readDict(const dictionary& dict);
599 
600 
601  // Writing
602 
603  //- Write "variables", "storedVariables", "delayedVariables",
604  //- "globalScopes" if they are present.
605  Ostream& writeCommon(Ostream& os, bool debug=false) const;
606 
607  //- Create a writer for this object
608  void createWriterAndRead(const word& name);
609 
610  //- Write data if appropriate
611  //- Should enable exact restarts
612  void tryWrite() const;
613 
614 
615  // Plugins (future)
616 
623 };
624 
625 
626 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
627 
628 } // End namespace expressions
629 } // End namespace Foam
630 
631 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
632 
633 #include "fvExprDriverI.H"
634 
635 #ifdef NoRepository
636  #include "fvExprDriverTemplates.C"
637 #endif
638 
639 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
640 
641 #endif
642 
643 // ************************************************************************* //
Foam::expressions::patchExpr::debug
int debug
Static debugging option.
Foam::expressions::fvExprDriver::cacheSets
bool cacheSets() const
Status of cache-sets (static variable)
Definition: fvExprDriver.H:495
volFields.H
Foam::expressions::fvExprDriver::defaultBoundaryType
static word defaultBoundaryType(const T &)
Default boundary type is calculated.
Definition: fvExprDriver.H:209
Foam::expressions::fvExprDriver::New
static autoPtr< fvExprDriver > New(const dictionary &dict, const fvMesh &mesh)
Return a reference to the selected value driver.
Definition: fvExprDriverNew.C:49
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::expressions::fvExprDriver::resetDefaultMesh
static const fvMesh * resetDefaultMesh(const fvMesh &mesh, const bool force=false)
Set the default mesh (if not already set)
Definition: fvExprDriver.C:77
Foam::expressions::fvExprDriver::getOrReadField
tmp< GeomField > getOrReadField(const word &name, const bool mandatory=true, const bool getOldTime=false)
Retrieve field from memory or disk.
Foam::expressions::fvExprDriver::hasDataToWrite
virtual bool hasDataToWrite() const
Do we need a data file to be written.
Definition: fvExprDriver.C:733
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
exprResultStored.H
Foam::expressions::fvExprDriver::defaultMesh
static const fvMesh & defaultMesh()
Get the default mesh, if one is defined.
Definition: fvExprDriver.C:61
Foam::expressions::fvExprDriver::size
virtual label size() const =0
The underlying field size for the expression.
Foam::expressions::fvExprDriver::isCellSet
bool isCellSet(const word &name) const
Test if name is a known cellSet.
Definition: fvExprDriver.C:675
Foam::expressions::fvExprDriver::clone
virtual autoPtr< fvExprDriver > clone() const =0
Clone.
fvExprDriverTemplates.C
Foam::expressions::fvExprDriver::foundField
bool foundField(const word &name) const
Test if specified field can be found in memory or disk.
Definition: fvExprDriverTemplates.C:136
Foam::expressions::fvExprDriver::getFieldClassName
word getFieldClassName(const word &name) const
Lookup the field class name (memory or read from disk)
Definition: fvExprDriver.C:593
Foam::expressions::fvExprDriver::fill_random
void fill_random(scalarField &field, label seed=0, const bool gaussian=false) const
Create a random field.
Definition: fvExprDriverFields.C:35
Foam::expressions::fvExprDriver::runTime
const Time & runTime() const
The Time associated with the mesh.
Definition: fvExprDriver.C:247
Foam::wordUList
UList< word > wordUList
A UList of words.
Definition: wordList.H:57
Foam::expressions::fvExprDriver
Base driver for parsing value expressions associated with an fvMesh.
Definition: fvExprDriver.H:137
Foam::expressions::fvExprDriver::isPointZone
bool isPointZone(const word &name) const
Test if name is a known pointZone.
Definition: fvExprDriver.C:717
Foam::expressions::fvExprDriver::timeName
virtual word timeName() const
The current time name.
Definition: fvExprDriver.C:253
Foam::expressions::exprDriver::searchInMemory
bool searchInMemory() const
Definition: exprDriver.H:372
Foam::expressions::fvExprDriver::evaluateVariableRemote
virtual void evaluateVariableRemote(string remote, const word &varName, const expressions::exprString &expr)
Definition: fvExprDriver.C:430
Foam::expressions::fvExprDriver::pointSize
virtual label pointSize() const =0
The underlying point field size for the expression.
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::expressions::exprDriver::searchFiles
bool searchFiles() const
Definition: exprDriver.H:373
exprDriver.H
Foam::expressions::fvExprDriver::prepareData
virtual void prepareData(dictionary &dict) const
Definition: fvExprDriver.C:749
Foam::expressions::fvExprDriver::MEMORY
Definition: fvExprDriver.H:337
Foam::expressions::fvExprDriver::fvExprDriver
fvExprDriver(bool cacheReadFields=false, bool searchInMemory=true, bool searchFiles=false, const dictionary &dict=dictionary::null)
Null constructor, and null construct with search preferences.
Definition: fvExprDriver.C:96
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:385
Foam::expressions::fvExprDriver::isGlobalVariable
bool isGlobalVariable(const word &name, const bool wantPointData=false, const label expectedSize=-1) const
Test existence of a global variable.
Definition: fvExprDriverTemplates.C:37
Foam::expressions::fvExprDriver::isVariable
bool isVariable(const word &name, bool wantPointData=false, label expectSize=-1) const
Test existence of a local/global variable.
Definition: fvExprDriverI.H:74
Foam::expressions::fvExprDriver::TypeName
TypeName("fvExprDriver")
Runtime type information.
Foam::expressions::exprDriver::cacheReadFields
bool cacheReadFields() const
Definition: exprDriver.H:371
Foam::expressions::fvExprDriver::getTopoSetLabels
labelList getTopoSetLabels(const word &name, enum topoSetSource::sourceType setType) const
Read and return labels associated with the topo set.
Definition: fvExprDriverIO.C:38
Foam::expressions::fvExprDriver::getTypeOfField
word getTypeOfField(const word &fieldName) const
Read the IOobject for fieldName and return its headerClassName.
Definition: fvExprDriver.C:584
Foam::expressions::exprResult
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:128
Foam::expressions::fvExprDriver::~fvExprDriver
virtual ~fvExprDriver()
Destructor.
Definition: fvExprDriver.C:153
Foam::Field< scalar >
Foam::expressions::fvExprDriver::hasVariable
virtual bool hasVariable(const word &name) const
True if named variable exists.
Definition: fvExprDriverI.H:34
Foam::expressions::fvExprDriver::mesh
virtual const fvMesh & mesh() const =0
The mesh we are attached to.
Foam::expressions::fvExprDriver::getVariable
tmp< Field< Type > > getVariable(const word &name, const label expectSize, const bool mandatory=true) const
Retrieve local/global variable as a tmp field.
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::expressions::fvExprDriver::writeCommon
Ostream & writeCommon(Ostream &os, bool debug=false) const
Definition: fvExprDriverIO.C:208
exprResultDelayed.H
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::expressions::fvExprDriver::timeValue
virtual scalar timeValue() const
The current time value.
Definition: fvExprDriver.C:259
Foam::expressions::fvExprDriver::correctField
static void correctField(T &)
Apply correctBoundaryConditions (volume fields only)
Definition: fvExprDriver.H:228
Foam::expressions::fvExprDriver::updateSpecialVariables
virtual void updateSpecialVariables(bool force=false)
Examine current variable values and update stored variables.
Definition: fvExprDriver.C:265
Foam::expressions::exprDriver
Base driver for parsing (field) values.
Definition: exprDriver.H:112
field
rDeltaTY field()
Foam::expressions::fvExprDriver::topoSourceType
topoSetSource::sourceType topoSourceType(const word &name) const
Return cell/face/point zone/set type or unknown.
Definition: fvExprDriver.C:661
fvExprDriverI.H
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::fvExprDriver::getOrReadFieldImpl
tmp< GeomField > getOrReadFieldImpl(const word &name, const MeshRef &meshRef, const bool mandatory=true, const bool getOldTime=false)
Retrieve field from memory or disk (implementation)
Foam::expressions::fvExprDriver::getOrReadPointField
tmp< GeomField > getOrReadPointField(const word &name, const bool mandatory=true, const bool getOldTime=false)
Retrieve point field from memory or disk.
Foam::expressions::fvExprDriver::isFaceZone
bool isFaceZone(const word &name) const
Test if name is a known faceZone.
Definition: fvExprDriver.C:711
Foam::expressions::fvExprDriver::FILE
Definition: fvExprDriver.H:337
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::expressions::fvExprDriver::readAndRegister
tmp< GeomField > readAndRegister(const word &name, const MeshRef &meshRef)
Helper function for getOrReadField.
Foam::expressions::fvExprDriver::isPointSet
bool isPointSet(const word &name) const
Test if name is a known pointSet.
Definition: fvExprDriver.C:695
Foam::expressions::fvExprDriver::lookupGlobal
const exprResult & lookupGlobal(const word &name) const
Return the global variable if available or a null result.
Definition: fvExprDriver.C:725
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::expressions::fvExprDriver::CACHE
Definition: fvExprDriver.H:337
Foam::expressions::fvExprDriver::evaluateVariable
virtual void evaluateVariable(const word &varName, const expressions::exprString &expr)
Definition: fvExprDriver.C:382
Foam::expressions::fvExprDriver::getTopoSet
autoPtr< T > getTopoSet(const fvMesh &mesh, const word &setName, SetOrigin &origin) const
Get topoSet.
Foam::HashTable
A HashTable similar to std::unordered_map.
Definition: HashTable.H:105
Foam::expressions::fvExprDriver::createWriterAndRead
void createWriterAndRead(const word &name)
Create a writer for this object.
Definition: fvExprDriverIO.C:262
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::expressions::fvExprDriver::isCellZone
bool isCellZone(const word &name) const
Test if name is a known cellZone.
Definition: fvExprDriver.C:705
Foam::expressions::fvExprDriver::variable
virtual exprResult & variable(const word &name)
Non-const access to the named variable (sub-classes only)
Definition: fvExprDriverI.H:59
Foam::expressions::fvExprDriver::isFaceSet
bool isFaceSet(const word &name) const
Test if name is a known faceSet.
Definition: fvExprDriver.C:685
Foam::expressions::exprDriver::dict
const dictionary & dict() const
The dictionary with all input data/specification.
Definition: exprDriver.H:299
Foam::expressions::fvExprDriver::NEW
Definition: fvExprDriver.H:337
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::expressions::fvExprDriver::tryWrite
void tryWrite() const
Definition: fvExprDriverIO.C:271
Foam::List< word >
Foam::expressions::fvExprDriver::isVariableOrField
bool isVariableOrField(const word &name, const bool wantPointData=false, const label expectSize=-1) const
Test for existence of a local/global variable or a field.
Definition: fvExprDriverI.H:90
topoSetSource.H
Foam::expressions::exprString
Definition: exprString.H:60
Foam::type
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:590
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
Foam::expressions::fvExprDriver::topoSetType
topoSetSource::sourceType topoSetType(const word &name) const
Return cell/face/point set type or unknown.
Definition: fvExprDriver.C:617
Foam::expressions::fvExprDriver::topoZoneType
topoSetSource::sourceType topoZoneType(const word &name) const
Return cell/face/point zone type or unknown.
Definition: fvExprDriver.C:639
Foam::expressions::fvExprDriver::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, fvExprDriver, dictionary,(const dictionary &dict, const fvMesh &mesh),(dict, mesh))
Foam::expressions::exprDriverWriter
Registered input/output for an expressions::fvExprDriver.
Definition: exprDriverWriter.H:54
Foam::expressions::fvExprDriver::updateSet
bool updateSet(autoPtr< T > &setPtr, const word &setName, SetOrigin origin) const
Update topoSet.
Definition: fvExprDriverTemplates.C:528
Foam::expressions::fvExprDriver::getData
virtual void getData(const dictionary &dict)
Read data from dictionary, normally via the reader/writer.
Definition: fvExprDriver.C:740
Foam::expressions::fvExprDriver::clearVariables
virtual void clearVariables()
Clear temporary variables and resets from expression strings.
Definition: fvExprDriver.C:356
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::expressions::fvExprDriver::regionMesh
static const fvMesh & regionMesh(const dictionary &dict, const fvMesh &mesh, bool readIfNecessary)
Definition: fvExprDriver.C:534
Foam::GeometricField< Type, fvPatchField, volMesh >
Foam::expressions::fvExprDriver::setGlobalScopes
void setGlobalScopes(const wordUList &scopes)
Define scopes for global variables.
Definition: fvExprDriver.H:251
Foam::expressions::fvExprDriver::INVALID
Definition: fvExprDriver.H:337
Foam::expressions::fvExprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: fvExprDriver.C:160
Foam::expressions::fvExprDriver::SetOrigin
SetOrigin
The origin of the topoSet.
Definition: fvExprDriver.H:337
pointMesh.H
Foam::expressions::fvExprDriver::isField
bool isField(const word &name, const bool wantPointData=false, const label expectSize=-1) const
Test for the existence of a mesh field.
Definition: fvExprDriverTemplates.C:199