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

Class BasicRunner

source code

object --+
         |
        BasicRunner

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, remark=None, jobId=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
start(self)
starts the command and stays with it till the end
source code
 
runOK(self)
checks whether the run was successful
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
 
writeResults(self)
Writes the next possible time-step
source code
 
stopHandle(self)
called after the program has stopped
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
PyFoam.RunDictionary.SolutionDirectory
getSolutionDirectory(self, archive=None)
Returns: The directory of the case
source code
 
addEndTrigger(self, f) source code

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

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, remark=None, jobId=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ 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
  • remark - User defined remark about the job
  • jobId - Job ID of the controlling system (Queueing system)
Overrides: object.__init__

getSolutionDirectory(self, archive=None)

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

addEndTrigger(self, f)

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