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