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

Source Code for Module PyFoam.Applications.CommonClearCase

 1  """ 
 2  Class that implements the common functionality for clearing the cases 
 3  """ 
 4   
 5  from PyFoam.ThirdParty.six import print_ 
 6   
7 -class CommonClearCase(object):
8 """ The class that clears the case 9 """ 10
11 - def addOptions(self):
12 self.ensureGeneralOptions() 13 self.generalOpts.add_option("--clear-case", 14 action="store_true", 15 default=False, 16 dest="clearCase", 17 help="Clear all timesteps except for the first before running") 18 self.generalOpts.add_option("--complete-clear", 19 action="store_true", 20 default=False, 21 dest="clearComplete", 22 help="Like clear-case but removes the function-object data as well")
23
24 - def clearCase(self,sol):
25 if self.opts.clearComplete: 26 self.opts.clearCase=True 27 if self.opts.clearCase: 28 print_("Clearing out old timesteps ....") 29 sol.clearResults(functionObjectData=self.opts.clearComplete)
30 31 # Should work with Python3 and Python2 32