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


Python SolutionDirectory.boundaryDict方法代码示例

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


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

示例1: doRegion

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

#.........这里部分代码省略.........
                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,
                                                                        region=theRegion,
                                                                        time=self.opts.time),
                                                       treatBinaryAsASCII=self.opts.treatBinaryAsASCII
                                                       )[b]["nFaces"]
                        except IOError:
                            nFaces= ParsedBoundaryDict(sol.boundaryDict(processor=p,
                                                                        region=theRegion),
                                                       treatBinaryAsASCII=self.opts.treatBinaryAsASCII
                                                       )[b]["nFaces"]
                        except KeyError:
                            nFaces=0

                        tab[(nr,i+1)]=nFaces

                print_(tab)

        if self.opts.longBCreport:
            print_(ReST.heading("The boundary conditions for t =",time))

            for b in boundaryNames:
                print_(ReST.buildHeading("Boundary: ",b,level=self.opts.headingLevel+1))
                bound=boundary[b]
                print_(":Type:\t",bound["type"])
                if "physicalType" in bound:
                    print_(":Physical:\t",bound["physicalType"])
                print_(":Faces:\t",bound["nFaces"])
                print_()
                heads=["Field","type"]
                tab=ReST.table()
                tab[0]=heads
                tab.addLine(head=True)
                for row,fName in enumerate(fieldNames):
开发者ID:martinep,项目名称:foam-extend-svn,代码行数:70,代码来源:CaseReport.py


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