mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
foamDictionary: Added support for manipulating lists of dictionaries
- provides support for manipulating polyMesh/boundary
- changed behaviour of disableFunctionEntries option to preserve
#include
- dictionary: added reading of lists of dictionaries.
+ each list element may be accessed using the 'entryDDD' keyword
according to their list index.
Patch contributed by Mattijs Janssens
This commit is contained in:
@ -57,6 +57,9 @@ Usage
|
||||
- \par -includes
|
||||
List the \c #include and \c #includeIfPresent files to standard output
|
||||
|
||||
- \par -disableFunctionEntries
|
||||
Do not expand macros or directives (#include etc)
|
||||
|
||||
Example usage:
|
||||
- Change simulation to run for one timestep only:
|
||||
\verbatim
|
||||
@ -97,6 +100,15 @@ Usage
|
||||
-entry boundaryField
|
||||
\endverbatim
|
||||
|
||||
- Change patch type:
|
||||
\verbatim
|
||||
foamDictionary constant/polyMesh/boundary \
|
||||
-entry entry0.fixedWalls.type -set patch
|
||||
\endverbatim
|
||||
This uses special parsing of Lists which stores these in the
|
||||
dictionary with keyword 'entryDDD' where DDD is the position
|
||||
in the dictionary (after ignoring the FoamFile entry).
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "argList.H"
|
||||
@ -271,6 +283,11 @@ int main(int argc, char *argv[])
|
||||
"Read the specified dictionary file, expand the macros etc. and write "
|
||||
"the resulting dictionary to standard output"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"disableFunctionEntries",
|
||||
"Disable expansion of dictionary directives - #include, #codeStream etc"
|
||||
);
|
||||
|
||||
argList args(argc, argv);
|
||||
|
||||
@ -281,6 +298,15 @@ int main(int argc, char *argv[])
|
||||
Foam::functionEntries::includeEntry::log = true;
|
||||
}
|
||||
|
||||
const bool disableEntries = args.optionFound("disableFunctionEntries");
|
||||
if (disableEntries)
|
||||
{
|
||||
Info<< "Not expanding variables or dictionary directives"
|
||||
<< endl;
|
||||
entry::disableFunctionEntries = true;
|
||||
}
|
||||
|
||||
|
||||
fileName dictFileName(args[1]);
|
||||
|
||||
autoPtr<IFstream> dictFile(new IFstream(dictFileName));
|
||||
|
||||
Reference in New Issue
Block a user