mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-04 18:49:36 +08:00
- better model for testing Parametric casing map
- allow vector containing values in the inactive set to be passed (not just nC in length)
This commit is contained in:
+10
-2
@@ -543,11 +543,19 @@ class InjectActiveCells(IdentityMap):
|
||||
self.indInactive = np.logical_not(indActive)
|
||||
if Utils.isScalar(valInactive):
|
||||
self.valInactive = np.ones(self.nC)*float(valInactive)
|
||||
self.valInactive[self.indActive] = 0.
|
||||
else:
|
||||
self.valInactive = valInactive.copy()
|
||||
self.valInactive[self.indActive] = 0
|
||||
if len(valInactive) == sum(self.indInactive):
|
||||
self.valInactive = np.zeros(nC)
|
||||
self.valInactive[self.indInactive] = valInactive.copy()
|
||||
else:
|
||||
assert len(self.valInactive) == self.nC, 'valInactive must be the size of nC or nInactive'
|
||||
self.valInactive = valInactive.copy()
|
||||
if any(self.valInactive[self.indActive] != 0.):
|
||||
warnings.warn('the inactive has non-zero values in the active set.')
|
||||
|
||||
inds = np.nonzero(self.indActive)[0]
|
||||
# inds[self.indActive]
|
||||
self.P = sp.csr_matrix((np.ones(inds.size),(inds, range(inds.size))), shape=(self.nC, self.nP))
|
||||
|
||||
@property
|
||||
|
||||
@@ -39,7 +39,7 @@ class MapTests(unittest.TestCase):
|
||||
|
||||
def test_ParametricCasingAndLayer(self):
|
||||
mapping = Maps.ParametrizedCasingAndLayer(self.meshCyl)
|
||||
m = np.r_[-2., 1., 6., 2., -0.1, 0.2, 0.5, 0.2, -0.3, 0.1]
|
||||
m = np.r_[-2., 1., 6., 2., -0.1, 0.2, 0.5, 0.2, -0.2, 0.2]
|
||||
self.assertTrue(mapping.test(m))
|
||||
|
||||
def test_transforms_logMap_reciprocalMap(self):
|
||||
|
||||
Reference in New Issue
Block a user