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

Source Code for Module PyFoam.LogAnalysis.LogLineAnalyzer

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