From f439a6d017a26dc6681889fd59136400cbf66b9d Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Mon, 22 Jul 2013 16:25:34 -0700 Subject: [PATCH] Updated TensorMesh __main__ so that it works with new standards. --- SimPEG/TensorMesh.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/SimPEG/TensorMesh.py b/SimPEG/TensorMesh.py index 8395c54d..b247138b 100644 --- a/SimPEG/TensorMesh.py +++ b/SimPEG/TensorMesh.py @@ -266,23 +266,15 @@ if __name__ == '__main__': print('Welcome to tensor mesh!') testDim = 1 - h1 = 0.3*np.ones((1, 7)) - h1[:, 0] = 0.5 - h1[:, -1] = 0.6 - h2 = .5 * np.ones((1, 4)) - h3 = .4 * np.ones((1, 6)) - x0 = np.zeros((3, 1)) + h1 = 0.3*np.ones(7) + h1[0] = 0.5 + h1[-1] = 0.6 + h2 = .5 * np.ones(4) + h3 = .4 * np.ones(6) - if testDim == 1: - h = [h1] - x0 = x0[0] - elif testDim == 2: - h = [h1, h2] - x0 = x0[0:2] - else: - h = [h1, h2, h3] + h = [h1, h2, h3] + h = h[:testDim] - I = np.linspace(0, 1, 8) - M = TensorMesh(h, x0) + M = TensorMesh(h) xn = M.plotGrid()