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

Source Code for Module PyFoam.LogAnalysis.UtilityAnalyzer

 1  #  ICE Revision: $Id$  
 2  """Analyze OpenFOAM utility""" 
 3   
 4  from FoamLogAnalyzer import FoamLogAnalyzer 
 5  from RegExpLineAnalyzer import RegExpLineAnalyzer 
 6   
7 -class UtilityAnalyzer(FoamLogAnalyzer):
8 """ 9 Analyzer for non-solver Utilities 10 11 Regular expressions can be added and the data generated by them 12 can be accessed 13 """
14 - def __init__(self,progress=False):
15 """ 16 @param progress: Print time progress on console? 17 """ 18 FoamLogAnalyzer.__init__(self,progress=progress)
19
20 - def addExpression(self,name,expr,idNr=None):
21 """Add a RegExp 22 23 @param name: name of the RegExp 24 @param expr: the RegExp 25 @param idNr: number of the pattern group that identifies data-sets 26 """ 27 self.addAnalyzer(name,RegExpLineAnalyzer(name,expr,idNr))
28
29 - def getData(self,name,time=None,ID=None):
30 """Get data 31 32 @param name: name of the RegExp 33 @param time: time from which the data set it to be read 34 @param ID: identification of the data set 35 @return: tuple with the data 36 """ 37 a=self.getAnalyzer(name) 38 if a==None: 39 return None 40 else: 41 return a.getData(time=time,ID=ID)
42
43 - def getIDs(self,name):
44 """Get a list with the available IDs""" 45 a=self.getAnalyzer(name) 46 if a==None: 47 return None 48 else: 49 return a.getIDs()
50
51 - def getTimes(self,name,ID=None):
52 """Get a list with the available times for a specific ID""" 53 a=self.getAnalyzer(name) 54 if a==None: 55 return None 56 else: 57 return a.getTimes(ID=ID)
58