foamDictionary.C File Reference

Interrogate and manipulate dictionaries. More...

Go to the source code of this file.

Detailed Description

Interrogate and manipulate dictionaries.

Original source file foamDictionary.C

Usage
foamDictionary [OPTION] dictionary
  • -entry <name>
    Selects an entry
  • -keywords
    Prints the keywords (of the selected entry or of the top level if no entry was selected
  • -add <value>
    Adds the entry (should not exist yet)
  • -set <value>
    Adds or replaces the entry
  • -remove
    Remove the selected entry
  • -diff <dictionary>
    Write differences with respect to the specified dictionary (or sub entry if -entry specified)
  • -diff-etc <dictionary>
    Write differences with respect to the specified dictionary (or sub entry if -entry specified)
  • -expand
    Read the specified dictionary file, expand the macros etc. and write the resulting dictionary to standard output.
  • -includes
    List the #include and #sinclude files to standard output
  • -disableFunctionEntries
    Do not expand macros or directives (#include etc)
  • -precision int
    Set default write precision for IOstreams
    Example usage:
  • Change simulation to run for one timestep only:
          foamDictionary system/controlDict -entry stopAt -set writeNow
  • Change solver:
           foamDictionary system/fvSolution -entry solvers.p.solver -set PCG
  • Print bc type:
           foamDictionary 0/U -entry boundaryField.movingWall.type
  • Change bc parameter:
           foamDictionary 0/U -entry boundaryField.movingWall.value \
             -set "uniform (2 0 0)"
  • Change whole bc type:
          foamDictionary 0/U -entry boundaryField.movingWall \
            -set "{type uniformFixedValue; uniformValue (2 0 0);}"
  • Write the differences with respect to a template dictionary:
          foamDictionary 0/U -diff-etc templates/closedVolume/0/U
  • Write the differences in boundaryField with respect to a template dictionary:
          foamDictionary 0/U -diff-etc templates/closedVolume/0/U \
            -entry boundaryField
  • Change patch type:
          foamDictionary constant/polyMesh/boundary \
            -entry entry0.fixedWalls.type -set patch
    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).

Notes:

  • the use of '.' as the scoping symbol might conflict with e.g. file extensions ('.' is not really considered to be a valid word character). Instead use the '/' as a scoping character e.g. foamDictionary system/snappyHexMeshDict \ -entry /geometry/motorBike.obj -remove

Definition in file foamDictionary.C.