1 """
2 Application-class that implements pyFoamClearCase.py
3 """
4 from optparse import OptionGroup
5
6 from PyFoamApplication import PyFoamApplication
7
8 from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory
9
12 description="""
13 Removes all timesteps but the first from a case-directory.
14 Also removes other data that is generated by sovers/utilities/PyFoam
15 """
16 PyFoamApplication.__init__(self,
17 args=args,
18 description=description,
19 usage="%prog <caseDirectory>",
20 interspersed=True,
21 changeVersion=False,
22 nr=1,
23 exactNr=False)
24
26 what=OptionGroup(self.parser,
27 "What",
28 "Define what should be cleared")
29 self.parser.add_option_group(what)
30
31 what.add_option("--after",
32 type="float",
33 dest="after",
34 default=None,
35 help="Only remove timesteps after this time")
36 what.add_option("--processor",
37 action="store_true",
38 dest="processor",
39 default=False,
40 help="Keep the processor directories")
41 what.add_option("--no-pyfoam",
42 action="store_false",
43 dest="pyfoam",
44 default=True,
45 help="Keep the PyFoam-specific directories and logfiles")
46 what.add_option("--keep-last",
47 action="store_true",
48 dest="latest",
49 default=False,
50 help="Keep the data from the last time-step")
51
59