Package PyFoam :: Package Execution :: Module BasicRunner :: Class BasicRunner
[hide private]
[frames] | no frames]

Class BasicRunner

source code


Base class for the running of commands

When the command is run the output is copied to a LogFile and (optionally) standard-out

The argument list assumes for the first three elements the OpenFOAM-convention:

<cmd> <dir> <case>

The directory name for outputs is therefor created from <dir> and <case>

Provides some handle-methods that are to be overloaded for additional functionality

Instance Methods [hide private]
 
__init__(self, argv=None, silent=False, logname=None, compressLog=False, lam=None, server=False, restart=False, noLog=False, logTail=None, remark=None, jobId=None, parameters=None, writeState=True)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
addEndTrigger(self, f) source code
 
appendTailLine(self, line)
Append lines to the tail of the log
source code
PyFoam.RunDictionary.SolutionDirectory
getSolutionDirectory(self, archive=None)
Returns: The directory of the case
source code
 
lineHandle(self, line)
called every time a new line is read
source code
 
logName(self)
Get the name of the logfiles
source code
 
runOK(self)
checks whether the run was successful
source code
 
start(self)
starts the command and stays with it till the end
source code
 
startHandle(self)
to be called before the program is started
source code
 
stopGracefully(self)
Tells the runner to stop at the next convenient time
source code
 
stopHandle(self)
called after the program has stopped
source code
 
writeLastSeen(self) source code
 
writeNowTime(self, force=False) source code
 
writeResults(self)
Writes the next possible time-step
source code
 
writeStartTime(self)
Write the real time the run was started at
source code
 
writeTailLog(self)
Write the last lines to the log
source code
 
writeTheState(self, state, always=True)
Write the current state the run is in
source code
 
writeToStateFile(self, fName, message)
Write a message to a state file
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, argv=None, silent=False, logname=None, compressLog=False, lam=None, server=False, restart=False, noLog=False, logTail=None, remark=None, jobId=None, parameters=None, writeState=True)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • argv - list with the tokens that are the command line if not set the standard command line is used
  • silent - if True no output is sent to stdout
  • logname - name of the logfile
  • compressLog - Compress the logfile into a gzip
  • lam (PyFoam.Execution.ParallelExecution.LAMMachine) - Information about a parallel run
  • server - Whether or not to start the network-server
  • noLog - Don't output a log file
  • logTail - only the last lines of the log should be written
  • remark - User defined remark about the job
  • parameters - User defined dictionary with parameters for documentation purposes
  • jobId - Job ID of the controlling system (Queueing system)
  • writeState - Write the state to some files in the case
Overrides: object.__init__

addEndTrigger(self, f)

source code 
Parameters:
  • f - A function that is to be executed at the end of the simulation

getSolutionDirectory(self, archive=None)

source code 
Parameters:
  • archive - Name of the directory for archiving results
Returns: PyFoam.RunDictionary.SolutionDirectory
The directory of the case