PyFoam.RunDictionary.TimeDirectory module

Working with direcotries from a time-step

class PyFoam.RunDictionary.TimeDirectory.TimeDirectory(name, time, create=False, region=None, processor=None, tolerant=False, yieldParsedFiles=False)[source]

Bases: object

Represents a directory for a timestep

_TimeDirectory__remove(key)
__contains__(item)[source]
__delitem__(key)[source]
__dict__ = mappingproxy({'__delitem__': <function TimeDirectory.__delitem__>, '__setitem__': <function TimeDirectory.__setitem__>, '__init__': <function TimeDirectory.__init__>, 'reread': <function TimeDirectory.reread>, 'baseName': <function TimeDirectory.baseName>, '_TimeDirectory__remove': <function TimeDirectory.__remove>, '__module__': 'PyFoam.RunDictionary.TimeDirectory', '__len__': <function TimeDirectory.__len__>, '__getitem__': <function TimeDirectory.__getitem__>, 'clear': <function TimeDirectory.clear>, '__weakref__': <attribute '__weakref__' of 'TimeDirectory' objects>, 'getFiles': <function TimeDirectory.getFiles>, '__doc__': 'Represents a directory for a timestep', '__iter__': <function TimeDirectory.__iter__>, 'copy': <function TimeDirectory.copy>, '__dict__': <attribute '__dict__' of 'TimeDirectory' objects>, '__contains__': <function TimeDirectory.__contains__>})
__getitem__(key)[source]
__init__(name, time, create=False, region=None, processor=None, tolerant=False, yieldParsedFiles=False)[source]
Parameters:
  • name – name of the case directory
  • time – time in the directory
  • create – Create the directory if it does not exist
  • tolerant – Do not fail if there are inconsistencies
  • region – The mesh region for multi-region cases
  • yieldParsedFiles – let the iterator return PasedParameterFile objects instead of SolutionFile
__iter__()[source]
__len__()[source]
__module__ = 'PyFoam.RunDictionary.TimeDirectory'
__setitem__(key, value)[source]
__weakref__

list of weak references to the object (if defined)

baseName()[source]

The name of the directory

clear()[source]

Wipe the directory clean

copy(orig, purge=False, overwrite=True, mustExist=False, exclude=[], include=['*'])[source]

Copy SolutionFiles from another TimeDirectory to the current TimeDirectory. Returns a list with the copied values :param orig: the TimeDirectory with the original files :param purge: remove all current files in this directory :param overwrite: if the file already exists it is overwritten :param mustExist: only if the file already exists it is overwritten :param exclude: List of fnmatch-patterns that should be excluded (Default: none) :param include: List of fnmatch-patterns that should be included (Default: all)

getFiles()[source]

Get a list of the solution files in that directory

reread(force=False)[source]

Scan the directory for files with valid names