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

Source Code for Module PyFoam.Applications.SteadyRunner

 1  #  ICE Revision: $Id: SteadyRunner.py 9421 2008-09-22 08:00:27Z bgschaid $  
 2  """ 
 3  Application class that implements pyFoamSteadyRunner 
 4  """ 
 5   
 6  from os import path 
 7   
 8  from PyFoamApplication import PyFoamApplication 
 9   
10  from PyFoam.Execution.ConvergenceRunner import ConvergenceRunner 
11  from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer 
12  from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory 
13   
14  from PyFoam.Error import warning 
15   
16  from CommonParallel import CommonParallel 
17  from CommonRestart import CommonRestart 
18  from CommonPlotLines import CommonPlotLines 
19  from CommonClearCase import CommonClearCase 
20  from CommonReportUsage import CommonReportUsage 
21  from CommonSafeTrigger import CommonSafeTrigger 
22  from CommonWriteAllTrigger import CommonWriteAllTrigger 
23  from CommonStandardOutput import CommonStandardOutput 
24   
25 -class SteadyRunner(PyFoamApplication, 26 CommonPlotLines, 27 CommonSafeTrigger, 28 CommonWriteAllTrigger, 29 CommonClearCase, 30 CommonReportUsage, 31 CommonParallel, 32 CommonRestart, 33 CommonStandardOutput):
34 - def __init__(self,args=None):
35 description=""" 36 Runs an OpenFoam steady solver. Needs the usual 3 arguments (<solver> 37 <directory> <case>) and passes them on (plus additional arguments) 38 Output is sent to stdout and a logfile inside the case directory 39 (PyFoamSolver.logfile). The Directory PyFoamSolver.analyzed contains 40 this information a) Residuals and other information of the linear 41 solvers b) Execution time c) continuity information d) bounding of 42 variables 43 44 If the solver has converged (linear solvers below threshold) it is 45 stopped and the last simulation state is written to disk 46 """ 47 48 CommonPlotLines.__init__(self) 49 PyFoamApplication.__init__(self, 50 args=args, 51 description=description)
52
53 - def addOptions(self):
62
63 - def run(self):
64 cName=self.parser.casePath() 65 self.checkCase(cName) 66 67 self.processPlotLineOptions(autoPath=cName) 68 69 sol=SolutionDirectory(cName,archive=None) 70 71 self.clearCase(sol) 72 73 lam=self.getParallel() 74 75 self.setLogname() 76 77 run=ConvergenceRunner(BoundingLogAnalyzer(progress=self.opts.progress), 78 silent=self.opts.progress, 79 argv=self.parser.getArgs(), 80 restart=self.opts.restart, 81 server=True, 82 logname=self.opts.logname, 83 lam=lam) 84 85 self.addPlotLineAnalyzers(run) 86 87 self.addSafeTrigger(run,sol) 88 self.addWriteAllTrigger(run,sol) 89 90 run.start() 91 92 self.reportUsage(run)
93