Package PyFoam :: Package RunDictionary :: Module MeshInformation
[hide private]
[frames] | no frames]

Source Code for Module PyFoam.RunDictionary.MeshInformation

 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   
7 -class MeshInformation:
8 """Reads Information about the mesh on demand""" 9
10 - def __init__(self,case):
11 """@param case: Path to the case-directory""" 12 self.sol=SolutionDirectory(case)
13
14 - def nrOfFaces(self):
15 try: 16 return self.faces 17 except AttributeError: 18 faces=ListFile(self.sol.polyMeshDir(),"faces") 19 self.faces=faces.getSize() 20 return self.faces
21
22 - def nrOfPoints(self):
23 try: 24 return self.points 25 except AttributeError: 26 points=ListFile(self.sol.polyMeshDir(),"points") 27 self.points=points.getSize() 28 return self.points
29
30 - def nrOfCells(self):
31 raise "NotImplemented"
32