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
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 \*---------------------------------------------------------------------------*/
28 
29 #include "fvExprDriver.H"
30 #include "fvExprDriverWriter.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 
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 (
98  const dictionary& dict
99 )
100 :
102  globalScopes_(),
103  delayedVariables_(),
104  storedVariables_(),
105  specialVariablesIndex_(-1),
106  otherMeshName_(),
107  writer_(nullptr)
108 {}
109 
110 
112 (
113  const fvExprDriver& rhs,
114  const dictionary& dict
115 )
116 :
118  globalScopes_(rhs.globalScopes_),
119  delayedVariables_(rhs.delayedVariables_),
120  storedVariables_(rhs.storedVariables_),
121  specialVariablesIndex_(rhs.specialVariablesIndex_),
122  otherMeshName_(),
123  writer_(nullptr)
124 {}
125 
126 
128 (
129  const dictionary& dict
130 )
131 :
133  globalScopes_(),
134  delayedVariables_(),
135  storedVariables_(),
136  specialVariablesIndex_(-1),
137  otherMeshName_(),
138  writer_(nullptr)
139 {
140  readDict(dict);
141 }
142 
143 
144 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
145 
147 {}
148 
149 
150 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
151 
153 (
154  const dictionary& dict
155 )
156 {
158 
159  // fileNameList plugins;
160  // if (dict.readIfPresent("functionPlugins", plugins))
161  // {
162  // for (const fileName& libName : plugins)
163  // {
164  // this->mesh().time().libs().open
165  // (
166  // "libswak" + libName + "FunctionPlugin" // verbose = true
167  // );
168  // }
169  // }
170 
171  dict.readIfPresent("globalScopes", globalScopes_);
172 
173  const entry* eptr = nullptr;
174 
175  // Special variables
176 
177  if
178  (
179  // storedVariables
180  (eptr = dict.findEntry("storedVariables", keyType::LITERAL))
181  != nullptr
182  )
183  {
184  ITstream& is = eptr->stream();
185 
186  if (writer_ && !storedVariables_.empty())
187  {
189  // << "Context: " << driverContext_ << nl
190  << "The 'storedVariables' was already read."
191  << " No update from " << is
192  << endl;
193  }
194  else
195  {
196  storedVariables_ = List<exprResultStored>(is);
197 
198  // Check for excess tokens
199  dict.checkITstream(is, "storedVariables");
200  }
201  }
202 
203  if
204  (
205  // delayedVariables
206  (eptr = dict.findEntry("delayedVariables", keyType::LITERAL))
207  != nullptr
208  )
209  {
210  ITstream& is = eptr->stream();
211 
212  if (writer_ && !delayedVariables_.empty())
213  {
215  // << "Context: " << driverContext_ << nl
216  << "Seems like 'delayedVariables' was already read."
217  << " No update from " << is
218  << endl;
219  }
220  else
221  {
222  List<exprResultDelayed> inputs(is);
223 
224  // Check for excess tokens
225  dict.checkITstream(is, "delayedVariables");
226 
227  for (auto& var : inputs)
228  {
229  delayedVariables_.insert(var.name(), var);
230  }
231  }
232  }
233 
234  return true;
235 }
236 
237 
238 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
239 
241 {
242  const bool updated = this->update();
243 
244  const label eventIndex = mesh().time().timeIndex();
245  const scalar eventTime = mesh().time().value();
246 
247  DebugInfo
248  << "fvExprDriver::updateSpecialVariables(force="
249  << force << ") Updated: " << updated << endl;
250 
251  if (specialVariablesIndex_ < 0)
252  {
253  DebugInfo
254  << "First update: " << eventIndex << endl;
255 
256  specialVariablesIndex_ = eventIndex;
257 
258  for (exprResultStored& v : storedVariables_)
259  {
260  DebugInfo
261  << v.name() << " = " << v.initialValueExpression()
262  << " (has value "
263  << v.hasValue() << ")" << endl;
264 
265  if (!v.hasValue())
266  {
267  DebugInfo
268  << "First value: " << v.initialValueExpression()
269  << " -> " << v.name() << endl;
270 
271  parse(v.initialValueExpression());
272  v = result_;
273  DebugInfo
274  << "Parser size: " << this->size() << nl
275  << "Calculated: " << result_ << nl
276  << "Stored: " << v << nl;
277  }
278  }
279  }
280 
281  if (force || specialVariablesIndex_ != eventIndex)
282  {
283  DebugInfo
284  << "Store variables: " << force << ' '
285  << specialVariablesIndex_ << ' '
286  << eventIndex << endl;
287 
288  for (exprResultStored& v : storedVariables_)
289  {
290  if (variables_.found(v.name()))
291  {
292  DebugInfo
293  << "Storing variable: " << v.name() << " "
294  << variables_[v.name()] << endl;
295 
296  v = variables_[v.name()];
297  }
298  }
299  specialVariablesIndex_ = eventIndex;
300  }
301 
302  forAllIters(delayedVariables_, iter)
303  {
304  DebugInfo
305  << "Updating delayed variable " << iter().name() << endl;
306 
307  if (!iter().updateReadValue(eventTime))
308  {
309  const exprString& expr = iter().startupValueExpression();
310 
311  DebugInfo
312  << "Evaluate: " << expr << endl;
313 
314  parse(expr);
315  iter().setReadValue(result_);
316 
317  DebugInfo
318  << "Value " << iter() << nl
319  << "Type " << iter().valueType() << "("
320  << result_.valueType() << ")" << endl;
321  }
322  else
323  {
324  DebugInfo
325  << iter().name() << " updated without problem" << endl;
326  }
327  }
328 }
329 
330 
332 {
333  DebugInfo
334  << "Clearing variables" << endl;
335 
336  const scalar eventTime = mesh().time().value();
337 
338  (void)this->update();
339 
340  updateSpecialVariables();
341  variables_.clear();
342  for (exprResultStored& v : storedVariables_)
343  {
344  variables_.insert(v.name(), v);
345  }
346 
347  addVariables(variableStrings_, false);
348 
349  forAllIters(delayedVariables_, iter)
350  {
351  iter().storeValue(eventTime);
352  }
353 }
354 
355 
357 (
358  const word& varName,
359  const expressions::exprString& expr
360 )
361 {
362  const regIOobject* objPtr = mesh().findObject<regIOobject>(varName);
363 
364  if (!allowShadowing_ && objPtr)
365  {
367  // << "Context: " << driverContext_ << nl
368  << "Field '" << varName << "' (type " << objPtr->headerClassName()
369  << ") is shadowed by a variable of the same name." << nl
370  << "This may lead to trouble" << nl
371  << "If this is OK set 'allowShadowing'"
372  << " in the relevant parser" << nl
373  << endl;
374  }
375 
376  parse(expr);
377  result_.testIfSingleValue();
378 
379  DebugInfo
380  << "Evaluating: " << expr << " -> " << varName << endl
381  << result_;
382 
383 
384  // Assign
385  if (delayedVariables_.found(varName))
386  {
387  // Avoid potential conflicts?
388  variables_.erase(varName);
389 
390  DebugInfo
391  << varName << " is delayed" << endl;
392 
393  // Copy assignment
394  delayedVariables_[varName] = result_;
395  }
396  else
397  {
398  // Overwrite with a copy
399  variables_.set(varName, exprResult(result_));
400  }
401 }
402 
403 
405 (
406  string remote,
407  const word& varName,
408  const expressions::exprString& expr
409 )
410 {
411  DebugInfo
412  << "Evaluating remote " << remote.c_str()
413  << " : " << expr << " -> " << varName << endl;
414 
415  word driverType("patch"); // default is patch
416  word identName, regionName;
417 
418  const auto slashPos = remote.find('/');
419  if (slashPos != std::string::npos)
420  {
421  regionName = word::validate(remote.substr(slashPos+1));
422  remote.resize(slashPos);
423  }
424 
425  const auto quotePos = remote.find('\'');
426  if (quotePos != std::string::npos)
427  {
428  driverType = word::validate(remote.substr(0, quotePos));
429  identName = word::validate(remote.substr(quotePos+1));
430  }
431  else
432  {
433  identName = word::validate(remote);
434  }
435 
436  if
437  (
438  driverType == "patch"
439  &&
440  (
441  identName.empty()
442  || identName == "volume"
443  || identName == "internalField"
444  )
445  )
446  {
447  driverType = "internalField";
448  }
449 
450  const fvMesh* pRegion = &(this->mesh());
451 
452  if (!regionName.empty())
453  {
454  pRegion = pRegion->time().cfindObject<fvMesh>(regionName);
455 
456  if (!pRegion)
457  {
459  << "Cannot resolve mesh region: " << regionName << nl
460  << exit(FatalError);
461  }
462  }
463 
464  DebugInfo
465  << "Call other with ("
466  << driverType << ", " << identName << ", " << regionName << ")\n";
467 
468  autoPtr<fvExprDriver> otherDriver =
469  fvExprDriver::New(driverType, identName, *pRegion);
470 
471  otherDriver->setSearchBehaviour(*this);
472  otherDriver->setGlobalScopes(this->globalScopes_);
473 
474  otherDriver->parse(expr);
475 
476  exprResult otherResult(this->getRemoteResult(*otherDriver));
477 
478  // Check / re-check for uniform. Not normally needed
479  if (!otherResult.isUniform())
480  {
481  otherResult.testIfSingleValue();
482  }
483 
484  DebugInfo
485  << "Remote result: " << otherResult << nl;
486 
487  // Assign
488  if (delayedVariables_.found(varName))
489  {
490  // Avoid potential conflicts?
491  variables_.erase(varName);
492 
493  DebugInfo
494  << varName << " is delayed - setting" << nl;
495 
496  // Move assignment
497  delayedVariables_[varName] = std::move(otherResult);
498  }
499  else
500  {
501  // Overwrite with a copy
502  variables_.set(varName, std::move(otherResult));
503  }
504 }
505 
506 
507 const Foam::fvMesh&
509 (
510  const dictionary& dict,
511  const fvMesh& mesh,
512  bool readIfNecessary
513 )
514 {
516 
517  if (!dict.readIfPresent("region", regionName))
518  {
519  DebugInFunction << "Using original mesh " << nl;
520  return mesh;
521  }
522 
523  DebugInFunction << "Using mesh " << regionName << endl;
524 
525  fvMesh* meshPtr = mesh.time().getObjectPtr<fvMesh>(regionName);
526 
527  if (!meshPtr && readIfNecessary)
528  {
530  << "Region " << regionName
531  << " not in memory. Loading it" << endl;
532 
533  meshPtr = new fvMesh
534  (
535  IOobject
536  (
537  regionName,
538  mesh.time().constant(),
539  mesh.time(),
541  )
542  );
543 
544  meshPtr->polyMesh::store();
545  }
546 
547  if (!meshPtr)
548  {
550  << "No mesh region loaded: " << regionName
551  << endl;
552  }
553 
554  return *meshPtr;
555 }
556 
557 
559 (
560  const word& fieldName
561 ) const
562 {
563  return getHeaderClassName(this->mesh(), fieldName);
564 }
565 
566 
568 (
569  const word& name
570 ) const
571 {
572  if (searchRegistry())
573  {
574  const regIOobject* ioptr = this->mesh().findObject<regIOobject>(name);
575 
576  if (ioptr)
577  {
578  return ioptr->type();
579  }
580  }
581 
582  if (searchFiles())
583  {
584  return getHeaderClassName(this->mesh(), name);
585  }
586 
587  return word::null;
588 }
589 
590 
593 {
594  IOobject io(topoSet::findIOobject(mesh(), setName));
595 
596  if (cellSet::typeName == io.headerClassName())
597  {
598  return topoSetSource::sourceType::CELLSET_SOURCE;
599  }
600  if (faceSet::typeName == io.headerClassName())
601  {
602  return topoSetSource::sourceType::FACESET_SOURCE;
603  }
604  if (pointSet::typeName == io.headerClassName())
605  {
606  return topoSetSource::sourceType::POINTSET_SOURCE;
607  }
608 
609  return topoSetSource::sourceType::UNKNOWN_SOURCE;
610 }
611 
612 
615 {
616  if (mesh().cellZones().findZoneID(setName) >= 0)
617  {
618  return topoSetSource::sourceType::CELLZONE_SOURCE;
619  }
620 
621  if (mesh().faceZones().findZoneID(setName) >= 0)
622  {
623  return topoSetSource::sourceType::FACEZONE_SOURCE;
624  }
625 
626  if (mesh().pointZones().findZoneID(setName) >= 0)
627  {
628  return topoSetSource::sourceType::POINTZONE_SOURCE;
629  }
630 
631  return topoSetSource::sourceType::UNKNOWN_SOURCE;
632 }
633 
634 
637 {
638  auto setType = topoZoneType(setName);
639 
640  if (topoSetSource::sourceType::UNKNOWN_SOURCE == setType)
641  {
642  setType = topoSetType(setName);
643  }
644 
645  return setType;
646 }
647 
648 
649 
651 {
652  return
653  (
654  topoSetSource::sourceType::CELLSET_SOURCE
655  == topoSetType(setName)
656  );
657 }
658 
659 
661 {
662  return
663  (
664  topoSetSource::sourceType::FACESET_SOURCE
665  == topoSetType(setName)
666  );
667 }
668 
669 
671 {
672  return
673  (
674  topoSetSource::sourceType::POINTSET_SOURCE
675  == topoSetType(setName)
676  );
677 }
678 
679 
681 {
682  return (mesh().cellZones().findZoneID(name) >= 0);
683 }
684 
685 
687 {
688  return (mesh().faceZones().findZoneID(name) >= 0);
689 }
690 
691 
693 {
694  return (mesh().pointZones().findZoneID(name) >= 0);
695 }
696 
697 
700 (
701  const word& name
702 ) const
703 {
704  return exprResultGlobals::New(this->mesh()).get(name, globalScopes_);
705 }
706 
707 
709 {
710  return (!storedVariables_.empty() || !delayedVariables_.empty());
711 }
712 
713 
715 (
716  const dictionary& dict
717 )
718 {
719  dict.readIfPresent("storedVariables", storedVariables_);
720 }
721 
722 
724 (
726 ) const
727 {
728  auto& driver = const_cast<fvExprDriver&>(*this);
729 
730  (void)driver.update();
731 
732  if (storedVariables_.size())
733  {
734  driver.updateSpecialVariables(true);
735 
736  dict.add("storedVariables", storedVariables_);
737  }
738 }
739 
740 
741 // ************************************************************************* //
exprResultGlobals.H
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:67
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:169
Foam::topoSetSource::sourceType
sourceType
Enumeration defining the types of sources.
Definition: topoSetSource.H:74
meshPtr
Foam::autoPtr< Foam::fvMesh > meshPtr(nullptr)
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::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:708
fvExprDriverWriter.H
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:471
Foam::expressions::exprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: exprDriver.C:297
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:650
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::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:136
Foam::expressions::fvExprDriver::isPointZone
bool isPointZone(const word &name) const
Test if name is a known pointZone.
Definition: fvExprDriver.C:692
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::expressions::defineRunTimeSelectionTable
defineRunTimeSelectionTable(fvExprDriver, dictionary)
Foam::IOobject::headerClassName
const word & headerClassName() const noexcept
Return name of the class name read from header.
Definition: IOobjectI.H:83
fvExprDriver.H
Foam::expressions::fvExprDriver::evaluateVariableRemote
virtual void evaluateVariableRemote(string remote, const word &varName, const expressions::exprString &expr)
Definition: fvExprDriver.C:405
Foam::expressions::fvExprDriver::prepareData
virtual void prepareData(dictionary &dict) const
Definition: fvExprDriver.C:724
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
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:559
Foam::expressions::exprResult
A polymorphic field/result from evaluating an expression.
Definition: exprResult.H:124
expressionEntry.H
Foam::expressions::fvExprDriver::~fvExprDriver
virtual ~fvExprDriver()
Destructor.
Definition: fvExprDriver.C:146
Foam::ITstream
An input stream of tokens.
Definition: ITstream.H:52
Foam::expressions::exprDriver::searchControls
searchControls
Search/caching controls.
Definition: exprDriver.H:146
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:388
faceSet.H
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
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:686
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::expressions::exprResult::isUniform
bool isUniform() const
True if single, uniform value.
Definition: exprResultI.H:250
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:123
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
Foam::expressions::exprDriver::setSearchBehaviour
void setSearchBehaviour(enum searchControls search, const bool caching=false)
Definition: exprDriver.C:542
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
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::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:357
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::regIOobject
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
Definition: regIOobject.H:73
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::expressions::fvExprDriver::isFaceSet
bool isFaceSet(const word &name) const
Test if name is a known faceSet.
Definition: fvExprDriver.C:660
DebugInfo
#define DebugInfo
Report an information message using Foam::Info.
Definition: messageStream.H:382
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:404
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:592
Foam::search
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
Definition: fileName.C:571
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
Foam::expressions::fvExprDriver::topoZoneType
topoSetSource::sourceType topoZoneType(const word &name) const
Return cell/face/point zone type or unknown.
Definition: fvExprDriver.C:614
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::fvMesh::time
const Time & time() const
Return the top-level database.
Definition: fvMesh.H:280
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
cellSet.H
Foam::keyType::LITERAL
String literal.
Definition: keyType.H:81
Foam::expressions::fvExprDriver::regionMesh
static const fvMesh & regionMesh(const dictionary &dict, const fvMesh &mesh, bool readIfNecessary)
Definition: fvExprDriver.C:509
Foam::expressions::fvExprDriver::setGlobalScopes
void setGlobalScopes(const wordUList &scopes)
Define scopes for global variables.
Definition: fvExprDriver.H:250
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
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
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:328
Foam::expressions::exprDriver::update
virtual bool update()
Update things.
Definition: exprDriver.C:321
Foam::expressions::fvExprDriver::readDict
virtual bool readDict(const dictionary &dict)
Read variables, tables etc.
Definition: fvExprDriver.C:153
Foam::IOobject::MUST_READ
Definition: IOobject.H:185
pointSet.H