PyFoam.Execution.BasicRunner module¶
Run a OpenFOAM command
-
class
PyFoam.Execution.BasicRunner.
BasicRunner
(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, echoCommandLine=None)[source]¶ Bases:
object
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
-
__dict__
= mappingproxy({'__init__': <function BasicRunner.__init__>, 'runOK': <function BasicRunner.runOK>, '__module__': 'PyFoam.Execution.BasicRunner', 'writeStartTime': <function BasicRunner.writeStartTime>, 'stopWithoutWrite': <function BasicRunner.stopWithoutWrite>, 'writeNowTime': <function BasicRunner.writeNowTime>, 'writeToStateFile': <function BasicRunner.writeToStateFile>, 'writeTheState': <function BasicRunner.writeTheState>, 'logName': <function BasicRunner.logName>, 'stopHandle': <function BasicRunner.stopHandle>, 'writeLastSeen': <function BasicRunner.writeLastSeen>, '__weakref__': <attribute '__weakref__' of 'BasicRunner' objects>, 'startHandle': <function BasicRunner.startHandle>, '__doc__': 'Base class for the running of commands\n\n When the command is run the output is copied to a LogFile and\n (optionally) standard-out\n\n The argument list assumes for the first three elements the\n OpenFOAM-convention:\n\n <cmd> <dir> <case>\n\n The directory name for outputs is therefor created from <dir> and\n <case>\n\n Provides some handle-methods that are to be overloaded for\n additional functionality', 'writeResults': <function BasicRunner.writeResults>, 'writeTailLog': <function BasicRunner.writeTailLog>, 'stopGracefully': <function BasicRunner.stopGracefully>, 'appendTailLine': <function BasicRunner.appendTailLine>, 'getSolutionDirectory': <function BasicRunner.getSolutionDirectory>, 'addEndTrigger': <function BasicRunner.addEndTrigger>, '__dict__': <attribute '__dict__' of 'BasicRunner' objects>, 'start': <function BasicRunner.start>, 'lineHandle': <function BasicRunner.lineHandle>, 'stopAtNextWrite': <function BasicRunner.stopAtNextWrite>, '_writeStopAt': <function BasicRunner._writeStopAt>})¶
-
__init__
(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, echoCommandLine=None)[source]¶ Parameters: argv – list with the tokens that are the command line if not set the standard command line is used :param silent: if True no output is sent to stdout :param logname: name of the logfile :param compressLog: Compress the logfile into a gzip :param lam: Information about a parallel run :param server: Whether or not to start the network-server :type lam: PyFoam.Execution.ParallelExecution.LAMMachine :param noLog: Don’t output a log file :param logTail: only the last lines of the log should be written :param remark: User defined remark about the job :param parameters: User defined dictionary with parameters for
documentation purposesParameters: - jobId – Job ID of the controlling system (Queueing system)
- writeState – Write the state to some files in the case
- echoCommandLine – Prefix that is printed with the command line. If unset nothing is printed
-
__module__
= 'PyFoam.Execution.BasicRunner'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
addEndTrigger
(f)[source]¶ Parameters: f – A function that is to be executed at the end of the simulation
-
getSolutionDirectory
(archive=None)[source]¶ Returns: The directory of the case Return type: PyFoam.RunDictionary.SolutionDirectory Parameters: archive – Name of the directory for archiving results
-
-
class
PyFoam.Execution.BasicRunner.
BasicRunnerCheck
[source]¶ Bases:
object
A small class that does primitve checking for BasicRunner Duplicates other efforts, but ....
-
__dict__
= mappingproxy({'__weakref__': <attribute '__weakref__' of 'BasicRunnerCheck' objects>, '__init__': <function BasicRunnerCheck.__init__>, '__doc__': 'A small class that does primitve checking for BasicRunner\n Duplicates other efforts, but ....', '__module__': 'PyFoam.Execution.BasicRunner', 'floatRegExp': '[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?', '__dict__': <attribute '__dict__' of 'BasicRunnerCheck' objects>, 'controlDictRead': <function BasicRunnerCheck.controlDictRead>, 'getCreateTime': <function BasicRunnerCheck.getCreateTime>, 'getTime': <function BasicRunnerCheck.getTime>})¶
-
__module__
= 'PyFoam.Execution.BasicRunner'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
floatRegExp
= '[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?'¶
-