Package PyFoam :: Package Infrastructure :: Module FoamServer :: Class FoamAnswerer
[hide private]
[frames] | no frames]

Class FoamAnswerer

source code

object --+
         |
        FoamAnswerer

The class that handles the actual requests (only needed to hide the Thread-methods from the world

Instance Methods [hide private]
 
__init__(self, run=None, master=None, lines=100, foamserver=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_insertLine(self, line)
Inserts a new line, not to be called via XMLRPC
source code
 
isFoamServer(self)
This is a Foam-Server (True by default)
source code
 
isLiving(self)
The calculation still generates output and therefor seems to be living
source code
 
_kill(self)
Interrupts the FOAM-process
source code
 
stop(self)
Stops the run gracefully (after writing the last time-step to disk)
source code
 
write(self)
Makes the program write the next time-step to disk and the continue
source code
 
argv(self)
Argument vector with which the runner was called
source code
 
usedArgv(self)
Argument vector with which the runner started the run
source code
 
isParallel(self)
Is it a parallel run?
source code
 
procNr(self)
How many processors are used?
source code
 
nrWarnings(self)
Number of warnings the executable emitted
source code
 
commandLine(self)
The command line
source code
 
actualCommandLine(self)
The actual command line used
source code
 
scriptName(self)
Name of the Python-Script that runs the show
source code
 
lastLogLineSeen(self)
Returns: the time at which the last log-line was seen
source code
 
lastTimeStepSeen(self)
Returns: the time at which the last log-line was seen
source code
 
lastLine(self)
Returns: the last line that was output by the running FOAM-process
source code
 
tail(self)
Returns: the current last lines as a string
source code
 
elapsedTime(self)
Returns: time in seconds since the last line was output
source code
 
getEnviron(self, name)
Returns: value of the variable, empty string if non-existing
source code
 
mpi(self)
Returns: name of the MPI-implementation
source code
 
foamVersion(self)
Version number of the Foam-Version
source code
 
pyFoamVersion(self)
Returns: Version number of the PyFoam
source code
 
uname(self)
Returns: the complete uname-information
source code
 
ip(self)
Returns: the ip of this machine
source code
 
hostname(self)
Returns: The name of the computer
source code
 
configuration(self)
Returns: all the configured parameters
source code
 
cwd(self)
Returns: the current working directory
source code
 
pid(self)
Returns: the PID of the script
source code
 
loadAvg(self)
Returns: a tuple with the average loads of the last 1, 5 and 15 minutes
source code
 
user(self)
Returns: the user that runs this script
source code
 
id(self)
Returns: an ID for this run: IP:port:startTimestamp
source code
 
startTimestamp(self)
Returns: the unix-timestamp of the process start
source code
 
time(self)
Returns: the current time in the simulation
source code
 
createTime(self)
Returns: the time in the simulation for which the mesh was created
source code
 
_readParameter(self, name)
Reads a parametr from the controlDict
source code
 
startTime(self)
Returns: parameter startTime from the controlDict
source code
 
endTime(self)
Returns: parameter endTime from the controlDict
source code
 
deltaT(self)
Returns: parameter startTime from the controlDict
source code
 
pathToSolution(self)
Returns: the path to the solution directory
source code
 
writtenTimesteps(self)
Returns: list of the timesteps on disc
source code
 
solutionFiles(self, time)
Returns: list of the solution files at that timestep
source code
 
listFiles(self, directory)
Returns: List of the filenames (not directories) in that case
source code
 
getDictionaryText(self, directory, name)
Returns: the contents of the file as a big string
source code
 
getDictionaryContents(self, directory, name)
Returns: the contents of the file as a python data-structure
source code
 
writeDictionaryText(self, directory, name, text)
Writes the contents of a dictionary
source code
 
writeDictionaryContents(self, directory, name, contents)
Writes the contents of a dictionary
source code
 
getPlots(self)
Get all the information about the plots
source code
 
getPlotData(self)
Get all the data for the plots
source code
 
controlDictUnmodified(self)
Checks whether there is a pending change to the controlDict
source code
 
getRemark(self)
Get the user-defined remark for this job
source code
 
setRemark(self, remark)
Overwrite the user-defined remark
source code
 
jobId(self)
Return the job-ID of the queuing-system.
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, run=None, master=None, lines=100, foamserver=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • run - The thread that controls the run
  • master - The Runner-Object that controls everything
  • lines - the number of lines the server should remember
Overrides: object.__init__

lastLogLineSeen(self)

source code 
Returns:
the time at which the last log-line was seen

lastTimeStepSeen(self)

source code 
Returns:
the time at which the last log-line was seen

lastLine(self)

source code 
Returns:
the last line that was output by the running FOAM-process

tail(self)

source code 
Returns:
the current last lines as a string

elapsedTime(self)

source code 
Returns:
time in seconds since the last line was output

getEnviron(self, name)

source code 
Parameters:
  • name - name of an environment variable
Returns:
value of the variable, empty string if non-existing

mpi(self)

source code 
Returns:
name of the MPI-implementation

pyFoamVersion(self)

source code 
Returns:
Version number of the PyFoam

uname(self)

source code 
Returns:
the complete uname-information

ip(self)

source code 
Returns:
the ip of this machine

hostname(self)

source code 
Returns:
The name of the computer

configuration(self)

source code 
Returns:
all the configured parameters

cwd(self)

source code 
Returns:
the current working directory

pid(self)

source code 
Returns:
the PID of the script

loadAvg(self)

source code 
Returns:
a tuple with the average loads of the last 1, 5 and 15 minutes

user(self)

source code 
Returns:
the user that runs this script

id(self)

source code 
Returns:
an ID for this run: IP:port:startTimestamp

startTimestamp(self)

source code 
Returns:
the unix-timestamp of the process start

time(self)

source code 
Returns:
the current time in the simulation

createTime(self)

source code 
Returns:
the time in the simulation for which the mesh was created

_readParameter(self, name)

source code 

Reads a parametr from the controlDict

Parameters:
  • name - the parameter
Returns:
The value

startTime(self)

source code 
Returns:
parameter startTime from the controlDict

endTime(self)

source code 
Returns:
parameter endTime from the controlDict

deltaT(self)

source code 
Returns:
parameter startTime from the controlDict

pathToSolution(self)

source code 
Returns:
the path to the solution directory

writtenTimesteps(self)

source code 
Returns:
list of the timesteps on disc

solutionFiles(self, time)

source code 
Parameters:
  • time - name of the timestep
Returns:
list of the solution files at that timestep

listFiles(self, directory)

source code 
Parameters:
  • directory - Sub-directory of the case
Returns:
List of the filenames (not directories) in that case

getDictionaryText(self, directory, name)

source code 
Parameters:
  • directory - Sub-directory of the case
  • name - name of the dictionary file
Returns:
the contents of the file as a big string

getDictionaryContents(self, directory, name)

source code 
Parameters:
  • directory - Sub-directory of the case
  • name - name of the dictionary file
Returns:
the contents of the file as a python data-structure

writeDictionaryText(self, directory, name, text)

source code 

Writes the contents of a dictionary

Parameters:
  • directory - Sub-directory of the case
  • name - name of the dictionary file
  • text - String with the dictionary contents

writeDictionaryContents(self, directory, name, contents)

source code 

Writes the contents of a dictionary

Parameters:
  • directory - Sub-directory of the case
  • name - name of the dictionary file
  • contents - Python-dictionary with the dictionary contents

setRemark(self, remark)

source code 

Overwrite the user-defined remark

Returns:
True if the remark was set previously

jobId(self)

source code 

Return the job-ID of the queuing-system. Empty if unset