PyFoam.RunDictionary.SurfaceDirectory module

Working with a directory of surface samples

Should be able to generalize this with SampleDirectory, but not right now

class PyFoam.RunDictionary.SurfaceDirectory.SurfaceDirectory(case, dirName='surfaces')[source]

Bases: object

A directory of sampled times

__contains__(time)[source]
__dict__ = dict_proxy({'surfaces': <function surfaces>, '__module__': 'PyFoam.RunDictionary.SurfaceDirectory', '__getitem__': <function __getitem__>, '__contains__': <function __contains__>, '__iter__': <function __iter__>, 'values': <function values>, '__dict__': <attribute '__dict__' of 'SurfaceDirectory' objects>, 'getData': <function getData>, '__weakref__': <attribute '__weakref__' of 'SurfaceDirectory' objects>, '__doc__': 'A directory of sampled times', '__init__': <function __init__>})
__getitem__(time)[source]
__init__(case, dirName='surfaces')[source]
Parameters:
  • case – The case directory
  • dirName – Name of the directory with the surfaces
__iter__()[source]
__module__ = 'PyFoam.RunDictionary.SurfaceDirectory'
__weakref__

list of weak references to the object (if defined)

getData(surface=None, value=None, time=None)[source]

Get Surface sets :param line: name of the line. All if unspecified :param value: name of the surfaced value. All if unspecified :param time: times for which the surfaces are to be got. All if unspecified

surfaces()[source]

Returns all the found surfaces

values()[source]

Returns all the found surface values

class PyFoam.RunDictionary.SurfaceDirectory.SurfaceTime(sDir, time)[source]

Bases: object

A directory with one surfaced time

__dict__ = dict_proxy({'__module__': 'PyFoam.RunDictionary.SurfaceDirectory', '__getitem__': <function __getitem__>, '__dict__': <attribute '__dict__' of 'SurfaceTime' objects>, '__weakref__': <attribute '__weakref__' of 'SurfaceTime' objects>, '__doc__': 'A directory with one surfaced time', '__init__': <function __init__>})
__getitem__(key)[source]

Get the data for a value on a specific line :param key: A tuple with the surface-name and the value-name :returns: a path to the VTK-file

__init__(sDir, time)[source]
Parameters:
  • sDir – The surface-dir
  • time – the timename
__module__ = 'PyFoam.RunDictionary.SurfaceDirectory'
__weakref__

list of weak references to the object (if defined)

PyFoam.RunDictionary.SurfaceDirectory.extractSurface(fName)[source]

Extract the name of the line from a filename

PyFoam.RunDictionary.SurfaceDirectory.extractValue(fName)[source]

Extracts the names of the contained Values from a filename