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

Class BasicRunner

source code

object --+
         |
        BasicRunner
Known Subclasses:
AnalyzedRunner.AnalyzedRunner, StepAnalyzedRunner.StepAnalyzedRunner

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="PyFoam", lam=None, server=False)
  start(self)
starts the command and stays with it till the end
  runOK(self)
checks whether the run was successful
  startHandle(self)
to be called before the program is started
  stopGracefully(self)
Tells the runner to stop at the next convenient time
  stopHandle(self)
called after the program has stopped
  lineHandle(self, line)
called every time a new line is read
  logName(self)
Get the name of the logfiles
PyFoam.RunDictionary.SolutionDirectory getSolutionDirectory(self, archive=None)

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="PyFoam", lam=None, server=False)
(Constructor)

source code 
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
  • lam (PyFoam.Execution.ParallelExecution.LAMMachine) - Information about a parallel run
  • server - Whether or not to start the network-server
Overrides: object.__init__

start(self)

source code 
starts the command and stays with it till the end

runOK(self)

source code 
checks whether the run was successful

startHandle(self)

source code 
to be called before the program is started

stopGracefully(self)

source code 
Tells the runner to stop at the next convenient time

stopHandle(self)

source code 
called after the program has stopped

lineHandle(self, line)

source code 
called every time a new line is read

logName(self)

source code 
Get the name of the logfiles

getSolutionDirectory(self, archive=None)

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