changeDictionary.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 | Copyright (C) 2011-2015 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 Application
25  changeDictionary
26 
27 Description
28  Utility to change dictionary entries, e.g. can be used to change the patch
29  type in the field and polyMesh/boundary files.
30 
31  Reads dictionaries (fields) and entries to change from a dictionary.
32  E.g. to make the \em movingWall a \em fixedValue for \em p but all other
33  \em Walls a zeroGradient boundary condition, the
34  \c system/changeDictionaryDict would contain the following:
35  \verbatim
36  dictionaryReplacement
37  {
38  p // field to change
39  {
40  boundaryField
41  {
42  ".*Wall" // entry to change
43  {
44  type zeroGradient;
45  }
46  movingWall // entry to change
47  {
48  type fixedValue;
49  value uniform 123.45;
50  }
51  }
52  }
53  }
54  \endverbatim
55  Replacement entries starting with '~' will remove the entry.
56 
57 Usage
58 
59  - changeDictionary [OPTION]
60 
61  \param -literalRE \n
62  Do not interpret regular expressions or patchGroups;
63  treat them as any other keyword.
64 
65  \param -enableFunctionEntries \n
66  By default all dictionary preprocessing of fields is disabled
67 
68  \param -disablePatchGroups \n
69  By default all keys are also checked for being patchGroups
70 
71 \*---------------------------------------------------------------------------*/
72 
73 #include "argList.H"
74 #include "IOobjectList.H"
75 #include "IOPtrList.H"
76 #include "volFields.H"
77 #include "stringListOps.H"
78 #include "timeSelector.H"
79 
80 using namespace Foam;
81 
82 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83 
84 namespace Foam
85 {
87 }
88 
89 
90 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
91 
92 // Extract groupPatch (= shortcut) info from boundary file info
94 {
95  HashTable<wordList, word> groupToPatch;
96 
97  forAllConstIter(dictionary, boundaryDict, iter)
98  {
99  const word& patchName = iter().keyword();
100  const dictionary& patchDict = iter().dict();
101 
102  wordList groups;
103  if (patchDict.readIfPresent("inGroups", groups))
104  {
105  forAll(groups, i)
106  {
107  HashTable<wordList, word>::iterator fndGroup = groupToPatch.find
108  (
109  groups[i]
110  );
111  if (fndGroup == groupToPatch.end())
112  {
113  groupToPatch.insert(groups[i], wordList(1, patchName));
114  }
115  else
116  {
117  fndGroup().append(patchName);
118  }
119  }
120  }
121  }
122  return groupToPatch;
123 }
124 
125 
126 bool merge
127 (
128  dictionary&,
129  const dictionary&,
130  const bool,
132 );
133 
134 
135 // Add thisEntry to dictionary thisDict.
136 bool addEntry
137 (
138  dictionary& thisDict,
139  entry& thisEntry,
140  const entry& mergeEntry,
141  const bool literalRE,
142  const HashTable<wordList, word>& shortcuts
143 )
144 {
145  bool changed = false;
146 
147  // Recursively merge sub-dictionaries
148  // TODO: merge without copying
149  if (thisEntry.isDict() && mergeEntry.isDict())
150  {
151  if
152  (
153  merge
154  (
155  const_cast<dictionary&>(thisEntry.dict()),
156  mergeEntry.dict(),
157  literalRE,
158  shortcuts
159  )
160  )
161  {
162  changed = true;
163  }
164  }
165  else
166  {
167  // Should use in-place modification instead of adding
168  thisDict.add(mergeEntry.clone(thisDict).ptr(), true);
169  changed = true;
170  }
171 
172  return changed;
173 }
174 
175 
176 
177 // List of indices into thisKeys
179 (
180  const HashTable<wordList, word>& shortcuts,
181  const wordList& shortcutNames,
182  const wordList& thisKeys,
183  const keyType& key
184 )
185 {
186  labelList matches;
187 
188  if (key.isPattern())
189  {
190  // Wildcard match
191  matches = findStrings(key, thisKeys);
192 
193  }
194  else if (shortcuts.size())
195  {
196  // See if patchGroups expand to valid thisKeys
197  labelList indices = findStrings(key, shortcutNames);
198  forAll(indices, i)
199  {
200  const word& name = shortcutNames[indices[i]];
201  const wordList& keys = shortcuts[name];
202  forAll(keys, j)
203  {
204  label index = findIndex(thisKeys, keys[j]);
205  if (index != -1)
206  {
207  matches.append(index);
208  }
209  }
210  }
211  }
212  return matches;
213 }
214 
215 
216 // Dictionary merging/editing.
217 // literalRE:
218 // - true: behave like dictionary::merge, i.e. add regexps just like
219 // any other key.
220 // - false : interpret wildcard as a rule for items to be matched.
221 bool merge
222 (
223  dictionary& thisDict,
224  const dictionary& mergeDict,
225  const bool literalRE,
226  const HashTable<wordList, word>& shortcuts
227 )
228 {
229  const wordList shortcutNames(shortcuts.toc());
230 
231  bool changed = false;
232 
233  // Save current (non-wildcard) keys before adding items.
234  HashSet<word> thisKeysSet;
235  {
236  List<keyType> keys = thisDict.keys(false);
237  forAll(keys, i)
238  {
239  thisKeysSet.insert(keys[i]);
240  }
241  }
242 
243  // Pass 1. All literal matches
244 
245  forAllConstIter(IDLList<entry>, mergeDict, mergeIter)
246  {
247  const keyType& key = mergeIter().keyword();
248 
249  if (key[0] == '~')
250  {
251  word eraseKey = key(1, key.size()-1);
252  if (thisDict.remove(eraseKey))
253  {
254  // Mark thisDict entry as having been match for wildcard
255  // handling later on.
256  thisKeysSet.erase(eraseKey);
257  }
258  changed = true;
259  }
260  else if (literalRE || !(key.isPattern() || shortcuts.found(key)))
261  {
262  entry* entryPtr = thisDict.lookupEntryPtr
263  (
264  key,
265  false, // recursive
266  false // patternMatch
267  );
268 
269  if (entryPtr)
270  {
271 
272  // Mark thisDict entry as having been match for wildcard
273  // handling later on.
274  thisKeysSet.erase(entryPtr->keyword());
275 
276  if
277  (
278  addEntry
279  (
280  thisDict,
281  *entryPtr,
282  mergeIter(),
283  literalRE,
284  shortcuts
285  )
286  )
287  {
288  changed = true;
289  }
290  }
291  else
292  {
293  // not found - just add
294  thisDict.add(mergeIter().clone(thisDict).ptr());
295  changed = true;
296  }
297  }
298  }
299 
300 
301  // Pass 2. Wildcard or shortcut matches (if any) on any non-match keys.
302 
303  if (!literalRE && thisKeysSet.size() > 0)
304  {
305  // Pick up remaining dictionary entries
306  wordList thisKeys(thisKeysSet.toc());
307 
308  forAllConstIter(IDLList<entry>, mergeDict, mergeIter)
309  {
310  const keyType& key = mergeIter().keyword();
311 
312  if (key[0] == '~')
313  {
314  word eraseKey = key(1, key.size()-1);
315 
316  // List of indices into thisKeys
317  labelList matches
318  (
320  (
321  shortcuts,
322  shortcutNames,
323  thisKeys,
324  eraseKey
325  )
326  );
327 
328  // Remove all matches
329  forAll(matches, i)
330  {
331  const word& thisKey = thisKeys[matches[i]];
332  thisKeysSet.erase(thisKey);
333  }
334  changed = true;
335  }
336  else
337  {
338  // List of indices into thisKeys
339  labelList matches
340  (
342  (
343  shortcuts,
344  shortcutNames,
345  thisKeys,
346  key
347  )
348  );
349 
350  // Add all matches
351  forAll(matches, i)
352  {
353  const word& thisKey = thisKeys[matches[i]];
354 
355  entry& thisEntry = const_cast<entry&>
356  (
357  thisDict.lookupEntry(thisKey, false, false)
358  );
359 
360  if
361  (
362  addEntry
363  (
364  thisDict,
365  thisEntry,
366  mergeIter(),
367  literalRE,
368  HashTable<wordList, word>(0) // no shortcuts
369  // at deeper levels
370  )
371  )
372  {
373  changed = true;
374  }
375  }
376  }
377  }
378  }
379 
380  return changed;
381 }
382 
383 
384 
385 int main(int argc, char *argv[])
386 {
387  #include "addDictOption.H"
389  (
390  "instance",
391  "name",
392  "override instance setting (default is the time name)"
393  );
394 
395  // Add explicit time option
397 
399  (
400  "literalRE",
401  "treat regular expressions literally (i.e., as a keyword)"
402  );
404  (
405  "enableFunctionEntries",
406  "enable expansion of dictionary directives - #include, #codeStream etc"
407  );
409  (
410  "disablePatchGroups",
411  "disable matching keys to patch groups"
412  );
413 
414  #include "addRegionOption.H"
415 
416  #include "setRootCase.H"
417  #include "createTime.H"
418 
419  // Optionally override controlDict time with -time options
421  if (times.size() < 1)
422  {
424  << "No times selected." << exit(FatalError);
425  }
426  runTime.setTime(times[0], 0);
427  word instance = args.optionLookupOrDefault("instance", runTime.timeName());
428 
429  #include "createNamedMesh.H"
430 
431  const bool literalRE = args.optionFound("literalRE");
432  if (literalRE)
433  {
434  Info<< "Not interpreting any regular expressions (RE)"
435  << " in the changeDictionaryDict." << endl
436  << "Instead they are handled as any other entry, i.e. added if"
437  << " not present." << endl;
438  }
439 
440  const bool enableEntries = args.optionFound("enableFunctionEntries");
441  if (enableEntries)
442  {
443  Info<< "Allowing dictionary preprocessing ('#include', '#codeStream')."
444  << endl;
445  }
446 
447  int oldFlag = entry::disableFunctionEntries;
448  if (!enableEntries)
449  {
450  // By default disable dictionary expansion for fields
452  }
453 
454 
455  const bool disablePatchGroups = args.optionFound("disablePatchGroups");
456  if (disablePatchGroups)
457  {
458  Info<< "Not interpreting any keys in the changeDictionary"
459  << " as patchGroups"
460  << endl;
461  }
462 
463 
464  fileName regionPrefix = "";
466  {
467  regionPrefix = regionName;
468  }
469 
470 
471  // Make sure we do not use the master-only reading since we read
472  // fields (different per processor) as dictionaries.
474 
475 
476  // Get the replacement rules from a dictionary
477 
478  const word dictName("changeDictionaryDict");
479  #include "setSystemMeshDictionaryIO.H"
481 
482  const dictionary& replaceDicts = dict.subDict("dictionaryReplacement");
483  Info<< "Read dictionary " << dict.name()
484  << " with replacements for dictionaries "
485  << replaceDicts.toc() << endl;
486 
487 
488 
489  // Always read boundary to get patch groups
490  // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
491 
492  Info<< "Reading polyMesh/boundary file to extract patch names"
493  << endl;
494 
495  // Read PtrList of dictionary as dictionary.
496  const word oldTypeName = IOPtrList<entry>::typeName;
498  IOPtrList<entry> dictList
499  (
500  IOobject
501  (
502  "boundary",
503  runTime.findInstance
504  (
505  regionPrefix/polyMesh::meshSubDir,
506  "boundary",
508  ),
510  mesh,
513  false
514  )
515  );
516  const_cast<word&>(IOPtrList<entry>::typeName) = oldTypeName;
517  // Fake type back to what was in field
518  const_cast<word&>(dictList.type()) = dictList.headerClassName();
519 
520  // Temporary convert to dictionary
521  dictionary fieldDict;
522  forAll(dictList, i)
523  {
524  fieldDict.add(dictList[i].keyword(), dictList[i].dict());
525  }
526 
527  if (dictList.size())
528  {
529  Info<< "Loaded dictionary " << dictList.name()
530  << " with entries " << fieldDict.toc() << endl;
531  }
532 
533  // Extract any patchGroups information (= shortcut for set of
534  // patches)
535  HashTable<wordList, word> patchGroups;
536  if (!disablePatchGroups)
537  {
538  patchGroups = extractPatchGroups(fieldDict);
539  if (patchGroups.size())
540  {
541  Info<< "Extracted patch groups:" << endl;
542  wordList groups(patchGroups.sortedToc());
543  forAll(groups, i)
544  {
545  Info<< " group " << groups[i] << " with patches "
546  << patchGroups[groups[i]] << endl;
547  }
548  }
549  }
550 
551 
552  // Every replacement is a dictionary name and a keyword in this
553 
554  forAllConstIter(dictionary, replaceDicts, fieldIter)
555  {
556  const word& fieldName = fieldIter().keyword();
557  Info<< "Replacing entries in dictionary " << fieldName << endl;
558 
559  // Handle 'boundary' specially:
560  // - is PtrList of dictionaries
561  // - is in polyMesh/
562  if (fieldName == "boundary")
563  {
564  Info<< "Special handling of " << fieldName
565  << " as polyMesh/boundary file." << endl;
566 
567  // Get the replacement dictionary for the field
568  const dictionary& replaceDict = fieldIter().dict();
569  Info<< "Merging entries from " << replaceDict.toc() << endl;
570 
571  // Merge the replacements in
572  merge(fieldDict, replaceDict, literalRE, patchGroups);
573 
574  Info<< "fieldDict:" << fieldDict << endl;
575 
576  // Convert back into dictList
577  wordList doneKeys(dictList.size());
578 
579  label nEntries = fieldDict.size();
580 
581  forAll(dictList, i)
582  {
583  doneKeys[i] = dictList[i].keyword();
584  dictList.set
585  (
586  i,
587  fieldDict.lookupEntry
588  (
589  doneKeys[i],
590  false,
591  true
592  ).clone()
593  );
594  fieldDict.remove(doneKeys[i]);
595  }
596 
597  // Add remaining entries
598  label sz = dictList.size();
599  dictList.setSize(nEntries);
600  forAllConstIter(dictionary, fieldDict, iter)
601  {
602  dictList.set(sz++, iter().clone());
603  }
604 
605  Info<< "Writing modified " << fieldName << endl;
606  dictList.writeObject
607  (
608  runTime.writeFormat(),
609  runTime.writeFormat(),
611  );
612  }
613  else
614  {
615  // Read dictionary
616  // Note: disable class type checking so we can load field
617  Info<< "Loading dictionary " << fieldName << endl;
618  const word oldTypeName = IOdictionary::typeName;
619  const_cast<word&>(IOdictionary::typeName) = word::null;
620 
621  IOobject fieldHeader
622  (
623  fieldName,
624  instance,
625  mesh,
628  false
629  );
630 
631  if (fieldHeader.headerOk())
632  {
633  IOdictionary fieldDict(fieldHeader);
634 
635  const_cast<word&>(IOdictionary::typeName) = oldTypeName;
636 
637  // Fake type back to what was in field
638  const_cast<word&>(fieldDict.type()) =
639  fieldDict.headerClassName();
640 
641  Info<< "Loaded dictionary " << fieldName
642  << " with entries " << fieldDict.toc() << endl;
643 
644  // Get the replacement dictionary for the field
645  const dictionary& replaceDict = fieldIter().dict();
646  Info<< "Merging entries from " << replaceDict.toc() << endl;
647 
648  // Merge the replacements in
649  merge(fieldDict, replaceDict, literalRE, patchGroups);
650 
651  Info<< "Writing modified fieldDict " << fieldName << endl;
652  fieldDict.regIOobject::write();
653  }
654  else
655  {
657  << "Requested field to change " << fieldName
658  << " does not exist in " << fieldHeader.path() << endl;
659  }
660  }
661  }
662 
664 
665  Info<< endl;
666 
667  Info<< "End\n" << endl;
668 
669  return 0;
670 }
671 
672 
673 // ************************************************************************* //
Foam::entry
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:65
volFields.H
Foam::IOdictionary
IOdictionary is derived from dictionary and IOobject to give the dictionary automatic IO functionalit...
Definition: IOdictionary.H:53
Foam::IOobject
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:91
Foam::dictionary::lookupEntry
const entry & lookupEntry(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream if present otherwise error.
Definition: dictionary.C:426
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::IOPtrList
A PtrList of objects of type <T> with automated input and output.
Definition: IOPtrList.H:50
Foam::HashTable::iterator
An STL-conforming iterator.
Definition: HashTable.H:415
Foam::entry::keyword
const keyType & keyword() const
Return keyword.
Definition: entry.H:120
Foam::HashTable::toc
List< Key > toc() const
Return the table of contents.
Definition: HashTable.C:201
Foam::argList::addOption
static void addOption(const word &opt, const string &param="", const string &usage="")
Add to an option to validOptions with usage information.
Definition: argList.C:108
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:306
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:406
Foam::findIndex
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurence of given element and return index,.
Foam::dictionaryName::name
const fileName & name() const
Return the dictionary name.
Definition: dictionary.H:103
Foam::keyType::isPattern
bool isPattern() const
Should be treated as a match rather than a literal string.
Definition: keyTypeI.H:76
Foam::dictionary::readIfPresent
bool readIfPresent(const word &, T &, bool recursive=false, bool patternMatch=true) const
Find an entry if present, and assign to T.
Definition: dictionaryTemplates.C:94
Foam::polyMesh::meshSubDir
static word meshSubDir
Return the mesh sub-directory name (usually "polyMesh")
Definition: polyMesh.H:309
Foam::argList::addBoolOption
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Definition: argList.C:98
Foam::HashTable::insert
bool insert(const Key &, const T &newElmt)
Insert a new hashedEntry.
Definition: HashTableI.H:80
Foam::dictionary::remove
bool remove(const word &)
Remove an entry specified by keyword.
Definition: dictionary.C:881
IOobjectList.H
extractPatchGroups
HashTable< wordList, word > extractPatchGroups(const dictionary &boundaryDict)
Definition: changeDictionary.C:93
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:251
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
setSystemMeshDictionaryIO.H
Foam::IOobject::NO_WRITE
@ NO_WRITE
Definition: IOobject.H:118
forAllConstIter
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
Definition: pEqn.H:39
addDictOption.H
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:54
Foam::dictionary::keys
List< keyType > keys(bool patterns=false) const
Return the list of available keys or patterns.
Definition: dictionary.C:711
Foam::IOobject::MUST_READ_IF_MODIFIED
@ MUST_READ_IF_MODIFIED
Definition: IOobject.H:109
dictName
const word dictName("particleTrackDict")
Foam::keyType
A class for handling keywords in dictionaries.
Definition: keyType.H:56
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::regIOobject::timeStamp
@ timeStamp
Definition: regIOobject.H:70
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:59
Foam::IDLList< entry >
Foam::entry::isDict
virtual bool isDict() const
Return true if this entry is a dictionary.
Definition: entry.H:153
Foam::List::append
void append(const T &)
Append an element at the end of the list.
IOPtrList.H
Foam::Info
messageStream Info
argList.H
addRegionOption.H
Foam::HashTable< nil, word, string::hash >::erase
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
Foam::timeSelector::selectIfPresent
static instantList selectIfPresent(Time &runTime, const argList &args)
If any time option provided return the set of times (as select0)
Definition: timeSelector.C:284
Foam::argList::optionLookupOrDefault
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
Definition: argListI.H:237
main
int main(int argc, char *argv[])
Definition: changeDictionary.C:435
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::FatalError
error FatalError
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::HashTable::size
label size() const
Return number of elements in table.
Definition: HashTableI.H:65
createNamedMesh.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::HashTable::found
bool found(const Key &) const
Return true if hashedEntry is found in table.
Definition: HashTable.C:109
addEntry
bool addEntry(dictionary &thisDict, entry &thisEntry, const entry &mergeEntry, const bool literalRE, const HashTable< wordList, word > &shortcuts)
Definition: changeDictionary.C:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::entry::disableFunctionEntries
static int disableFunctionEntries
Definition: entry.H:83
Foam::entry::dict
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
Foam::HashTable::sortedToc
List< Key > sortedToc() const
Return the table of contents as a sorted list.
Definition: HashTable.C:216
Foam::HashTable::find
iterator find(const Key &)
Find and return an iterator set at the hashedEntry.
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
Foam::HashTable
An STL-conforming hash table.
Definition: HashTable.H:61
Foam::regIOobject::fileModificationChecking
static fileCheckTypes fileModificationChecking
Definition: regIOobject.H:128
setRootCase.H
Foam::findStrings
bool findStrings(const wordReListMatcher &matcher, const std::string &str)
Return true if string matches one of the regular expressions.
Definition: stringListOps.H:52
Foam::dictionary::lookupEntryPtr
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:343
findMatches
labelList findMatches(const HashTable< wordList, word > &shortcuts, const wordList &shortcutNames, const wordList &thisKeys, const keyType &key)
Definition: changeDictionary.C:179
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:318
Foam::timeSelector::addOptions
static void addOptions(const bool constant=true, const bool withZero=false)
Add the options handled by timeSelector to argList::validOptions.
Definition: timeSelector.C:114
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:59
Foam::HashSet::insert
bool insert(const Key &key)
Insert a new entry.
Definition: HashSet.H:116
Foam::word::null
static const word null
An empty word.
Definition: word.H:77
timeSelector.H
createTime.H
Foam::argList::optionFound
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:108
Foam::IOstream::UNCOMPRESSED
@ UNCOMPRESSED
Definition: IOstream.H:195
stringListOps.H
Operations on lists of strings.
Foam::entry::clone
virtual autoPtr< entry > clone(const dictionary &parentDict) const =0
Construct on freestore as copy with reference to the.
Foam::dictionary::toc
wordList toc() const
Return the table of contents.
Definition: dictionary.C:697
Foam::List::size
void size(const label)
Override size to be inconsistent with allocated storage.
Foam::defineTemplateTypeNameAndDebug
defineTemplateTypeNameAndDebug(IOPtrList< ensightPart >, 0)
Foam::dictionary::subDict
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:631
args
Foam::argList args(argc, argv)
Foam::IOobject::READ_IF_PRESENT
@ READ_IF_PRESENT
Definition: IOobject.H:110
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:259
merge
bool merge(dictionary &, const dictionary &, const bool, const HashTable< wordList, word > &)
Definition: changeDictionary.C:222
dictIO
IOobject dictIO(dictName, runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::dictionary::add
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:729