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__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'SurfaceDirectory' objects>, '__init__': <function SurfaceDirectory.__init__>, '__doc__': 'A directory of sampled times', '__module__': 'PyFoam.RunDictionary.SurfaceDirectory', 'values': <function SurfaceDirectory.values>, '__dict__': <attribute '__dict__' of 'SurfaceDirectory' objects>, '__getitem__': <function SurfaceDirectory.__getitem__>, '__iter__': <function SurfaceDirectory.__iter__>, 'surfaces': <function SurfaceDirectory.surfaces>, '__contains__': <function SurfaceDirectory.__contains__>, 'getData': <function SurfaceDirectory.getData>})
__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__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'SurfaceTime' objects>, '__init__': <function SurfaceTime.__init__>, '__doc__': 'A directory with one surfaced time', '__getitem__': <function SurfaceTime.__getitem__>, '__dict__': <attribute '__dict__' of 'SurfaceTime' objects>, '__module__': 'PyFoam.RunDictionary.SurfaceDirectory'})
__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