Accompanies OnCFD Newsletter #082: Quick edits with foamDictionary
# Print the top-level keywords present in this dictionary
foamDictionary system/snappyHexMeshDict -keywords
# Print the addLayersControls sub-dictionary
foamDictionary system/snappyHexMeshDict -entry addLayersControls
# List the keywords in the addLayersControls sub-dictionary
foamDictionary system/snappyHexMeshDict -keywords -entry addLayersControls
# Print the ENTRY for nLayerIter in addLayersControls
foamDictionary system/snappyHexMeshDict -entry addLayersControls/nLayerIter
# Print the VALUE of nLayerIter in addLayersControls
foamDictionary system/snappyHexMeshDict -entry addLayersControls/nLayerIter -value
# Set the value for nLayerIter in addLayersControls to 100
foamDictionary system/snappyHexMeshDict -entry addLayersControls/nLayerIter -set 100
# Set a value as the result of another command
# eg set the number of subdomains = to the number of procs on the machine
foamDictionary system/decomposeParDict -entry numberOfSubdomains -set $(nproc)
# Add a new top-level entry with a vector
foamDictionary my-include-file -entry top-level-var -add "(1 2 3)"
# Add an empty sub-dictionary called newdict
foamDictionary my-include-file -entry newdict -add "{}"
# Add an entry called myvar into the newdict sub-dictionary
foamDictionary my-include-file -entry newdict/myvar -add 2000
# Add a complete sub-dictionary:
# eg. add a new geometry file into snappyHexMeshDict
foamDictionary system/snappyHexMeshDict -entry geometry/newgeom.obj \
-add "{type triSurfaceMesh; name my-new-geometry;}"
# Remove the complete "newgeom.obj" sub-dictionary
foamDictionary system/snappyHexMeshDict -entry geometry/newgeom.obj -remove
Ah, OK - yeah I can see this behaviour in some of the
blockMesh
tutorials.Maybe you could raise it on the issue tracker?
Maybe you could extract some of the calculations into a separate dictionary &
#include
them back into your main dictionary?