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

Source Code for Module PyFoam.LogAnalysis.UtilityAnalyzer

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