mirror of
https://github.com/wassname/simpeg.git
synced 2026-06-27 21:08:35 +08:00
eye --> identity, spzeros -> csr
This commit is contained in:
@@ -238,8 +238,8 @@ class CylMesh(BaseTensorMesh, InnerProducts):
|
||||
dz = sp.spdiags((np.ones((self.nCz+1, 1))*[-1, 1]).T, [0,1], self.nCz, self.nCz+1, format="csr")
|
||||
|
||||
#2D Difference matricies
|
||||
Dr = sp.kron(sp.eye(self.nNz), dr)
|
||||
Dz = -sp.kron(dz, sp.eye(self.nCx)) #Not sure about this negative
|
||||
Dr = sp.kron(sp.identity(self.nNz), dr)
|
||||
Dz = -sp.kron(dz, sp.identity(self.nCx))
|
||||
|
||||
#Edge curl operator
|
||||
self._edgeCurl = sp.diags(1/self.area,0)*sp.vstack((Dz, Dr))*sp.diags(self.edge,0)
|
||||
|
||||
@@ -105,7 +105,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
A = sp.vstack((sp.hstack((sdiag(a[0]), sdiag(a[1]))),
|
||||
sp.hstack((sdiag(a[2]), sdiag(a[3])))))
|
||||
|
||||
Z2 = B*A - sp.eye(10, 10)
|
||||
Z2 = B*A - sp.identity(10)
|
||||
self.assertTrue(np.linalg.norm(Z2.todense().ravel(), 2) < TOL)
|
||||
|
||||
a = [np.random.rand(5, 1) for i in range(9)]
|
||||
@@ -115,7 +115,7 @@ class TestSequenceFunctions(unittest.TestCase):
|
||||
sp.hstack((sdiag(a[3]), sdiag(a[4]), sdiag(a[5]))),
|
||||
sp.hstack((sdiag(a[6]), sdiag(a[7]), sdiag(a[8])))))
|
||||
|
||||
Z3 = B*A - sp.eye(15, 15)
|
||||
Z3 = B*A - sp.identity(15)
|
||||
|
||||
self.assertTrue(np.linalg.norm(Z3.todense().ravel(), 2) < TOL)
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ def kron3(A, B, C):
|
||||
|
||||
def spzeros(n1, n2):
|
||||
"""spzeros"""
|
||||
return sp.coo_matrix((n1, n2)).tocsr()
|
||||
return sp.csr_matrix((n1, n2))
|
||||
|
||||
|
||||
def ddx(n):
|
||||
|
||||
Reference in New Issue
Block a user