File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1220,6 +1220,25 @@ def type_columns(self, num_nodes):
12201220 nodes."""
12211221 return [col for col in self .column if col .num_nodes == num_nodes ]
12221222
1223+ def faces (self , cells = None ):
1224+ """Returns a list of the faces between the specified cells. A
1225+ list of the cells may be optionally specified, otherwise all
1226+ cells will be included.
1227+ """
1228+ if cells is None : cells = self .cell
1229+ cell_dict = {c .index : c for c in cells }
1230+ face_keys = set ()
1231+ for c in cells :
1232+ for nbr in c .neighbour :
1233+ if nbr .index in cell_dict :
1234+ face_keys .add (frozenset ([c .index , nbr .index ]))
1235+ faces = []
1236+ for key in face_keys :
1237+ cells = [self .cell [c ] for c in key ]
1238+ f = face (cells )
1239+ faces .append (f )
1240+ return faces
1241+
12231242 def translate (self , shift ):
12241243 """Translates the mesh by the specified 3-D shift vector (tuple, list
12251244 or array of length 3)."""
You can’t perform that action at this time.
0 commit comments