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

Source Code for Module PyFoam.Applications.SteadyRunner

 1  #  ICE Revision: $Id: SteadyRunner.py 9973 2009-02-05 12:47:31Z 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  from CommonServer import CommonServer 
25   
26 -class SteadyRunner(PyFoamApplication, 27 CommonPlotLines, 28 CommonSafeTrigger, 29 CommonWriteAllTrigger, 30 CommonClearCase, 31 CommonServer, 32 CommonReportUsage, 33 CommonParallel, 34 CommonRestart, 35 CommonStandardOutput):
36 - def __init__(self,args=None):
37 description=""" 38 Runs an OpenFoam steady solver. Needs the usual 3 arguments (<solver> 39 <directory> <case>) and passes them on (plus additional arguments) 40 Output is sent to stdout and a logfile inside the case directory 41 (PyFoamSolver.logfile). The Directory PyFoamSolver.analyzed contains 42 this information a) Residuals and other information of the linear 43 solvers b) Execution time c) continuity information d) bounding of 44 variables 45 46 If the solver has converged (linear solvers below threshold) it is 47 stopped and the last simulation state is written to disk 48 """ 49 50 CommonPlotLines.__init__(self) 51 PyFoamApplication.__init__(self, 52 args=args, 53 description=description)
54
55 - def addOptions(self):
65
66 - def run(self):
67 cName=self.parser.casePath() 68 self.checkCase(cName) 69 70 self.processPlotLineOptions(autoPath=cName) 71 72 sol=SolutionDirectory(cName,archive=None) 73 74 self.clearCase(sol) 75 76 lam=self.getParallel() 77 78 self.setLogname() 79 80 run=ConvergenceRunner(BoundingLogAnalyzer(progress=self.opts.progress), 81 silent=self.opts.progress, 82 argv=self.parser.getArgs(), 83 restart=self.opts.restart, 84 server=self.opts.server, 85 logname=self.opts.logname, 86 lam=lam, 87 noLog=self.opts.noLog) 88 89 self.addPlotLineAnalyzers(run) 90 91 self.addSafeTrigger(run,sol) 92 self.addWriteAllTrigger(run,sol) 93 94 run.start() 95 96 self.reportUsage(run)
97