Package PyFoam :: Package Applications :: Module CommonPlotOptions
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.Applications.CommonPlotOptions

 1  """ 
 2  Class that implements common functionality for plotting options 
 3  """ 
 4   
5 -class CommonPlotOptions(object):
6 """ The class that adds plot options 7 """ 8
9 - def __init__(self,persist):
10 self.persistDefault=persist
11
12 - def addOptions(self):
13 self.parser.add_option("--frequency", 14 type="float", 15 dest="frequency", 16 default=1., 17 help="The frequency with which output should be generated (in seconds)") 18 self.parser.add_option("--persist", 19 action="store_true", 20 dest="persist", 21 default=self.persistDefault, 22 help="Gnuplot windows stay after interrupt") 23 self.parser.add_option("--non-persist", 24 action="store_false", 25 dest="persist", 26 help="Gnuplot windows close after interrupt") 27 self.parser.add_option("--raise", 28 action="store_true", 29 dest="raiseit", 30 help="Raise the Gnuplot windows after every replot") 31 self.parser.add_option("--no-default", 32 action="store_true", 33 default=False, 34 dest="nodefault", 35 help="Switch off the default plots (linear, continuity and bound)") 36 self.parser.add_option("--no-linear", 37 action="store_false", 38 default=True, 39 dest="linear", 40 help="Don't plot the linear solver convergence") 41 self.parser.add_option("--no-continuity", 42 action="store_false", 43 default=True, 44 dest="cont", 45 help="Don't plot the continuity info") 46 self.parser.add_option("--no-bound", 47 action="store_false", 48 default=True, 49 dest="bound", 50 help="Don't plot the bounding of variables") 51 self.parser.add_option("--with-iterations", 52 action="store_true", 53 default=False, 54 dest="iterations", 55 help="Plot the number of iterations of the linear solver") 56 self.parser.add_option("--with-courant", 57 action="store_true", 58 default=False, 59 dest="courant", 60 help="Plot the courant-numbers of the flow") 61 self.parser.add_option("--with-execution", 62 action="store_true", 63 default=False, 64 dest="execution", 65 help="Plot the execution time of each time-step") 66 self.parser.add_option("--with-deltat", 67 action="store_true", 68 default=False, 69 dest="deltaT", 70 help="'Plot the timestep-size time-step") 71 self.parser.add_option("--with-all", 72 action="store_true", 73 default=False, 74 dest="withAll", 75 help="Switch all possible plots on") 76 self.parser.add_option("--write-files", 77 action="store_true", 78 default=False, 79 dest="writeFiles", 80 help="Writes the parsed data to files")
81
82 - def processPlotOptions(self):
83 if self.opts.nodefault: 84 self.opts.linear=False 85 self.opts.cont=False 86 self.opts.bound=False 87 88 if self.opts.withAll: 89 self.opts.linear=True 90 self.opts.cont=True 91 self.opts.bound=True 92 self.opts.iterations=True 93 self.opts.courant=True 94 self.opts.execution=True 95 self.opts.deltaT=True
96