def test_VectorIdenties(self):
hx, hy, hz = [[(1, 4)], [(1, 4)], [(1, 4)]]
M = discretize.TreeMesh([hx, hy, hz], levels=2)
Mr = discretize.TensorMesh([hx, hy, hz])
assert (M.faceDiv * M.edgeCurl).nnz == 0
assert (Mr.faceDiv * Mr.edgeCurl).nnz == 0
hx, hy, hz = np.r_[1., 2, 3, 4], np.r_[5., 6, 7, 8], np.r_[9., 10, 11, 12]
M = discretize.TreeMesh([hx, hy, hz], levels=2)
Mr = discretize.TensorMesh([hx, hy, hz])
assert np.max(np.abs((M.faceDiv * M.edgeCurl).todense().flatten())) < TOL
assert np.max(np.abs((Mr.faceDiv * Mr.edgeCurl).todense().flatten())) < TOL
评论列表
文章目录