def run(plotIt=True): M = discretize.TensorMesh([100, 100]) h1 = utils.meshTensor([(6, 7, -1.5), (6, 10), (6, 7, 1.5)]) h1 = h1 / h1.sum() M2 = discretize.TensorMesh([h1, h1]) V = utils.model_builder.randomModel(M.vnC, seed=79, its=50) v = utils.mkvc(V) modh = maps.Mesh2Mesh([M, M2]) modH = maps.Mesh2Mesh([M2, M]) H = modH * v h = modh * H if not plotIt: return ax = plt.subplot(131) M.plotImage(v, ax=ax) ax.set_title("Fine Mesh (Original)") ax = plt.subplot(132) M2.plotImage(H, clim=[0, 1], ax=ax) ax.set_title("Course Mesh") ax = plt.subplot(133) M.plotImage(h, clim=[0, 1], ax=ax) ax.set_title("Fine Mesh (Interpolated)")
def test_Mesh2MeshMapVec(self): mapping = maps.Mesh2Mesh([self.mesh22, self.mesh2]) self.assertTrue(mapping.testVec())