Home | Trees | Indices | Help |
---|
|
1 """Gets information about the mesh of a case. Makes no attempt to manipulate 2 the mesh, because this is better left to the OpenFOAM-utilities""" 3 4 from SolutionDirectory import SolutionDirectory 5 from ListFile import ListFile 6 from PyFoam.Error import PyFoamException 7 from ParsedParameterFile import ParsedFileHeader 8 9 from os import path 10 import re 1113 """Reads Information about the mesh on demand""" 145016 """@param case: Path to the case-directory 17 @param time: Time for which the mesh should be looked at 18 @param processor: Name of the processor directory for decomposed cases""" 19 self.sol=SolutionDirectory(case,paraviewLink=False,archive=None) 20 self.time=time 21 self.processor=processor2224 try: 25 return self.faces 26 except AttributeError: 27 faces=ListFile(self.sol.polyMeshDir(time=self.time,processor=self.processor),"faces") 28 self.faces=faces.getSize() 29 return self.faces3032 try: 33 return self.points 34 except AttributeError: 35 points=ListFile(self.sol.polyMeshDir(time=self.time,processor=self.processor),"points") 36 self.points=points.getSize() 37 return self.points3840 try: 41 return self.cells 42 except: 43 try: 44 owner=ParsedFileHeader(path.join(self.sol.polyMeshDir(time=self.time,processor=self.processor),"owner")) 45 mat=re.compile('.+nCells: *([0-9]+) .+').match(owner["note"]) 46 self.cells=int(mat.group(1)) 47 return self.cells 48 except: 49 raise PyFoamException("Not Implemented")
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Jun 9 23:05:12 2010 | http://epydoc.sourceforge.net |