Package PyFoam :: Package LogAnalysis :: Module LogLineAnalyzer
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.LogAnalysis.LogLineAnalyzer

 1  #  ICE Revision: $Id: LogLineAnalyzer.py 7581 2007-06-27 15:29:14Z bgschaid $  
 2  """Base class for analyzing lines""" 
 3   
4 -class LogLineAnalyzer(object):
5 """Base class for the analysis of all lines from a OpenFOAM-log 6 7 Lines are available one at a time""" 8
9 - def __init__(self):
10 self.parent=None
11
12 - def doAnalysis(self,line):
13 """Analyze a line 14 15 line - the line to be analyzed 16 17 This method carries the main functionality in the sub-classes""" 18 pass
19
20 - def timeChanged(self):
21 """The value of the time has changed in the Log-file 22 23 For subclasses that need to know the current time""" 24 pass
25
26 - def setParent(self,parent):
27 """Introduces the LineAnalyzer to its supervisor 28 29 @param parent: The Analyzer class of which this is a part""" 30 self.parent=parent
31
32 - def setDirectory(self,oDir):
33 """Set the directory to which output is to be written (if any 34 output is written)""" 35 pass
36
37 - def goOn(self):
38 """If the analyzer thinks the simulation should be stopped 39 (for instance because of convergence) it returns false""" 40 return True
41
42 - def getTime(self):
43 """@returns: current time""" 44 return self.parent.getTime()
45