1 """Works with a polyMesh/boundary-File"""
2
3 from ParsedParameterFile import ParsedBoundaryDict
4 from SolutionDirectory import SolutionDirectory
5
7 """Handles data in a boundary-File"""
8
9 - def __init__(self,case,backup=False,region=None):
12
14 return self.content[key]
15
17 if not type(value)==dict:
18 raise "BoundaryType",("Type of boundary element must be dict, is",type(value))
19 for k in ["type","nFaces","startFace"]:
20 if not value.has_key(k):
21 raise "BoundaryType",("Required key",k,"is missing from",value,"not a valid patch")
22
23 self.content[key]=value
24
26 for p in self.content:
27 yield p
28
30 """Returns a list with the names of the patches
31 @param patchType: If specified only patches of the specific type are returned"""
32
33 if patchType==None:
34 return self.content.keys()
35 else:
36 result=[]
37 for k,v in self.content.iteritems():
38 if v["type"]==patchType:
39 result.append(k)
40 return result
41