From 168ad8b0ff34c2462d01bd38b658c59c3e21efce Mon Sep 17 00:00:00 2001 From: seogi_macbook Date: Thu, 17 Sep 2015 21:16:29 -0700 Subject: [PATCH] fix bug for active cell --- SimPEG/Maps.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SimPEG/Maps.py b/SimPEG/Maps.py index df110180..634c4b9f 100644 --- a/SimPEG/Maps.py +++ b/SimPEG/Maps.py @@ -470,11 +470,11 @@ class ActiveCells(IdentityMap): self.indActive = indActive self.indInactive = np.logical_not(indActive) if Utils.isScalar(valInactive): - valInactive = np.ones(self.nC)*float(valInactive) - - valInactive[self.indActive] = 0 - self.valInactive = valInactive - + self.valInactive = np.ones(self.nC)*float(valInactive) + + self.valInactive = valInactive.copy() + self.valInactive[self.indActive] = 0 + inds = np.nonzero(self.indActive)[0] self.P = sp.csr_matrix((np.ones(inds.size),(inds, range(inds.size))), shape=(self.nC, self.nP))