Package PyFoam :: Package Basics :: Module OutFileCollection :: Class OutFileCollection
[hide private]
[frames] | no frames]

Class OutFileCollection

source code

object --+
         |
        OutFileCollection

Collection of output files

The files are stored in a common directory and are created on first access

Each file can be identified by a unique name. If a file is accessed a second time at the same simulation-time a file with the ending _2 is created (incrementing with each access)

Instance Methods [hide private]
 
__init__(self, basename, titles=[], singleFile=False)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
setTitles(self, titles)
Sets the titles anew
source code
 
checkTime(self, time)
check whether the time has changed
source code
 
getFile(self, name)
get a OutputFile-object
source code
 
addToOpenList(self, name)
Adds a file to the list of open files.
source code
 
removeFromOpenList(self, name)
Adds a file to the list of open files.
source code
 
prevCalls(self, name)
checks whether the name was used previously at that time-step
source code
 
incrementCalls(self, name)
increments the access counter for name
source code
 
write(self, name, time, data)
writes data to file
source code
 
close(self)
Force all files to be closed
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  maxOpenFiles = int(conf().get("OutfileCollection", "maximumOpe...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, basename, titles=[], singleFile=False)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • basename - name of the base directory
  • titles - names of the data columns
  • singleFile - don't split into multiple files if more than one datum is insert per time-step
Overrides: object.__init__

setTitles(self, titles)

source code 

Sets the titles anew

Parameters:
  • titles - the new titles

addToOpenList(self, name)

source code 

Adds a file to the list of open files. Closes another file if limit is reached

removeFromOpenList(self, name)

source code 

Adds a file to the list of open files. Closes another file if limit is reached

write(self, name, time, data)

source code 

writes data to file

name - name of the file time - simulation time data - tuple with the data


Class Variable Details [hide private]

maxOpenFiles

Value:
int(conf().get("OutfileCollection", "maximumOpenFiles"))