All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
foamDictionary.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) 2016-2024 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  foamDictionary
26 
27 Description
28  Interrogates and manipulates dictionaries.
29 
30  Supports parallel operation for decomposed dictionary files associated with
31  a case. These may be mesh or field files or any other decomposed
32  dictionaries.
33 
34 Usage
35  \b foamDictionary [OPTION] dictionary
36 
37  - \par -case <dir>
38  Select a case directory instead of the current working directory
39 
40  - \par -parallel
41  Specify case as a parallel job
42 
43  - \par -doc
44  Display the documentation in browser
45 
46  - \par -srcDoc
47  Display the source documentation in browser
48 
49  - \par -help
50  Print the usage
51 
52  - \par -entry <name>
53  Selects an entry
54 
55  - \par -keywords <name>
56  Prints the keywords (of the selected entry or of the top level if
57  no entry was selected
58 
59  - \par -rename <newName>
60  Renames the entry selected by \c -entry
61 
62  - \par -rename <newNames>
63  Renames a list of entries specified in the form:
64  "<entryName0>=<newName0>, <entryName1>=<newName1>..."
65 
66  - \par -add <value>
67  Adds the entry (should not exist yet)
68 
69  - \par -set <value>
70  Adds or replaces the entry selected by \c -entry
71 
72  - \par -set <substitutions>
73  Applies the list of substitutions specified in the form:
74  "<entry0>=<value0>, <entry1>=<value1>..."
75 
76  - \par -merge <value>
77  Merges the entry
78 
79  - \par -dict
80  Set, add or merge entry from a dictionary
81 
82  - \par -remove
83  Remove the selected entry
84 
85  - \par -diff <dictionary>
86  Write differences with respect to the specified dictionary
87  (or sub entry if -entry specified)
88 
89  - \par -expand
90  Read the specified dictionary file, expand the macros etc.
91  Writes the expanded dictionary to the output dictionary if specified
92  otherwise to standard output
93 
94  - \par -includes
95  List the \c \#include and \c \#includeIfPresent files to standard output
96 
97  - \par -output
98  Path name of the output dictionary, defaults to the input dictionary
99 
100  Example usage:
101  - Change simulation to run for one timestep only:
102  \verbatim
103  foamDictionary system/controlDict -entry stopAt -set writeNow
104  \endverbatim
105 
106  - Change solver:
107  \verbatim
108  foamDictionary system/fvSolution -entry solvers/p/solver -set PCG
109  \endverbatim
110 
111  - Print bc type:
112  \verbatim
113  foamDictionary 0/U -entry boundaryField/movingWall/type
114  \endverbatim
115 
116  - Change bc parameter:
117  \verbatim
118  foamDictionary 0/U -entry boundaryField/movingWall/value \
119  -set "uniform (2 0 0)"
120  \endverbatim
121 
122  - Change bc parameter in parallel:
123  \verbatim
124  mpirun -np 4 foamDictionary 0.5/U \
125  -entry boundaryField/movingWall/value \
126  -set "uniform (2 0 0)" -parallel
127  \endverbatim
128 
129  - Change whole bc type:
130  \verbatim
131  foamDictionary 0/U -entry boundaryField/movingWall \
132  -set "{type uniformFixedValue; uniformValue (2 0 0);}"
133  \endverbatim
134 
135  - Write the differences with respect to a template dictionary:
136  \verbatim
137  foamDictionary 0/U -diff $FOAM_ETC/templates/closedVolume/0/U
138  \endverbatim
139 
140  - Write the differences in boundaryField with respect to a
141  template dictionary:
142  \verbatim
143  foamDictionary 0/U -diff $FOAM_ETC/templates/closedVolume/0/U \
144  -entry boundaryField
145  \endverbatim
146 
147  - Change patch type:
148  \verbatim
149  foamDictionary constant/polyMesh/boundary \
150  -entry entry0/fixedWalls/type -set patch
151  \endverbatim
152  This uses special parsing of Lists which stores these in the
153  dictionary with keyword 'entryDDD' where DDD is the position
154  in the dictionary (after ignoring the FoamFile entry).
155 
156  - Substitute multiple entries:
157  \verbatim
158  foamDictionary system/controlDict -set "startTime=2000, endTime=3000"
159  \endverbatim
160 
161 \*---------------------------------------------------------------------------*/
162 
163 #include "argList.H"
164 #include "Time.H"
165 #include "localIOdictionary.H"
166 #include "Pair.H"
167 #include "IFstream.H"
168 #include "OFstream.H"
169 #include "includeEntry.H"
170 
171 using namespace Foam;
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 //- Read dictionary from file and return
176 // Sets stream to binary mode if specified in the optional header
177 IOstream::streamFormat readDict(dictionary& dict, const fileName& dictFileName)
178 {
180 
181  // Read the first entry and if it is FoamFile set the file format
182  {
183  IFstream dictFile(dictFileName);
184  if (!dictFile().good())
185  {
187  << "Cannot open file " << dictFileName
188  << exit(FatalError, 1);
189  }
190 
191  // Check if the first token in the file is "FoamFile"
192  // to avoid problems if the first entry is a variable or function
193  token firstToken;
194  dictFile.read(firstToken);
195  if (firstToken.isWord() && firstToken.wordToken() == IOobject::foamFile)
196  {
197  dictFile.putBack(firstToken);
198 
199  // Read the first entry from the dictionary
200  autoPtr<entry> firstEntry(entry::New(dictFile()));
201 
202  // If the first entry is the "FoamFile" header
203  // read and set the stream format
204  if
205  (
206  firstEntry->isDict()
207  && firstEntry->keyword() == IOobject::foamFile
208  )
209  {
210  dictFormat = IOstream::formatEnum
211  (
212  firstEntry->dict().lookup("format")
213  );
214  }
215  }
216  }
217 
218  IFstream dictFile(dictFileName, dictFormat);
219 
220  // Read and add the rest of the dictionary entries
221  // preserving the IOobject::foamFile header dictionary if present
222  dict.read(dictFile(), true);
223 
224  return dictFormat;
225 }
226 
227 
228 void remove(dictionary& dict, const dictionary& removeDict)
229 {
230  forAllConstIter(dictionary, removeDict, iter)
231  {
232  entry* entPtr = dict.lookupEntryPtr
233  (
234  iter().keyword(),
235  false,
236  false
237  );
238 
239  if (entPtr)
240  {
241  if (entPtr->isDict())
242  {
243  if (iter().isDict())
244  {
245  remove(entPtr->dict(), iter().dict());
246 
247  // Check if dictionary is empty
248  if (!entPtr->dict().size())
249  {
250  dict.remove(iter().keyword());
251  }
252  }
253  }
254  else if (!iter().isDict())
255  {
256  if (*entPtr == iter())
257  {
258  dict.remove(iter().keyword());
259  }
260  }
261  }
262  }
263 }
264 
265 
266 void rename(dictionary& dict, const string& newNames)
267 {
269  List<Tuple2<word, string>> namedArgs;
270  dictArgList(newNames, args, namedArgs);
271 
272  forAll(namedArgs, i)
273  {
274  const Pair<word> dAk(dictAndKeyword(namedArgs[i].first()));
275  dictionary& subDict(dict.scopedDict(dAk.first()));
276  subDict.changeKeyword(dAk.second(), word(namedArgs[i].second()));
277  }
278 }
279 
280 
281 void substitute(dictionary& dict, const string& substitutions)
282 {
284  List<Tuple2<word, string>> namedArgs;
285  dictArgList(substitutions, args, namedArgs);
286 
287  forAll(namedArgs, i)
288  {
289  const Pair<word> dAk(dictAndKeyword(namedArgs[i].first()));
290  dictionary& subDict(dict.scopedDict(dAk.first()));
291  IStringStream entryStream
292  (
293  dAk.second() + ' ' + namedArgs[i].second() + ';'
294  );
295  subDict.set(entry::New(entryStream).ptr());
296  }
297 }
298 
299 
300 int main(int argc, char *argv[])
301 {
302  writeInfoHeader = false;
303 
304  argList::addNote("manipulates dictionaries");
305 
306  argList::validArgs.append("dictionary file");
307 
308  argList::addBoolOption("keywords", "list keywords");
309  argList::addOption("entry", "name", "report/select the named entry");
311  (
312  "value",
313  "Print entry value"
314  );
316  (
317  "rename",
318  "name",
319  "Rename entry or list of entries"
320  );
322  (
323  "set",
324  "value",
325  "Set entry value, add new entry or apply list of substitutions"
326  );
328  (
329  "add",
330  "value",
331  "Add a new entry"
332  );
334  (
335  "merge",
336  "value",
337  "Merge entry"
338  );
340  (
341  "dict",
342  "Set, add or merge entry from a dictionary."
343  );
345  (
346  "remove",
347  "Remove the entry."
348  );
350  (
351  "diff",
352  "dict",
353  "Write differences with respect to the specified dictionary"
354  );
356  (
357  "includes",
358  "List the #include/#includeIfPresent files to standard output"
359  );
361  (
362  "expand",
363  "Read the specified dictionary file and expand the macros etc."
364  );
366  (
367  "writePrecision",
368  "label",
369  "Write with the specified precision"
370  );
372  (
373  "output",
374  "path name",
375  "Path name of the output dictionary"
376  );
377 
378  argList args(argc, argv);
379 
380  const bool listIncludes = args.optionFound("includes");
381 
382  if (listIncludes)
383  {
385  }
386 
387  // Do not expand functionEntries except during dictionary expansion
388  // with the -expand option
389  if (!args.optionFound("expand"))
390  {
392  }
393 
394  // Set write precision
395  if (args.optionFound("writePrecision"))
396  {
397  const label writePrecision = args.optionRead<label>("writePrecision");
398  IOstream::defaultPrecision(writePrecision);
399  Sout.precision(writePrecision);
401  }
402 
403  const fileName dictPath(args[1]);
404 
405  Time* runTimePtr = nullptr;
406  localIOdictionary* localDictPtr = nullptr;
407 
408  dictionary* dictPtr = nullptr;
410 
411  // When running in parallel read the dictionary as a case localIOdictionary
412  // supporting file handlers
413  if (Pstream::parRun())
414  {
415  if (!args.checkRootCase())
416  {
417  FatalError.exit();
418  }
419 
421 
422  const wordList dictPathComponents(dictPath.components());
423 
424  if (dictPathComponents.size() == 1)
425  {
427  << "File name " << dictPath
428  << " does not contain an instance path needed in parallel"
429  << exit(FatalError, 1);
430  }
431 
432  const word instance = dictPathComponents[0];
433  const fileName dictFileName
434  (
435  SubList<word>(dictPathComponents, dictPathComponents.size() - 1, 1)
436  );
437 
438  scalar time;
439  if (readScalar(instance.c_str(), time))
440  {
441  runTimePtr->setTime(time, 0);
442  }
443 
444  localDictPtr = new localIOdictionary
445  (
446  IOobject
447  (
448  dictFileName,
449  instance,
450  *runTimePtr,
453  false
454  )
455  );
456  }
457  else
458  {
459  dictPtr = new dictionary(dictPath);
460  dictFormat = readDict(*dictPtr, args.path()/dictPath);
461  }
462 
463  dictionary& dict = localDictPtr ? *localDictPtr : *dictPtr;
464 
465  bool changed = false;
466 
467  if (listIncludes)
468  {
469  return 0;
470  }
471  else if (args.optionFound("expand") && !args.optionFound("entry"))
472  {
473  if (!args.optionFound("output"))
474  {
476  <<"//\n// " << dictPath << "\n//\n";
477 
478  // Change the format to ASCII
480  {
482  (
483  "format",
485  true
486  );
487  }
488 
489  dict.dictionary::write(Info, false);
491 
492  return 0;
493  }
494  else
495  {
496  changed = true;
497  }
498  }
499 
500 
501  // Second dictionary for -diff
502  fileName diffFileName;
503  dictionary diffDict;
504 
505  if (args.optionReadIfPresent("diff", diffFileName))
506  {
507  readDict(diffDict, diffFileName);
508  }
509 
510  word entryName;
511  if (args.optionReadIfPresent("entry", entryName))
512  {
513  const word scopedName(entryName);
514 
515  string newValue;
516 
517  if (args.optionReadIfPresent("rename", newValue))
518  {
519  // Extract dictionary name and keyword
520  const Pair<word> dAk(dictAndKeyword(scopedName));
521 
522  dictionary& subDict(dict.scopedDict(dAk.first()));
523 
524  subDict.changeKeyword(dAk.second(), word(newValue));
525 
526  changed = true;
527  }
528  else if
529  (
530  args.optionReadIfPresent("set", newValue)
531  || args.optionReadIfPresent("add", newValue)
532  || args.optionReadIfPresent("merge", newValue)
533  )
534  {
535  const bool overwrite = args.optionFound("set");
536  const bool merge = args.optionFound("merge");
537 
538  // Extract dictionary name and keyword
539  const Pair<word> dAk(dictAndKeyword(scopedName));
540 
541  dictionary& subDict(dict.scopedDict(dAk.first()));
542 
543  entry* ePtr = nullptr;
544 
545  if (args.optionFound("dict"))
546  {
547  const fileName fromDictFileName(newValue);
548  dictionary fromDict;
549  readDict(fromDict, fromDictFileName);
550 
551  const entry* fePtr
552  (
553  fromDict.lookupScopedEntryPtr
554  (
555  scopedName,
556  false,
557  true // Support wildcards
558  )
559  );
560 
561  if (!fePtr)
562  {
564  << "Cannot find entry " << entryName
565  << " in file " << fromDictFileName
566  << exit(FatalError, 1);
567  }
568 
569  ePtr = fePtr->clone().ptr();
570  }
571  else
572  {
573  IStringStream str(string(dAk.second()) + ' ' + newValue + ';');
574  ePtr = entry::New(str).ptr();
575  }
576 
577  if (overwrite)
578  {
579  Info << "New entry " << *ePtr << endl;
580  subDict.set(ePtr);
581  }
582  else
583  {
584  subDict.add(ePtr, merge);
585  }
586  changed = true;
587  }
588  else if (args.optionFound("remove"))
589  {
590  // Extract dictionary name and keyword
591  const Pair<word> dAk(dictAndKeyword(scopedName));
592 
593  dictionary& subDict(dict.scopedDict(dAk.first()));
594  subDict.remove(dAk.second());
595  changed = true;
596  }
597  else
598  {
599  // Optionally remove a second dictionary
600  if (args.optionFound("diff"))
601  {
602  const Pair<word> dAk(dictAndKeyword(scopedName));
603 
604  dictionary& subDict(dict.scopedDict(dAk.first()));
605  const dictionary& subDict2(diffDict.scopedDict(dAk.first()));
606 
607  entry* ePtr =
608  subDict.lookupEntryPtr(dAk.second(), false, true);
609  const entry* e2Ptr =
610  subDict2.lookupEntryPtr(dAk.second(), false, true);
611 
612  if (ePtr && e2Ptr)
613  {
614  if (*ePtr == *e2Ptr)
615  {
616  subDict.remove(dAk.second());
617  }
618  else if (ePtr->isDict() && e2Ptr->isDict())
619  {
620  remove(ePtr->dict(), e2Ptr->dict());
621  }
622  }
623  }
624 
625 
626  const entry* entPtr = dict.lookupScopedEntryPtr
627  (
628  scopedName,
629  false,
630  true // Support wildcards
631  );
632 
633  if (entPtr)
634  {
635  if (args.optionFound("keywords"))
636  {
637  const dictionary& dict = entPtr->dict();
639  {
640  Info<< iter().keyword() << endl;
641  }
642  }
643  else
644  {
645  if (args.optionFound("value"))
646  {
647  if (entPtr->isStream())
648  {
649  const tokenList& tokens = entPtr->stream();
650  forAll(tokens, i)
651  {
652  Info<< tokens[i];
653  if (i < tokens.size() - 1)
654  {
655  Info<< token::SPACE;
656  }
657  }
658  Info<< endl;
659  }
660  else if (entPtr->isDict())
661  {
662  Info<< entPtr->dict();
663  }
664  }
665  else
666  {
667  Info<< *entPtr;
668  }
669  }
670  }
671  else
672  {
674  << "Cannot find entry " << entryName
675  << exit(FatalIOError, 2);
676  }
677  }
678  }
679  else if (args.optionFound("rename"))
680  {
681  const string newNames(args.optionRead<string>("rename"));
682  rename(dict, newNames);
683  changed = true;
684  }
685  else if (args.optionFound("set"))
686  {
687  const string substitutions(args.optionRead<string>("set"));
688  substitute(dict, substitutions);
689  changed = true;
690  }
691  else if (args.optionFound("keywords"))
692  {
694  {
695  Info<< iter().keyword() << endl;
696  }
697  }
698  else if (args.optionFound("diff"))
699  {
700  remove(dict, diffDict);
701  dict.dictionary::write(Info, false);
702  }
703  else if (!args.optionFound("output"))
704  {
705  dict.dictionary::write(Info, false);
706  }
707 
708  if (changed)
709  {
710  if (localDictPtr)
711  {
712  localDictPtr->regIOobject::write();
713  }
714  else if (dictPtr)
715  {
716  // Set output dict name, defaults to the name of the input dict
717  const fileName outputDictPath
718  (
719  args.optionLookupOrDefault<fileName>("output", dictPath)
720  );
721 
722  OFstream os(args.path()/outputDictPath, dictFormat);
724  if (dictPtr->found(IOobject::foamFile))
725  {
726  os << IOobject::foamFile;
727  dictPtr->subDict(IOobject::foamFile).write(os);
728  dictPtr->remove(IOobject::foamFile);
729  IOobject::writeDivider(os) << nl;
730  }
731  dictPtr->write(os, false);
733  }
734  }
735 
736  delete dictPtr;
737  delete localDictPtr;
738  delete runTimePtr;
739 
740  return 0;
741 }
742 
743 
744 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Definition: UList.H:477
Input from file stream.
Definition: IFstream.H:85
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
static Stream & writeBanner(Stream &os, bool noHint=false)
Write the standard OpenFOAM file/dictionary banner.
Definition: IOobjectI.H:45
static Stream & writeEndDivider(Stream &os)
Write the standard end file divider.
Definition: IOobjectI.H:103
static constexpr const char * foamFile
Keyword for the FoamFile header sub-dictionary.
Definition: IOobject.H:104
static Stream & writeDivider(Stream &os)
Write the standard file section divider.
Definition: IOobjectI.H:93
streamFormat
Enumeration for the format of data in the stream.
Definition: IOstream.H:87
static unsigned int defaultPrecision()
Return the default precision.
Definition: IOstream.H:458
static streamFormat formatEnum(const word &)
Return stream format of given format name.
Definition: IOstream.C:39
Input from memory buffer stream.
Definition: IStringStream.H:52
Output to file stream.
Definition: OFstream.H:86
virtual int precision() const
Get precision of output field.
Definition: OSstream.C:262
A List obtained as a section of another List.
Definition: SubList.H:56
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
virtual void setTime(const Time &)
Reset the time and time-index to those of the given time.
Definition: Time.C:985
static word controlDictName
The default control dictionary name (normally "controlDict")
Definition: Time.H:208
static bool & parRun()
Is this a parallel run?
Definition: UPstream.H:399
Extract command arguments and options from the supplied argc and argv parameters.
Definition: argList.H:103
static void addOption(const word &opt, const string &param="", const string &usage="")
Add to an option to validOptions with usage information.
Definition: argList.C:128
static void addNote(const string &)
Add extra notes for the usage information.
Definition: argList.C:159
T optionRead(const word &opt) const
Read a value from the named option.
Definition: argListI.H:193
static void addBoolOption(const word &opt, const string &usage="")
Add to a bool option to validOptions with usage information.
Definition: argList.C:118
bool optionFound(const word &opt) const
Return true if the named option is found.
Definition: argListI.H:114
bool optionReadIfPresent(const word &opt, T &) const
Read a value from the named option if present.
Definition: argListI.H:204
bool checkRootCase() const
Check root path and case path.
Definition: argList.C:1441
fileName path() const
Return the path to the caseName.
Definition: argListI.H:66
static SLList< string > validArgs
A list of valid (mandatory) arguments.
Definition: argList.H:153
T optionLookupOrDefault(const word &opt, const T &deflt) const
Read a value from the named option if present.
Definition: argListI.H:243
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
bool read(Istream &, const bool keepHeader=false)
Read dictionary from Istream, optionally keeping the header.
Definition: dictionaryIO.C:108
const entry * lookupEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present.
Definition: dictionary.C:548
void write(Ostream &, const bool subDict=true) const
Write dictionary, normally with sub-dictionary formatting.
Definition: dictionaryIO.C:211
const entry * lookupScopedEntryPtr(const word &, bool recursive, bool patternMatch) const
Find and return an entry data stream pointer if present,.
Definition: dictionary.C:737
bool remove(const word &)
Remove an entry specified by keyword.
Definition: dictionary.C:1177
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Definition: dictionary.C:843
bool add(entry *, bool mergeEntry=false)
Add a new entry.
Definition: dictionary.C:1014
bool found(const word &, bool recursive=false, bool patternMatch=true) const
Search dictionary for given keyword.
Definition: dictionary.C:509
const dictionary & scopedDict(const word &) const
Find and return a sub-dictionary by scoped lookup.
Definition: dictionary.C:938
A keyword and a list of tokens is an 'entry'.
Definition: entry.H:68
virtual bool isDict() const
Return true if this entry is a dictionary.
Definition: entry.H:156
virtual ITstream & stream() const =0
Return token stream if this entry is a primitive entry.
static bool New(dictionary &parentDict, Istream &)
Construct from Istream and insert into dictionary.
Definition: entryIO.C:91
virtual const dictionary & dict() const =0
Return dictionary if this entry is a dictionary.
virtual autoPtr< entry > clone(const dictionary &parentDict) const =0
Construct on freestore as copy with reference to the.
virtual bool isStream() const
Return true if this entry is a stream.
Definition: entry.H:147
static int disableFunctionEntries
Definition: entry.H:86
void exit(const int errNo=1)
Exit : can be called for any error to exit program.
Definition: error.C:125
A class for handling file names.
Definition: fileName.H:82
static bool log
Report which file is included to stdout.
Definition: includeEntry.H:88
localIOdictionary derived from IOdictionary with global set false to disable parallel master reading.
A token holds items read from Istream.
Definition: token.H:73
bool isWord() const
Definition: tokenI.H:298
const word & wordToken() const
Definition: tokenI.H:303
A class for handling words, derived from string.
Definition: word.H:62
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
Definition: error.H:346
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:334
int main(int argc, char *argv[])
Definition: financialFoam.C:44
static Time * runTimePtr
Definition: globalFoam.H:51
Namespace for OpenFOAM.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:124
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
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:257
bool writeInfoHeader
void dictArgList(const string &argString, word &configName, wordReList &args, List< Tuple2< word, string >> &namedArgs)
Parse dictionary substitution argument list.
Definition: dictionary.C:1480
messageStream Info
labelList second(const UList< labelPair > &p)
Definition: patchToPatch.C:49
labelList first(const UList< labelPair > &p)
Definition: patchToPatch.C:39
Pair< word > dictAndKeyword(const word &scopedName)
Extracts dict name and keyword.
Definition: dictionary.C:1639
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
Definition: doubleScalar.H:75
IOerror FatalIOError
prefixOSstream Pout(cout, "Pout")
Definition: IOstreams.H:53
error FatalError
prefixOSstream Sout(cout, "Sout")
Definition: IOstreams.H:51
static const char nl
Definition: Ostream.H:266
dictionary dict
Foam::argList args(argc, argv)