1 """
2 Class that implements the common functionality for clearing the cases
3 """
4
6 """ The class that clears the case
7 """
8
10 self.ensureGeneralOptions()
11 self.generalOpts.add_option("--clear-case",
12 action="store_true",
13 default=False,
14 dest="clearCase",
15 help="Clear all timesteps except for the first before running")
16 self.generalOpts.add_option("--complete-clear",
17 action="store_true",
18 default=False,
19 dest="clearComplete",
20 help="Like clear-case but removes the function-object data as well")
21
23 if self.opts.clearComplete:
24 self.opts.clearCase=True
25 if self.opts.clearCase:
26 print "Clearing out old timesteps ...."
27 sol.clearResults(functionObjectData=self.opts.clearComplete)
28