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,args=args,description=description,usage="%prog <caseDirectory>",interspersed=True,nr=1)
16
17 - def addOptions(self):
18 self.parser.add_option("--after", 19 type="float", 20 dest="after", 21 default=None, 22 help="Only remove timesteps after this time") 23 self.parser.add_option("--processor", 24 action="store_true", 25 dest="processor", 26 default=False, 27 help="Keep the processor directories") 28 self.parser.add_option("--no-pyfoam", 29 action="store_false", 30 dest="pyfoam", 31 default=True, 32 help="Keep the PyFoam-specific directories and logfiles") 33 self.parser.add_option("--keep-last", 34 action="store_true", 35 dest="latest", 36 default=False, 37 help="Keep the data from the last time-step")
38
39 - def run(self):
40 cName=self.parser.getArgs()[0] 41 42 sol=SolutionDirectory(cName,archive=None,paraviewLink=False) 43 sol.clear(after=self.parser.getOptions().after, 44 processor=self.parser.getOptions().processor, 45 pyfoam=self.parser.getOptions().pyfoam, 46 keepLast=self.parser.getOptions().latest)
47