fvExprDriver.C
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 <bgschaid@hfd-research.com>
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 \*---------------------------------------------------------------------------*/
28 
29 #include "fvExprDriver.H"
30 #include "exprDriverWriter.H"
31 #include "expressionEntry.H"
32 #include "exprResultGlobals.H"
33 
34 #include "cellSet.H"
35 #include "faceSet.H"
36 #include "pointSet.H"
37 #include "stringOps.H"
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 namespace expressions
44 {
45 
46  defineTypeNameAndDebug(fvExprDriver, 0);
47  defineRunTimeSelectionTable(fvExprDriver, dictionary);
48  defineRunTimeSelectionTable(fvExprDriver, idName);
49 
50 } // End namespace expressions
51 } // End namespace Foam
52 
53 // Currently not working?
54 bool Foam::expressions::fvExprDriver::cacheSets_ = true;
55 
56 const Foam::fvMesh* Foam::expressions::fvExprDriver::defaultMeshPtr_ = nullptr;
57 
58 
59 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
60 
62 {
63  if (!defaultMeshPtr_)
64  {
66  << "No default mesh set" << nl
67  << "Try the 'fvExprDriverFunctionObject' as a workaround"
68  << endl
69  << abort(FatalError);
70  }
71 
72  return *defaultMeshPtr_;
73 }
74 
75 
77 (
78  const fvMesh& mesh,
79  const bool force
80 )
81 {
82  const fvMesh* ptr = defaultMeshPtr_;
83 
84  if (force || (ptr != nullptr))
85  {
86  defaultMeshPtr_ = &mesh;
87  }
88 
89  return ptr;
90 }
91 
92 
93 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
94 
96 (
97  bool cacheReadFields,
98  bool searchInMemory,
99  bool searchFiles,
100  const dictionary& dict
101 )
102 :
104  (
105  cacheReadFields,
106  searchInMemory,
107  searchFiles,
108  dict
109  ),
110  globalScopes_(),
111  delayedVariables_(),
112  storedVariables_(),
113  specialVariablesIndex_(-1),
114  otherMeshName_(),
115  writer_(nullptr)
116 {}
117 
118 
120 (
121  const fvExprDriver& rhs
122 )
123 :
125  globalScopes_(rhs.globalScopes_),
126  delayedVariables_(rhs.delayedVariables_),
127  storedVariables_(rhs.storedVariables_),
128  specialVariablesIndex_(rhs.specialVariablesIndex_),
129  otherMeshName_(),
130  writer_(nullptr)
131 {}
132 
133 
135 (
136  const dictionary& dict
137 )
138 :
140  (
141  dict.getOrDefault("cacheReadFields", false),
142  dict.getOrDefault("searchInMemory", true),
143  dict.getOrDefault("searchFiles", false),
144  dict
145  )
146 {
147  readDict(dict);
148 }
149 
150 
151 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
152 
154 {}
155 
156 
157 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
158 
160 (
161  const dictionary& dict
162 )
163 {
165 
166  // fileNameList plugins;
167  // if (dict.readIfPresent("functionPlugins", plugins))
168  // {
169  // for (const fileName& libName : plugins)
170  // {
171  // this->runTime().libs().open
172  // (
173  // "libswak" + libName + "FunctionPlugin" // verbose = true
174  // );
175  // }
176  // }
177 
178  dict.readIfPresent("globalScopes", globalScopes_);
179 
180  const entry* eptr = nullptr;
181 
182  // Special variables
183 
184  if
185  (
186  // storedVariables
187  (eptr = dict.findEntry("storedVariables", keyType::LITERAL))
188  != nullptr
189  )
190  {
191  ITstream& is = eptr->stream();
192 
193  if (writer_ && !storedVariables_.empty())
194  {
196  // << "Context: " << driverContext_ << nl
197  << "The 'storedVariables' was already read."
198  << " No update from " << is
199  << endl;
200  }
201  else
202  {
203  storedVariables_ = List<exprResultStored>(is);
204 
205  // Check for excess tokens
206  dict.checkITstream(is, "storedVariables");
207  }
208  }
209 
210  if
211  (
212  // delayedVariables
213  (eptr = dict.findEntry("delayedVariables", keyType::LITERAL))
214  != nullptr
215  )
216  {
217  ITstream& is = eptr->stream();
218 
219  if (writer_ && !delayedVariables_.empty())
220  {
222  // << "Context: " << driverContext_ << nl
223  << "Seems like 'delayedVariables' was already read."
224  << " No update from " << is
225  << endl;
226  }
227  else
228  {
229  List<exprResultDelayed> inputs(is);
230 
231  // Check for excess tokens
232  dict.checkITstream(is, "delayedVariables");
233 
234  for (auto& var : inputs)
235  {
236  delayedVariables_.insert(var.name(), var);
237  }
238  }
239  }
240 
241  return true;
242 }
243 
244 
245 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
246 
248 {
249  return this->mesh().time();
250 }
251 
252 
254 {
255  return runTime().timeName();
256 }
257 
258 
260 {
261  return runTime().value();
262 }
263 
264 
266 {
267  const bool updated = this->update();
268 
269  const label eventIndex = mesh().time().timeIndex();
270  const scalar eventTime = mesh().time().value();
271 
272  DebugInfo
273  << "fvExprDriver::updateSpecialVariables(force="
274  << force << ") Updated: " << updated << endl;
275 
276  if (specialVariablesIndex_ < 0)
277  {
278  DebugInfo
279  << "First update: " << eventIndex << endl;
280 
281  specialVariablesIndex_ = eventIndex;
282 
283  for (exprResultStored& v : storedVariables_)
284  {
285  DebugInfo
286  << v.name() << " = " << v.initialValueExpression()
287  << " (has value "
288  << v.hasValue() << ")" << endl;
289 
290  if (!v.hasValue())
291  {
292  DebugInfo
293  << "First value: " << v.initialValueExpression()
294  << " -> " << v.name() << endl;
295 
296  parse(v.initialValueExpression());
297  v = result_;
298  DebugInfo
299  << "Parser size: " << this->size() << nl
300  << "Calculated: " << result_ << nl
301  << "Stored: " << v << nl;
302  }
303  }
304  }
305 
306  if (force || specialVariablesIndex_ != eventIndex)
307  {
308  DebugInfo
309  << "Store variables: " << force << ' '
310  << specialVariablesIndex_ << ' '
311  << eventIndex << endl;
312 
313  for (exprResultStored& v : storedVariables_)
314  {
315  if (variables_.found(v.name()))
316  {
317  DebugInfo
318  << "Storing variable: " << v.name() << " "
319  << variables_[v.name()] << endl;
320 
321  v = variables_[v.name()];
322  }
323  }
324  specialVariablesIndex_ = eventIndex;
325  }
326 
327  forAllIters(delayedVariables_, iter)
328  {
329  DebugInfo
330  << "Updating delayed variable " << iter().name() << endl;
331 
332  if (!iter().updateReadValue(eventTime))
333  {
334  const exprString& expr = iter().startupValueExpression();
335 
336  DebugInfo
337  << "Evaluate: " << expr << endl;
338 
339  parse(expr);
340  iter().setReadValue(result_);
341 
342  DebugInfo
343  << "Value " << iter() << nl
344  << "Type " << iter().valueType() << "("
345  << result_.valueType() << ")" << endl;
346  }
347  else
348  {
349  DebugInfo
350  << iter().name() << " updated without problem" << endl;
351  }
352  }
353 }
354 
355 
357 {
358  DebugInfo
359  << "Clearing variables" << endl;
360 
361  const scalar eventTime = mesh().time().value();
362 
363  (void)this->update();
364 
365  updateSpecialVariables();
366  variables_.clear();
367  for (exprResultStored& v : storedVariables_)
368  {
369  variables_.insert(v.name(), v);
370  }
371 
372  addVariables(variableStrings_, false);
373 
374  forAllIters(delayedVariables_, iter)
375  {
376  iter().storeValue(eventTime);
377  }
378 }
379 
380 
382 (
383  const word& varName,
384  const expressions::exprString& expr
385 )
386 {
387  const regIOobject* objPtr = mesh().findObject<regIOobject>(varName);
388 
389  if (!allowShadowing_ && objPtr)
390  {
392  // << "Context: " << driverContext_ << nl
393  << "Field '" << varName << "' (type " << objPtr->headerClassName()
394  << ") is shadowed by a variable of the same name." << nl
395  << "This may lead to trouble" << nl
396  << "If this is OK set 'allowShadowing'"
397  << " in the relevant parser" << nl
398  << endl;
399  }
400 
401  parse(expr);
402  result_.testIfSingleValue();
403 
404  DebugInfo
405  << "Evaluating: " << expr << " -> " << varName << endl
406  << result_;
407 
408 
409  // Assign
410  if (delayedVariables_.found(varName))
411  {
412  // Avoid potential conflicts?
413  variables_.erase(varName);
414 
415  DebugInfo
416  << varName << " is delayed" << endl;
417 
418  // Copy assignment
419  delayedVariables_[varName] = result_;
420  }
421  else
422  {
423  // Overwrite with a copy
424  variables_.set(varName, exprResult(result_));
425  }
426 }
427 
428 
430 (
431  string remote,
432  const word& varName,
433  const expressions::exprString& expr
434 )
435 {
436  DebugInfo
437  << "Evaluating remote " << remote.c_str()
438  << " : " << expr << " -> " << varName << endl;
439 
440  word driverType("patch"); // default is patch
441  word identName, regionName;
442 
443  const auto slashPos = remote.find('/');
444  if (slashPos != std::string::npos)
445  {
446  regionName = word::validate(remote.substr(slashPos+1));
447  remote.resize(slashPos);
448  }
449 
450  const auto quotePos = remote.find('\'');
451  if (quotePos != std::string::npos)
452  {
453  driverType = word::validate(remote.substr(0, quotePos));
454  identName = word::validate(remote.substr(quotePos+1));
455  }
456  else
457  {
458  identName = word::validate(remote);
459  }
460 
461  if
462  (
463  driverType == "patch"
464  &&
465  (
466  identName.empty()
467  || identName == "volume"
468  || identName == "internalField"
469  )
470  )
471  {
472  driverType = "internalField";
473  }
474 
475  const fvMesh* pRegion = &(this->mesh());
476 
477  if (!regionName.empty())
478  {
479  pRegion = pRegion->time().cfindObject<fvMesh>(regionName);
480 
481  if (!pRegion)
482  {
484  << "Cannot resolve mesh region: " << regionName << nl
485  << exit(FatalError);
486  }
487  }
488 
489  DebugInfo
490  << "Call other with ("
491  << driverType << ", " << identName << ", " << regionName << ")\n";
492 
493  autoPtr<fvExprDriver> otherDriver =
494  fvExprDriver::New(driverType, identName, *pRegion);
495 
496  otherDriver->setSearchBehaviour(*this);
497  otherDriver->setGlobalScopes(this->globalScopes_);
498 
499  otherDriver->parse(expr);
500 
501  exprResult otherResult(this->getRemoteResult(*otherDriver));
502 
503  // Check / re-check for uniform. Not normally needed
504  if (!otherResult.isUniform())
505  {
506  otherResult.testIfSingleValue();
507  }
508 
509  DebugInfo
510  << "Remote result: " << otherResult << nl;
511 
512  // Assign
513  if (delayedVariables_.found(varName))
514  {
515  // Avoid potential conflicts?
516  variables_.erase(varName);
517 
518  DebugInfo
519  << varName << " is delayed - setting" << nl;
520 
521  // Move assignment
522  delayedVariables_[varName] = std::move(otherResult);
523  }
524  else
525  {
526  // Overwrite with a copy
527  variables_.set(varName, std::move(otherResult));
528  }
529 }
530 
531 
532 const Foam::fvMesh&
534 (
535  const dictionary& dict,
536  const fvMesh& mesh,
537  bool readIfNecessary
538 )
539 {
541 
542  if (!dict.readIfPresent("region", regionName))
543  {
544  DebugInFunction << "Using original mesh " << nl;
545  return mesh;
546  }
547 
548  DebugInFunction << "Using mesh " << regionName << endl;
549 
550  fvMesh* meshPtr = mesh.time().getObjectPtr<fvMesh>(regionName);
551 
552  if (!meshPtr && readIfNecessary)
553  {
555  << "Region " << regionName
556  << " not in memory. Loading it" << endl;
557 
558  meshPtr = new fvMesh
559  (
560  IOobject
561  (
562  regionName,
563  mesh.time().constant(),
564  mesh.time(),
566  )
567  );
568 
569  meshPtr->polyMesh::store();
570  }
571 
572  if (!meshPtr)
573  {
575  << "No mesh region loaded: " << regionName
576  << endl;
577  }
578 
579  return *meshPtr;
580 }
581 
582 
584 (
585  const word& fieldName
586 ) const
587 {
588  return getHeaderClassName(this->mesh(), fieldName);
589 }
590 
591 
593 (
594  const word& name
595 ) const
596 {
597  if (searchInMemory())
598  {
599  const regIOobject* ioptr = this->mesh().findObject<regIOobject>(name);
600 
601  if (ioptr)
602  {
603  return ioptr->type();
604  }
605  }
606 
607  if (searchFiles())
608  {
609  return getHeaderClassName(this->mesh(), name);
610  }
611 
612  return word::null;
613 }
614 
615 
618 {
619  IOobject io(topoSet::findIOobject(mesh(), setName));
620 
621  if (cellSet::typeName == io.headerClassName())
622  {
623  return topoSetSource::sourceType::CELLSET_SOURCE;
624  }
625  if (faceSet::typeName == io.headerClassName())
626  {
627  return topoSetSource::sourceType::FACESET_SOURCE;
628  }
629  if (pointSet::typeName == io.headerClassName())
630  {
631  return topoSetSource::sourceType::POINTSET_SOURCE;
632  }
633 
634  return topoSetSource::sourceType::UNKNOWN_SOURCE;
635 }
636 
637 
640 {
641  if (mesh().cellZones().findZoneID(setName) >= 0)
642  {
643  return topoSetSource::sourceType::CELLZONE_SOURCE;
644  }
645 
646  if (mesh().faceZones().findZoneID(setName) >= 0)
647  {
648  return topoSetSource::sourceType::FACEZONE_SOURCE;
649  }
650 
651  if (mesh().pointZones().findZoneID(setName) >= 0)
652  {
653  return topoSetSource::sourceType::POINTZONE_SOURCE;
654  }
655 
656  return topoSetSource::sourceType::UNKNOWN_SOURCE;
657 }
658 
659 
662 {
663  auto setType = topoZoneType(setName);
664 
665  if (topoSetSource::sourceType::UNKNOWN_SOURCE == setType)
666  {
667  setType = topoSetType(setName);
668  }
669 
670  return setType;
671 }
672 
673 
674 
676 {
677  return
678  (
679  topoSetSource::sourceType::CELLSET_SOURCE
680  == topoSetType(setName)
681  );
682 }
683 
684 
686 {
687  return
688  (
689  topoSetSource::sourceType::FACESET_SOURCE
690  == topoSetType(setName)
691  );
692 }
693 
694 
696 {
697  return
698  (
699  topoSetSource::sourceType::POINTSET_SOURCE
700  == topoSetType(setName)
701  );
702 }
703 
704 
706 {
707  return (mesh().cellZones().findZoneID(name) >= 0);
708 }
709 
710 
712 {
713  return (mesh().faceZones().findZoneID(name) >= 0);
714 }
715 
716 
718 {
719  return (mesh().pointZones().findZoneID(name) >= 0);
720 }
721 
722 
725 (
726  const word& name
727 ) const
728 {
729  return exprResultGlobals::New(this->mesh()).get(name, globalScopes_);
730 }
731 
732 
734 {
735  return (!storedVariables_.empty() || !delayedVariables_.empty());
736 }
737 
738 
740 (
741  const dictionary& dict
742 )
743 {
744  dict.readIfPresent("storedVariables", storedVariables_);
745 }
746 
747 
749 (
751 ) const
752 {
753  auto& driver = const_cast<fvExprDriver&>(*this);
754 
755  (void)driver.update();
756 
757  if (storedVariables_.size())
758  {
759  driver.updateSpecialVariables(true);
760 
761  dict.add("storedVariables", storedVariables_);
762  }
763 }
764 
765 
766 // ************************************************************************* //
exprResultGlobals.H
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
runTime
engineTime & runTime
Definition: createEngineTime.H:13
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::IOobject
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition: IOobject.H:104
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:73
meshPtr
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
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::entry::stream
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
update
mesh update()
Foam::expressions::fvExprDriver::hasDataToWrite
virtual bool hasDataToWrite() const
Do we need a data file to be written.
Definition: fvExprDriver.C:733
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.
Foam::expressions::exprResult::testIfSingleValue
void testIfSingleValue(const bool parRun=Pstream::parRun())
Test if field corresponds to a single-value and thus uniform.
Definition: exprResult.C:462
Foam::expressions::exprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: exprDriver.C:158
Foam::expressions::exprDriver::setSearchBehaviour
void setSearchBehaviour(bool cacheReadFields, bool searchInMemory, bool searchFiles)
Set search behaviour.
Definition: exprDriver.C:387
Foam::expressions::fvExprDriver::defaultMesh
static const fvMesh & defaultMesh()
Get the default mesh, if one is defined.
Definition: fvExprDriver.C:61
Foam::expressions::fvExprDriver::isCellSet
bool isCellSet(const word &name) const
Test if name is a known cellSet.
Definition: fvExprDriver.C:675
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::runTime
const Time & runTime() const
The Time associated with the mesh.
Definition: fvExprDriver.C:247
Foam::word::validate
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
Definition: word.C:45
Foam::expressions::exprResultGlobals::get
const exprResult & get(const word &name, const wordUList &scopes) const
Return a global variable, if it exists, or a exprResult::null.
Definition: exprResultGlobals.C:198
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::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::expressions::defineRunTimeSelectionTable
defineRunTimeSelectionTable(fvExprDriver, dictionary)
Foam::expressions::fvExprDriver::timeName
virtual word timeName() const
The current time name.
Definition: fvExprDriver.C:253
fvExprDriver.H
Foam::expressions::fvExprDriver::evaluateVariableRemote
virtual void evaluateVariableRemote(string remote, const word &varName, const expressions::exprString &expr)
Definition: fvExprDriver.C:430
Foam::expressions::fvExprDriver::prepareData
virtual void prepareData(dictionary &dict) const
Definition: fvExprDriver.C:749
Foam::topoSet::findIOobject
static IOobject findIOobject(const polyMesh &mesh, const word &name, readOption r=MUST_READ, writeOption w=NO_WRITE)
Find IOobject in the polyMesh/sets (used as constructor helper)
Definition: topoSet.C:318
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
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
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
expressionEntry.H
Foam::expressions::fvExprDriver::~fvExprDriver
virtual ~fvExprDriver()
Destructor.
Definition: fvExprDriver.C:153
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:55
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:365
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
faceSet.H
Foam::expressions::fvExprDriver::timeValue
virtual scalar timeValue() const
The current time value.
Definition: fvExprDriver.C:259
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
exprDriverWriter.H
Foam::expressions::fvExprDriver::topoSourceType
topoSetSource::sourceType topoSourceType(const word &name) const
Return cell/face/point zone/set type or unknown.
Definition: fvExprDriver.C:661
forAllIters
#define forAllIters(container, iter)
Iterate across all elements in the container object.
Definition: stdFoam.H:223
Foam::expressions::fvExprDriver::isFaceZone
bool isFaceZone(const word &name) const
Test if name is a known faceZone.
Definition: fvExprDriver.C:711
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::expressions::exprResult::isUniform
bool isUniform() const
True if single, uniform value.
Definition: exprResultI.H:258
Foam::FatalError
error FatalError
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::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
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
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::exprResultStored
An exprResult with persistence.
Definition: exprResultStored.H:82
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::expressions::fvExprDriver::evaluateVariable
virtual void evaluateVariable(const word &varName, const expressions::exprString &expr)
Definition: fvExprDriver.C:382
Foam::IOobject::headerClassName
const word & headerClassName() const
Return name of the class name read from header.
Definition: IOobjectI.H:88
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::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:71
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::expressions::fvExprDriver::isFaceSet
bool isFaceSet(const word &name) const
Test if name is a known faceSet.
Definition: fvExprDriver.C:685
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:359
Foam::objectRegistry::cfindObject
const Type * cfindObject(const word &name, const bool recursive=false) const
Return const pointer to the object of the given Type.
Definition: objectRegistryTemplates.C:390
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::expressions::exprString
Definition: exprString.H:60
Foam::expressions::fvExprDriver::topoSetType
topoSetSource::sourceType topoSetType(const word &name) const
Return cell/face/point set type or unknown.
Definition: fvExprDriver.C:617
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
Foam::expressions::fvExprDriver::topoZoneType
topoSetSource::sourceType topoZoneType(const word &name) const
Return cell/face/point zone type or unknown.
Definition: fvExprDriver.C:639
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:275
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
cellSet.H
Foam::keyType::LITERAL
String literal.
Definition: keyType.H:73
Foam::expressions::fvExprDriver::regionMesh
static const fvMesh & regionMesh(const dictionary &dict, const fvMesh &mesh, bool readIfNecessary)
Definition: fvExprDriver.C:534
Foam::expressions::fvExprDriver::setGlobalScopes
void setGlobalScopes(const wordUList &scopes)
Define scopes for global variables.
Definition: fvExprDriver.H:251
Foam::expressions::defineTypeNameAndDebug
defineTypeNameAndDebug(fvExprDriver, 0)
stringOps.H
Foam::expressions::exprResultGlobals::New
static exprResultGlobals & New(const objectRegistry &obr)
Static constructor for singleton.
Definition: exprResultGlobals.C:119
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:303
Foam::expressions::exprDriver::update
virtual bool update()
Update things.
Definition: exprDriver.C:182
Foam::expressions::fvExprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: fvExprDriver.C:160
Foam::IOobject::MUST_READ
Definition: IOobject.H:120
pointSet.H