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

Source Code for Module PyFoam.Applications.ClearCase

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