foamDictionary.C File Reference

Interrogates and manipulates dictionaries. More...

Go to the source code of this file.

Detailed Description

Interrogates and manipulates dictionaries.

Original source file foamDictionary.C

Usage
foamDictionary [OPTION] dictionary
  • -entry <name>
    Selects an entry
  • -keywords <name>
    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
  • -merge <value>
    Merges the entry
  • -dict
    Set, add or merge entry from a dictionary
  • -remove
    Remove the selected entry
  • -diff <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 #includeIfPresent files to standard output
  • -disableFunctionEntries
    Do not expand macros or directives (#include etc)
    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 $FOAM_ETC/templates/closedVolume/0/U
  • Write the differences in boundaryField with respect to a template dictionary:
          foamDictionary 0/U -diff $FOAM_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).

Definition in file foamDictionary.C.