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

Class FoamThread

source code

        object --+        
                 |        
threading._Verbose --+    
                     |    
      threading.Thread --+
                         |
                        FoamThread

Thread running an OpenFOAM command

The output of the command can be accessed in a thread-safe manner, line by line

Designed to be used by the BasicRunner-class

Instance Methods [hide private]
  __init__(self, cmdline)
cmdline - Command line of the OpenFOAM command
  run(self)
start the command
  stopTimer(self)
  read(self)
read another line from the output
  getLine(self)
gets the last line from the output
  interrupt(self)
A keyboard-interrupt is reported
  setState(self, state)
sets the state of the thread (is there any more output)
  check(self)
  cpuTime(self)
  cpuUserTime(self)
  cpuSystemTime(self)
  usedMemory(self)
  wallTime(self)

Inherited from threading.Thread: __repr__, getName, isAlive, isDaemon, join, setDaemon, setName, start

Inherited from threading.Thread (private): _set_daemon

Inherited from threading._Verbose (private): _note

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


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, cmdline)
(Constructor)

source code 
cmdline - Command line of the OpenFOAM command
Overrides: threading.Thread.__init__

run(self)

source code 
start the command
Overrides: threading.Thread.run

stopTimer(self)

source code 
None

read(self)

source code 
read another line from the output

getLine(self)

source code 
gets the last line from the output

interrupt(self)

source code 
A keyboard-interrupt is reported

setState(self, state)

source code 
sets the state of the thread (is there any more output)

check(self)

source code 
Returns:
False if there is no more output of the command

cpuTime(self)

source code 
Returns:
number of seconds CPU-Time used

cpuUserTime(self)

source code 
Returns:
number of seconds CPU-Time used in user mode

cpuSystemTime(self)

source code 
Returns:
number of seconds CPU-Time used in system mode

usedMemory(self)

source code 
Returns:
maximum resident set size in MegaByte

wallTime(self)

source code 
Returns:
the wall-clock-time needed by the process