casefoam.utility.getFileStructure

casefoam.utility.getFileStructure(file)[source]

Get the structure of OpenFOAM dictionary.

Parameters:
file : str

Path to the OpenFOAM file.

Returns:
fileStructure : dict

Content of the OpenFOAM file as dictionary.

Examples

Get the file content and structure of a velocity file

>>> casefoam.utility.getFileStructure('0/U')
{'boundaryField': {'bottom': {'type': 'symmetryPlane'},
  'defaultFaces': {'type': 'empty'},
  'inlet': {'type': 'fixedValue', 'value': 'uniform (3 0 0)'},
  'obstacle': {'type': 'slip'},
  'outlet': {'inletValue': 'uniform (3 0 0)',
   'type': 'inletOutlet',
   'value': 'uniform (3 0 0)'},
  'top': {'type': 'symmetryPlane'}},
 'dimensions': '[ 0 1 -1 0 0 0 0 ]',
 'internalField': 'uniform (3 0 0)'}