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