本文整理汇总了Python中PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory.processorDirs方法的典型用法代码示例。如果您正苦于以下问题:Python SolutionDirectory.processorDirs方法的具体用法?Python SolutionDirectory.processorDirs怎么用?Python SolutionDirectory.processorDirs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory
的用法示例。
在下文中一共展示了SolutionDirectory.processorDirs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: additionalReconstruct
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import processorDirs [as 别名]
def additionalReconstruct(self,parameters):
sol=SolutionDirectory(self.casename())
if len(sol.processorDirs())>0:
for t in listdir(path.join(self.casename(),sol.processorDirs()[0])):
try:
tm=float(t)
self.foamRun("reconstructParMesh",foamArgs=["-time",t])
self.foamRun("reconstructPar",foamArgs=["-time",t])
except ValueError:
print "Skipping",t
开发者ID:Unofficial-Extend-Project-Mirror,项目名称:openfoam-extend-Breeder1.7-libraries-swak4Foam,代码行数:12,代码来源:runSplash.py
示例2: doRegion
# 需要导入模块: from PyFoam.RunDictionary.SolutionDirectory import SolutionDirectory [as 别名]
# 或者: from PyFoam.RunDictionary.SolutionDirectory.SolutionDirectory import processorDirs [as 别名]
#.........这里部分代码省略.........
print_("Accumulated from",sol.nrProcs(),"processors")
else:
procs=[None]
for p in procs:
info=MeshInformation(sol.name,
processor=p,
region=theRegion,
time=self.opts.time)
nFaces+=info.nrOfFaces()
nPoints+=info.nrOfPoints()
try:
nCells+=info.nrOfCells()
except:
nCells="Not available"
tab=ReST.table()
tab[0]=("Faces",nFaces)
tab[1]=("Points",nPoints)
tab[2]=("Cells",nCells)
print_(tab)
if self.opts.decomposition:
print_(ReST.heading("Decomposition"))
if sol.nrProcs()<2:
print_("This case is not decomposed")
else:
print_("Case is decomposed for",sol.nrProcs(),"processors")
print_()
nCells=[]
nFaces=[]
nPoints=[]
for p in sol.processorDirs():
info=MeshInformation(sol.name,
processor=p,
region=theRegion,
time=self.opts.time)
nPoints.append(info.nrOfPoints())
nFaces.append(info.nrOfFaces())
nCells.append(info.nrOfCells())
digits=int(ceil(log10(max(sol.nrProcs(),
max(nCells),
max(nFaces),
max(nPoints)
))))+2
nameLen=max(len("Points"),boundMaxLen)
tab=ReST.table()
tab[0]=["CPU"]+list(range(sol.nrProcs()))
tab.addLine()
tab[1]=["Points"]+nPoints
tab[2]=["Faces"]+nFaces
tab[3]=["Cells"]+nCells
tab.addLine(head=True)
nr=3
for b in boundaryNames:
nr+=1
tab[(nr,0)]=b
for i,p in enumerate(sol.processorDirs()):
try:
nFaces= ParsedBoundaryDict(sol.boundaryDict(processor=p,