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