本文整理汇总了Python中PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.clear方法的典型用法代码示例。如果您正苦于以下问题:Python SolutionDirectory.clear方法的具体用法?Python SolutionDirectory.clear怎么用?Python SolutionDirectory.clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory
的用法示例。
在下文中一共展示了SolutionDirectory.clear方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: run
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clear [as 别名]
def run(self):
if not self.opts.keepPostprocessing:
self.opts.additional.append("postProcessing")
for cName in self.parser.getArgs():
if self.checkCase(cName,fatal=self.opts.fatal,verbose=not self.opts.silent):
self.addLocalConfig(cName)
if self.opts.verbose:
print_("Clearing",cName)
sol=SolutionDirectory(cName,archive=None,paraviewLink=False)
sol.clear(after=self.parser.getOptions().after,
processor=self.parser.getOptions().processor,
pyfoam=self.parser.getOptions().pyfoam,
vtk=self.parser.getOptions().vtk,
removeAnalyzed=self.parser.getOptions().removeAnalyzed,
keepRegular=self.parser.getOptions().keepRegular,
keepParallel=self.parser.getOptions().keepParallel,
keepLast=self.parser.getOptions().latest,
keepInterval=self.parser.getOptions().keepInterval,
clearHistory=self.parser.getOptions().clearHistory,
clearParameters=self.parser.getOptions().clearParameters,
additional=self.parser.getOptions().additional,
functionObjectData=self.parser.getOptions().functionObjectData)
self.addToCaseLog(cName)
示例2: run
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clear [as 别名]
def run(self):
if not self.opts.keepPostprocessing:
self.opts.additional.append("postProcessing")
notCleared=[]
if self.opts.dryRun:
self.opts.verbose=True
self.opts.verboseClear=True
for cName in self.parser.getArgs():
if self.checkCase(cName,fatal=self.opts.fatal,verbose=not self.opts.silent):
if self.opts.allcleanScript:
scr=path.join(cName,"Allclean")
if(path.exists(scr)):
if self.opts.verbose or self.opts.verboseClear:
print("Executing",scr)
execute(scr,workdir=cName)
try:
self.addLocalConfig(cName)
if self.opts.verbose:
print_("Clearing",cName)
sol=SolutionDirectory(cName,
archive=None,
parallel=True,
paraviewLink=False)
sol.clear(after=self.parser.getOptions().after,
processor=self.parser.getOptions().processor,
pyfoam=self.parser.getOptions().pyfoam,
vtk=self.parser.getOptions().vtk,
verbose=self.parser.getOptions().verboseClear,
removeAnalyzed=self.parser.getOptions().removeAnalyzed,
keepRegular=self.parser.getOptions().keepRegular,
keepParallel=self.parser.getOptions().keepParallel,
keepLast=self.parser.getOptions().latest,
keepInterval=self.parser.getOptions().keepInterval,
keepTimes=self.opts.keepTimes,
clearHistory=self.parser.getOptions().clearHistory,
clearParameters=self.parser.getOptions().clearParameters,
additional=self.parser.getOptions().additional,
dryRun=self.opts.dryRun,
functionObjectData=self.parser.getOptions().functionObjectData)
self.addToCaseLog(cName)
except OSError:
e = sys.exc_info()[1] # compatible with 2.x and 3.x
self.warning("Can not clear",cName,"because of OSError",e)
notCleared.append(cName)
if len(notCleared)>0:
self.warning("These case not cleared because of OS-problems:",
", ".join(notCleared))
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder-other-scripting-PyFoam,代码行数:55,代码来源:ClearCase.py
示例3: run
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clear [as 别名]
def run(self):
for cName in self.parser.getArgs():
if self.checkCase(cName,fatal=self.opts.fatal,verbose=not self.opts.silent):
self.addLocalConfig(cName)
if self.opts.verbose:
print "Clearing",cName
sol=SolutionDirectory(cName,archive=None,paraviewLink=False)
sol.clear(after=self.parser.getOptions().after,
processor=self.parser.getOptions().processor,
pyfoam=self.parser.getOptions().pyfoam,
vtk=self.parser.getOptions().vtk,
keepRegular=self.parser.getOptions().keepRegular,
keepLast=self.parser.getOptions().latest,
clearHistory=self.parser.getOptions().clearHistory,
functionObjectData=self.parser.getOptions().functionObjectData)
self.addToCaseLog(cName)
示例4: SolutionDirectory
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clear [as 别名]
from PyFoam.LogAnalysis.StandardLogAnalyzer import StandardLogAnalyzer
from PyFoam.Execution.BasicRunner import BasicRunner
from PyFoam.Execution.GnuplotRunner import GnuplotRunner
case = "polarStudy"
caseDir = SolutionDirectory(".",archive="polars")
caseDir.addBackup("postProcessing/forceCoeffs/0/forceCoeffs.dat")
caseDir.addBackup("PyFoamSolve.logfile")
caseDir.addBackup("PyFoamSolve.analyzed")
parameters = ParsedParameterFile("boundaryConditions",noHeader=True,preserveComments=False)
vRange = np.arange(25,31,2.5)
alphaRange = np.arange(0,11,1)
print vRange
caseDir.clearResults()
caseDir.clear(functionObjectData=True)
valueList = []
for i in range(len(vRange)):
for j in range(len(alphaRange)):
valueList.append({'velocity':vRange[i],'alpha':alphaRange[j]})
valueList.append({'velocity':10,'alpha':4})
valueList.append({'velocity':5,'alpha':10})
valueList.append({'velocity':7.5,'alpha':10})
print valueList
for k in range(6,len(valueList)):
vel = valueList[k]['velocity']
alpha = valueList[k]['alpha']