当前位置: 首页>>代码示例>>Python>>正文


Python SolutionDirectory.clearResults方法代码示例

本文整理汇总了Python中PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.clearResults方法的典型用法代码示例。如果您正苦于以下问题:Python SolutionDirectory.clearResults方法的具体用法?Python SolutionDirectory.clearResults怎么用?Python SolutionDirectory.clearResults使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory的用法示例。


在下文中一共展示了SolutionDirectory.clearResults方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: run

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clearResults [as 别名]
    def run(self):
        cName=self.parser.casePath()

        self.checkCase(cName)

        sol=SolutionDirectory(cName,archive=None)

        print_("Clearing out old timesteps ....")

        sol.clearResults()

        self.checkAndCommit(SolutionDirectory(cName,archive=None))

        run=BasicRunner(argv=self.parser.getArgs(),
                        server=self.opts.server,
                        logname="PyFoamMeshUtility")

        self.addLibFunctionTrigger(run,sol)

        self.addToCaseLog(cName,"Starting")

        run.start()

        self.setData(run.data)

        sol.reread(force=True)

        self.addToCaseLog(cName,"Ending")

        if sol.latestDir()!=sol.initialDir():
            for f in listdir(path.join(sol.latestDir(),"polyMesh")):
                system("mv -f "+path.join(sol.latestDir(),"polyMesh",f)+" "+sol.polyMeshDir())

            print_("\nClearing out new timesteps ....")

            sol.clearResults()
        else:
            print_("\n\n  No new timestep. Utility propably failed")
开发者ID:LeeRuns,项目名称:PyFoam,代码行数:40,代码来源:MeshUtilityRunner.py

示例2: range

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clearResults [as 别名]
and after it has finished runs utilies that postprocess the output.
Collects some results"""

from PyFoam.Execution.ConvergenceRunner import ConvergenceRunner
from PyFoam.Execution.UtilityRunner import UtilityRunner
from PyFoam.LogAnalysis.BoundingLogAnalyzer import BoundingLogAnalyzer
from PyFoam.RunDictionary.SolutionFile import SolutionFile
from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory

solver="simpleFoam"
case="pitzDaily"
pCmd="calcPressureDifference"
mCmd="calcMassFlow"

dire=SolutionDirectory(case,archive="InletVariation")
dire.clearResults()
dire.addBackup("PyFoamSolve.logfile")
dire.addBackup("PyFoamSolve.analyzed")
dire.addBackup("Pressure.analyzed")
dire.addBackup("MassFlow.analyzed")

sol=SolutionFile(dire.initialDir(),"U")

maximum=1.
nr=10

f=dire.makeFile("InflowVariationResults")

for i in range(nr+1):
    # Set the boundary condition at the inlet
    val=(maximum*i)/nr
开发者ID:LeeRuns,项目名称:PyFoam,代码行数:33,代码来源:doInletVariation.py

示例3: SolutionDirectory

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clearResults [as 别名]
from PyFoam.Execution.AnalyzedRunner import AnalyzedRunner
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']
开发者ID:schmidi093,项目名称:RTVC,代码行数:33,代码来源:runPolarStudy.py

示例4:

# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import clearResults [as 别名]
import sys

from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory

dName=sys.argv[1]

sd=SolutionDirectory(dName)

sd.lastToArchive("test")
sd.clearResults()

开发者ID:LeeRuns,项目名称:PyFoam,代码行数:12,代码来源:testSolutionDir.py


注:本文中的PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.clearResults方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。