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

Supports parallel operation for decomposed dictionary files associated with a case. These may be mesh or field files or any other decomposed dictionaries.

Usage
foamDictionary [OPTION] dictionary
  • -case <dir>
    Select a case directory instead of the current working directory
  • -parallel
    Specify case as a parallel job
  • -doc
    Display the documentation in browser
  • -srcDoc
    Display the source documentation in browser
  • -help
    Print the usage
  • -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 selected by -entry
  • -set <substitutions>
    Applies the list of substitutions
  • -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
    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 bc parameter in parallel:
           mpirun -np 4 foamDictionary 0.5/U \
             -entry boundaryField/movingWall/value \
             -set "uniform (2 0 0)" -parallel
  • 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).
  • Substitute multiple entries:
          foamDictionary system/controlDict -set "startTime=2000, endTime=3000"

Definition in file foamDictionary.C.