count and link Y faces

This commit is contained in:
rowanc1
2014-02-09 18:49:01 -08:00
parent 13767ecbe1
commit c477528452
2 changed files with 33 additions and 11 deletions
+32 -9
View File
@@ -430,14 +430,37 @@ class TreeCell(TreeObject):
# 0 t0--> 1
order = [{'c':[0,0,0], 'fXm': ('p', 'fXm', [0,0]), 'fXp': 'new' },
{'c':[1,0,0], 'fXm': ('c', 'fXp', [0,0,0]), 'fXp': ('p', 'fXp', [0,0])},
{'c':[0,1,0], 'fXm': ('p', 'fXm', [1,0]), 'fXp': 'new' },
{'c':[1,1,0], 'fXm': ('c', 'fXp', [0,1,0]), 'fXp': ('p', 'fXp', [1,0])},
{'c':[0,0,1], 'fXm': ('p', 'fXm', [0,1]), 'fXp': 'new' },
{'c':[1,0,1], 'fXm': ('c', 'fXp', [0,0,1]), 'fXp': ('p', 'fXp', [0,1])},
{'c':[0,1,1], 'fXm': ('p', 'fXm', [1,1]), 'fXp': 'new' },
{'c':[1,1,1], 'fXm': ('c', 'fXp', [0,1,1]), 'fXp': ('p', 'fXp', [1,1])}]
order = [{'c':[0,0,0],
'fXm': ('p', 'fXm', [0,0]), 'fXp': 'new' ,
'fYm': ('p', 'fYm', [0,0]), 'fYp': 'new' ,},
{'c':[1,0,0],
'fXm': ('c', 'fXp', [0,0,0]), 'fXp': ('p', 'fXp', [0,0]),
'fYm': ('p', 'fYm', [1,0]), 'fYp': 'new' ,},
{'c':[0,1,0],
'fXm': ('p', 'fXm', [1,0]), 'fXp': 'new' ,
'fYm': ('c', 'fYp', [0,0,0]), 'fYp': ('p', 'fYp', [0,0])},
{'c':[1,1,0],
'fXm': ('c', 'fXp', [0,1,0]), 'fXp': ('p', 'fXp', [1,0]),
'fYm': ('c', 'fYp', [1,0,0]), 'fYp': ('p', 'fYp', [1,0])},
{'c':[0,0,1],
'fXm': ('p', 'fXm', [0,1]), 'fXp': 'new' ,
'fYm': ('p', 'fYm', [0,1]), 'fYp': 'new' ,},
{'c':[1,0,1],
'fXm': ('c', 'fXp', [0,0,1]), 'fXp': ('p', 'fXp', [0,1]),
'fYm': ('p', 'fYm', [1,1]), 'fYp': 'new' ,},
{'c':[0,1,1],
'fXm': ('p', 'fXm', [1,1]), 'fXp': 'new' ,
'fYm': ('c', 'fYp', [0,0,1]), 'fYp': ('p', 'fYp', [0,1])},
{'c':[1,1,1],
'fXm': ('c', 'fXp', [0,1,1]), 'fXp': ('p', 'fXp', [1,1]),
'fYm': ('c', 'fYp', [1,0,1]), 'fYp': ('p', 'fYp', [1,1])}]
self.mesh.isNumbered = False
@@ -457,7 +480,7 @@ class TreeCell(TreeObject):
for O in order:
i, j, k = O['c']
x0r = np.r_[x0[0] + 0.5*i*sz[0], x0[1] + 0.5*j*sz[1], x0[2] + 0.5*k*sz[2]]
fXm, fXp, fYm, fYp, fZm, fZp = getFace(O['fXm']), getFace(O['fXp']), None, None, None, None
fXm, fXp, fYm, fYp, fZm, fZp = getFace(O['fXm']), getFace(O['fXp']), getFace(O['fYm']), getFace(O['fYp']), None, None
self.children[i,j,k] = TreeCell(self.mesh, x0=x0r, depth=self.depth+1, sz=0.5*sz, parent=self, fXm=fXm, fXp=fXp, fYm=fYm, fYp=fYp, fZm=fZm, fZp=fZp)
self.mesh.cells.remove(self)
+1 -2
View File
@@ -19,14 +19,13 @@ class TestOcTreeObjects(unittest.TestCase):
self.assertTrue(self.M.nF == 11)
self.assertTrue(self.M.nN == 12)
print self.Mr.nN
self.assertTrue(self.Mr.nC == 9)
print self.Mr.nFx
self.assertTrue(self.Mr.nFx == 13)
self.assertTrue(self.Mr.nFy == 14)
self.assertTrue(self.Mr.nFz == 14)
self.assertTrue(self.Mr.nF == 41)
print self.Mr.nN
self.assertTrue(self.Mr.nN == 22)
# def test_pointersM(self):