functionObjectList.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
26 #include "functionObjectList.H"
27 #include "Time.H"
28 #include "mapPolyMesh.H"
29 #include "argList.H"
31 #include "dictionaryEntry.H"
32 #include "stringOps.H"
33 #include "Tuple2.H"
34 #include "etcFiles.H"
35 #include "IOdictionary.H"
36 
37 /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
38 
40 (
41  "caseDicts/postProcessing"
42 );
43 
44 
45 // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
46 
47 Foam::functionObject* Foam::functionObjectList::remove
48 (
49  const word& key,
50  label& oldIndex
51 )
52 {
53  functionObject* ptr = 0;
54 
55  // Find index of existing functionObject
56  HashTable<label>::iterator fnd = indices_.find(key);
57 
58  if (fnd != indices_.end())
59  {
60  oldIndex = fnd();
61 
62  // Retrieve the pointer and remove it from the old list
63  ptr = this->set(oldIndex, 0).ptr();
64  indices_.erase(fnd);
65  }
66  else
67  {
68  oldIndex = -1;
69  }
70 
71  return ptr;
72 }
73 
74 
75 void Foam::functionObjectList::listDir
76 (
77  const fileName& dir,
78  HashSet<word>& foMap
79 )
80 {
81  // Search specified directory for functionObject configuration files
82  {
83  fileNameList foFiles(fileHandler().readDir(dir));
84  forAll(foFiles, f)
85  {
86  if (foFiles[f].ext().empty())
87  {
88  foMap.insert(foFiles[f]);
89  }
90  }
91  }
92 
93  // Recurse into sub-directories
94  {
96  forAll(foDirs, fd)
97  {
98  listDir(dir/foDirs[fd], foMap);
99  }
100  }
101 }
102 
103 
105 {
106  HashSet<word> foMap;
107 
109 
110  forAll(etcDirs, ed)
111  {
112  listDir(etcDirs[ed], foMap);
113  }
114 
115  Info<< nl
116  << "Available configured functionObjects:"
117  << foMap.sortedToc()
118  << nl;
119 }
120 
121 
123 (
124  const word& funcName,
125  const word& region
126 )
127 {
128  // First check if there is a functionObject dictionary file in the
129  // case system directory
130  fileName dictFile
131  (
132  stringOps::expand("$FOAM_CASE")/"system"/region/funcName
133  );
134 
135  if (isFile(dictFile))
136  {
137  return dictFile;
138  }
139  else
140  {
142 
143  forAll(etcDirs, i)
144  {
145  dictFile = search(funcName, etcDirs[i]);
146  if (!dictFile.empty())
147  {
148  return dictFile;
149  }
150  }
151  }
152 
153  return fileName::null;
154 }
155 
156 
158 (
159  const word& funcName,
160  const word& region
161 )
162 {
163  if (region == word::null)
164  {
165  return findRegionDict(funcName);
166  }
167  else
168  {
169  fileName dictFile(findRegionDict(funcName, region));
170 
171  if (dictFile != fileName::null)
172  {
173  return dictFile;
174  }
175  else
176  {
177  return findRegionDict(funcName);
178  }
179  }
180 }
181 
182 
184 (
185  const string& funcNameArgs,
186  dictionary& functionsDict,
187  HashSet<word>& requiredFields,
188  const word& region
189 )
190 {
191  // Parse the optional functionObject arguments:
192  // 'Q(U)' -> funcName = Q; args = (U); field = U
193  //
194  // Supports named arguments:
195  // 'patchAverage(patch=inlet, p)' -> funcName = patchAverage;
196  // args = (patch=inlet, p); field = p
197 
198  word funcName(funcNameArgs);
199 
200  int argLevel = 0;
201  wordList args;
202 
203  List<Tuple2<word, string>> namedArgs;
204  bool namedArg = false;
205  word argName;
206 
208  word::size_type i = 0;
209 
210  for
211  (
212  word::const_iterator iter = funcNameArgs.begin();
213  iter != funcNameArgs.end();
214  ++iter
215  )
216  {
217  char c = *iter;
218 
219  if (c == '(')
220  {
221  if (argLevel == 0)
222  {
223  funcName = funcNameArgs(start, i - start);
224  start = i+1;
225  }
226  ++argLevel;
227  }
228  else if (c == ',' || c == ')')
229  {
230  if (argLevel == 1)
231  {
232  if (namedArg)
233  {
234  namedArgs.append
235  (
237  (
238  argName,
239  funcNameArgs(start, i - start)
240  )
241  );
242  namedArg = false;
243  }
244  else
245  {
246  args.append
247  (
248  string::validate<word>(funcNameArgs(start, i - start))
249  );
250  }
251  start = i+1;
252  }
253 
254  if (c == ')')
255  {
256  if (argLevel == 1)
257  {
258  break;
259  }
260  --argLevel;
261  }
262  }
263  else if (c == '=')
264  {
265  argName = string::validate<word>(funcNameArgs(start, i - start));
266  start = i+1;
267  namedArg = true;
268  }
269 
270  ++i;
271  }
272 
273  // Search for the functionObject dictionary
274  fileName path = findDict(funcName, region);
275 
276  if (path == fileName::null)
277  {
279  << "Cannot find functionObject file " << funcName << endl;
280  return false;
281  }
282 
283  // Read the functionObject dictionary
284  // IFstream fileStream(path);
285  autoPtr<ISstream> fileStreamPtr(fileHandler().NewIFstream(path));
286  ISstream& fileStream = fileStreamPtr();
287 
288  dictionary funcsDict(funcName, functionsDict, fileStream);
289  dictionary* funcDictPtr = &funcsDict;
290 
291  if (funcsDict.found(funcName) && funcsDict.isDict(funcName))
292  {
293  funcDictPtr = &funcsDict.subDict(funcName);
294  }
295 
296  dictionary& funcDict = *funcDictPtr;
297 
298  // Insert the 'field' and/or 'fields' entry corresponding to the optional
299  // arguments or read the 'field' or 'fields' entry and add the required
300  // fields to requiredFields
301  if (args.size() == 1)
302  {
303  funcDict.set("field", args[0]);
304  funcDict.set("fields", args);
305  requiredFields.insert(args[0]);
306  }
307  else if (args.size() > 1)
308  {
309  funcDict.set("fields", args);
310  requiredFields.insert(args);
311  }
312  else if (funcDict.found("field"))
313  {
314  requiredFields.insert(word(funcDict.lookup("field")));
315  }
316  else if (funcDict.found("fields"))
317  {
318  requiredFields.insert(wordList(funcDict.lookup("fields")));
319  }
320 
321  // Insert named arguments
322  forAll(namedArgs, i)
323  {
324  IStringStream entryStream
325  (
326  namedArgs[i].first() + ' ' + namedArgs[i].second() + ';'
327  );
328  funcDict.set(entry::New(entryStream).ptr());
329  }
330 
331  // Insert the region name if specified
332  if (region != word::null)
333  {
334  funcDict.set("region", region);
335  }
336 
337  // Merge this functionObject dictionary into functionsDict
338  const word funcNameArgsWord = string::validate<word>(funcNameArgs);
339  dictionary funcArgsDict;
340  funcArgsDict.add(funcNameArgsWord, funcDict);
341  functionsDict.merge(funcArgsDict);
342  functionsDict.subDict(funcNameArgsWord).name() = funcDict.name();
343 
344  return true;
345 }
346 
347 
348 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
349 
351 (
352  const Time& t,
353  const bool execution
354 )
355 :
357  digests_(),
358  indices_(),
359  time_(t),
360  parentDict_(t.controlDict()),
361  execution_(execution),
362  updated_(false)
363 {}
364 
365 
367 (
368  const Time& t,
369  const dictionary& parentDict,
370  const bool execution
371 )
372 :
374  digests_(),
375  indices_(),
376  time_(t),
377  parentDict_(parentDict),
378  execution_(execution),
379  updated_(false)
380 {}
381 
382 
384 (
385  const argList& args,
386  const Time& runTime,
387  dictionary& controlDict,
388  HashSet<word>& requiredFields
389 )
390 {
391  autoPtr<functionObjectList> functionsPtr;
392 
393  controlDict.add
394  (
395  dictionaryEntry("functions", controlDict, dictionary::null)
396  );
397 
398  dictionary& functionsDict = controlDict.subDict("functions");
399 
400  word region = word::null;
401 
402  // Set the region name if specified
403  if (args.optionFound("region"))
404  {
405  region = args["region"];
406  }
407 
408  if
409  (
410  args.optionFound("dict")
411  || args.optionFound("func")
412  || args.optionFound("funcs")
413  )
414  {
415  if (args.optionFound("dict"))
416  {
417  controlDict.merge
418  (
420  (
421  IOobject
422  (
423  args["dict"],
424  runTime,
426  )
427  )
428  );
429  }
430 
431  if (args.optionFound("func"))
432  {
434  (
435  args["func"],
436  functionsDict,
437  requiredFields,
438  region
439  );
440  }
441 
442  if (args.optionFound("funcs"))
443  {
444  wordList funcs(args.optionLookup("funcs")());
445 
446  forAll(funcs, i)
447  {
449  (
450  funcs[i],
451  functionsDict,
452  requiredFields,
453  region
454  );
455  }
456  }
457 
458  functionsPtr.reset(new functionObjectList(runTime, controlDict));
459  }
460  else
461  {
462  functionsPtr.reset(new functionObjectList(runTime));
463  }
464 
465  functionsPtr->start();
466 
467  return functionsPtr;
468 }
469 
470 
471 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
472 
474 {}
475 
476 
477 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
478 
480 {
482  digests_.clear();
483  indices_.clear();
484  updated_ = false;
485 }
486 
487 
489 {
490  forAll(*this, objectI)
491  {
492  if (operator[](objectI).name() == name)
493  {
494  return objectI;
495  }
496  }
497 
498  return -1;
499 }
500 
501 
503 {
504  execution_ = true;
505 }
506 
507 
509 {
510  // For safety, also force a read() when execution is turned back on
511  updated_ = execution_ = false;
512 }
513 
514 
516 {
517  return execution_;
518 }
519 
520 
522 {
523  return read();
524 }
525 
526 
528 {
529  bool ok = true;
530 
531  if (execution_)
532  {
533  if (!updated_)
534  {
535  read();
536  }
537 
538  forAll(*this, objectI)
539  {
540  ok = operator[](objectI).execute() && ok;
541  ok = operator[](objectI).write() && ok;
542  }
543  }
544 
545  return ok;
546 }
547 
548 
550 {
551  bool ok = true;
552 
553  if (execution_)
554  {
555  if (!updated_)
556  {
557  read();
558  }
559 
560  forAll(*this, objectI)
561  {
562  ok = operator[](objectI).end() && ok;
563  }
564  }
565 
566  return ok;
567 }
568 
569 
571 {
572  bool set = true;
573 
574  if (execution_)
575  {
576  if (!updated_)
577  {
578  read();
579  }
580 
581  wordList names;
582 
583  forAll(*this, objectI)
584  {
585  if (operator[](objectI).setTimeStep())
586  {
587  names.append(operator[](objectI).name());
588  set = true;
589  }
590  }
591 
592  if (names.size() > 1)
593  {
594  WarningInFunction << "Multiple function objects (" << names[0];
595  for (label i = 1; i < names.size(); ++ i)
596  {
597  WarningInFunction << ", " << names[i];
598  }
599  WarningInFunction << ") are setting the time step." << endl;
600  }
601  }
602 
603  return set;
604 }
605 
606 
608 {
609  scalar result = vGreat;
610 
611  if (execution_)
612  {
613  if (!updated_)
614  {
615  read();
616  }
617 
618  forAll(*this, objectI)
619  {
620  result = min(result, operator[](objectI).timeToNextWrite());
621  }
622  }
623 
624  return result;
625 }
626 
627 
629 {
630  bool ok = true;
631  updated_ = execution_;
632 
633  // Avoid reading/initializing if execution is off
634  if (!execution_)
635  {
636  return true;
637  }
638 
639  // Update existing and add new functionObjects
640  const entry* entryPtr = parentDict_.lookupEntryPtr
641  (
642  "functions",
643  false,
644  false
645  );
646 
647  if (entryPtr)
648  {
649  PtrList<functionObject> newPtrs;
650  List<SHA1Digest> newDigs;
651  HashTable<label> newIndices;
652 
653  label nFunc = 0;
654 
655  if (!entryPtr->isDict())
656  {
657  FatalIOErrorInFunction(parentDict_)
658  << "'functions' entry is not a dictionary"
659  << exit(FatalIOError);
660  }
661 
662  const dictionary& functionsDict = entryPtr->dict();
663 
664  const_cast<Time&>(time_).libs().open
665  (
666  functionsDict,
667  "libs",
668  functionObject::dictionaryConstructorTablePtr_
669  );
670 
671  newPtrs.setSize(functionsDict.size());
672  newDigs.setSize(functionsDict.size());
673 
674  forAllConstIter(dictionary, functionsDict, iter)
675  {
676  const word& key = iter().keyword();
677 
678  if (!iter().isDict())
679  {
680  if (key != "libs")
681  {
682  IOWarningInFunction(parentDict_)
683  << "Entry " << key << " is not a dictionary" << endl;
684  }
685 
686  continue;
687  }
688 
689  const dictionary& dict = iter().dict();
690  bool enabled = dict.lookupOrDefault("enabled", true);
691 
692  newDigs[nFunc] = dict.digest();
693 
694  label oldIndex;
695  functionObject* objPtr = remove(key, oldIndex);
696 
697  if (objPtr)
698  {
699  if (enabled)
700  {
701  // Dictionary changed for an existing functionObject
702  if (newDigs[nFunc] != digests_[oldIndex])
703  {
704  ok = objPtr->read(dict) && ok;
705  }
706  }
707  else
708  {
709  // Delete the disabled functionObject
710  delete objPtr;
711  objPtr = nullptr;
712  continue;
713  }
714  }
715  else if (enabled)
716  {
718 
721  try
722  {
723  if
724  (
725  dict.found("writeControl")
726  || dict.found("outputControl")
727  )
728  {
729  foPtr.set
730  (
731  new functionObjects::timeControl(key, time_, dict)
732  );
733  }
734  else
735  {
736  foPtr = functionObject::New(key, time_, dict);
737  }
738  }
739  catch (Foam::IOerror& ioErr)
740  {
741  Info<< ioErr << nl << endl;
742  ::exit(1);
743  }
744  catch (Foam::error& err)
745  {
747  << "Caught FatalError " << err << nl << endl;
748  }
751 
752  if (foPtr.valid())
753  {
754  objPtr = foPtr.ptr();
755  }
756  else
757  {
758  ok = false;
759  }
760  }
761 
762  // Insert active functionObjects into the list
763  if (objPtr)
764  {
765  newPtrs.set(nFunc, objPtr);
766  newIndices.insert(key, nFunc);
767  nFunc++;
768  }
769  }
770 
771  newPtrs.setSize(nFunc);
772  newDigs.setSize(nFunc);
773 
774  // Updating the PtrList of functionObjects deletes any
775  // existing unused functionObjects
777  digests_.transfer(newDigs);
778  indices_.transfer(newIndices);
779  }
780  else
781  {
783  digests_.clear();
784  indices_.clear();
785  }
786 
787  return ok;
788 }
789 
790 
792 {
793  if (execution_)
794  {
795  forAll(*this, objectI)
796  {
797  operator[](objectI).updateMesh(mpm);
798  }
799  }
800 }
801 
802 
804 {
805  if (execution_)
806  {
807  forAll(*this, objectI)
808  {
809  operator[](objectI).movePoints(mesh);
810  }
811  }
812 }
813 
814 
815 // ************************************************************************* //
bool read()
Read and set the function objects if their data have changed.
A HashTable with keys but without contents.
Definition: HashSet.H:59
dictionary dict
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:438
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping.
Definition: stringOps.C:75
static bool readFunctionObject(const string &funcNameArgs0, dictionary &functionsDict, HashSet< word > &requiredFields, const word &region=word::null)
Read the specified functionObject configuration dictionary parsing.
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:59
A class for handling file names.
Definition: fileName.H:79
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:477
bool set(const label) const
Is element set.
Definition: PtrListI.H:65
functionObjectList(const Time &runTime, const bool execution=true)
Construct from Time and the execution setting.
SHA1Digest digest() const
Return the SHA1 digest of the dictionary contents.
Definition: dictionary.C:404
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
void reset(T *=nullptr)
If object pointer already set, delete object and set to given.
Definition: autoPtrI.H:114
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
Definition: HashTable.H:112
void off()
Switch the function objects off.
scalar timeToNextWrite()
Return the time to the next write.
error FatalError
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
static void list()
Print a list of functionObject configuration files in.
bool isFile(const fileName &, const bool checkVariants=true, const bool followLink=true)
Does the name exist as a file in the file system?
Definition: POSIX.C:555
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:163
static const dictionary null
Null dictionary.
Definition: dictionary.H:223
static const fileName null
An empty fileName.
Definition: fileName.H:97
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
Definition: entryIO.C:107
const T & operator[](const label) const
Return element const reference.
Definition: UPtrListI.H:96
bool empty() const
Return true if the UPtrList is empty (ie, size() is zero)
Definition: UPtrListI.H:36
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:256
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
void on()
Switch the function objects on.
void transfer(HashTable< T, Key, Hash > &)
Transfer the contents of the argument table into this table.
Definition: HashTable.C:513
T * ptr()
Return object pointer for reuse.
Definition: autoPtrI.H:90
Abstract base-class for Time/database function objects.
static fileName findRegionDict(const word &funcPath, const word &region=word::null)
Search for functionObject dictionary file for given region.
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:108
A keyword and a list of tokens is a &#39;dictionaryEntry&#39;.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
bool start()
Called at the start of the time-loop.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
bool isDict(const word &) const
Check if entry is a sub-dictionary.
Definition: dictionary.C:653
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:821
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
Definition: HashTable.C:371
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:52
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:699
Class to handle errors and exceptions in a simple, consistent stream-based manner.
Definition: error.H:66
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Definition: HashTableI.H:80
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Definition: HashTable.C:142
bool execute()
Called at each ++ or += of the time-loop.
dynamicFvMesh & mesh
const fileName & name() const
Return the dictionary name.
Definition: dictionary.H:111
void throwExceptions()
Definition: error.H:122
A class for handling words, derived from string.
Definition: word.H:59
Functions to search &#39;etc&#39; directories for configuration files etc.
Extract command arguments and options from the supplied argc and argv parameters. ...
Definition: argList.H:102
void clear()
Clear all entries from table.
Definition: HashTable.C:468
void append(const T &)
Append an element at the end of the list.
Definition: ListI.H:177
static const word null
An empty word.
Definition: word.H:77
const fileOperation & fileHandler()
Get current file handler.
fileNameList readDir(const fileName &, const fileType=fileType::file, const bool filterVariants=true, const bool followLink=true)
Read a directory and return the entries as a string list.
Definition: POSIX.C:662
graph_traits< Graph >::vertices_size_type size_type
Definition: SloanRenumber.C:73
bool valid() const
Return true if the autoPtr valid (ie, the pointer is set)
Definition: autoPtrI.H:83
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:29
Report an I/O error.
Definition: error.H:196
void setSize(const label)
Reset size of PtrList. If extending the PtrList, new entries are.
Definition: PtrList.C:131
virtual bool isDict() const
Return true if this entry is a dictionary.
Definition: entry.H:156
virtual bool read(const dictionary &)
Read and set the function object if its data have changed.
static const char nl
Definition: Ostream.H:265
void set(T *)
Set pointer to that given.
Definition: autoPtrI.H:99
labelList f(nPoints)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
void clear()
Clear the list of function objects.
List< word > wordList
A List of words.
Definition: fileName.H:54
void setSize(const label)
Reset size of List.
Definition: List.C:281
bool setTimeStep()
Override the time-step value.
bool status() const
Return the execution status (on/off) of the function objects.
Generic input stream.
Definition: ISstream.H:51
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:331
Input from memory buffer stream.
Definition: IStringStream.H:49
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Definition: HashTable.C:217
const dimensionedScalar c
Speed of light in a vacuum.
void transfer(PtrList< T > &)
Transfer the contents of the argument PtrList into this PtrList.
Definition: PtrList.C:189
static autoPtr< functionObject > New(const word &name, const Time &, const dictionary &)
Select from dictionary, based on its "type" entry.
const dictionary & controlDict() const
Definition: Time.H:271
void set(entry *)
Assign a new entry, overwrite any existing entry.
Definition: dictionary.C:948
void clear()
Clear the PtrList, i.e. set size to zero deleting all the.
Definition: PtrList.C:174
messageStream Info
bool merge(const dictionary &)
Merge entries from the given dictionary.
Definition: dictionary.C:1097
fileName search(const word &file, const fileName &directory)
Recursively search the given directory for the file.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
label findObjectID(const word &name) const
Find the ID of a given function object by name.
void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
static autoPtr< functionObjectList > New(const argList &args, const Time &runTime, dictionary &controlDict, HashSet< word > &requiredFields)
Construct and return a functionObjectList for an application.
friend class iterator
Declare friendship with the iterator.
Definition: HashTable.H:194
Foam::argList args(argc, argv)
void movePoints(const polyMesh &mesh)
Update for changes of mesh.
List< fileName > fileNameList
A List of fileNames.
Definition: fileNameList.H:50
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:92
static fileName functionObjectDictPath
Default relative path to the directory structure.
bool end()
Called when Time::run() determines that the time-loop exits.
A keyword and a list of tokens is an &#39;entry&#39;.
Definition: entry.H:65
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:583
static fileName findDict(const word &funcName, const word &region=word::null)
Search for functionObject dictionary file for given region.
void dontThrowExceptions()
Definition: error.H:127
fileName path(UMean.rootPath()/UMean.caseName()/functionObjects::writeFile::outputPrefix/"graphs"/UMean.instance())
IStringStream optionLookup(const word &opt) const
Return an IStringStream from the named option.
Definition: argListI.H:114
IOerror FatalIOError
fileNameList findEtcDirs(const fileName &local=fileName::null)
Search for directories from user/group/shipped directories.
Definition: etcFiles.C:32
T & first()
Return reference to the first element of the list.
Definition: UPtrListI.H:43