def run(plotIt=True): mesh = Mesh.TensorMesh([50, 50], x0='CC') # 2D tensor mesh mapping = Maps.ParametricLayer(mesh) # parametric layer in wholespace # model m = np.hstack(np.r_[1., # background value 2., # layer value -0.1, # layer center 0.2 # layer thickness ]) rho = mapping * m # apply the mapping if plotIt is True: fig, ax = plt.subplots(1, 1, figsize=(4, 6)) mesh.plotImage(rho, ax=ax)
def primaryMap2meshs(self): if getattr(self, '_primaryMap2mesh', None) is None: # map the primary model to the secondary mesh (layer without the # block) print('Building primaryMap2meshs') paramMapPrimaryMeshs = Maps.ParametricLayer( self.meshs, indActive=self.indActive ) self._primaryMap2mesh = ( self.expMap * # log sigma --> sigma self.injActMap * # include air cells paramMapPrimaryMeshs * # parametrized layer self.projectionMapPrimary # grab correct indices ) print('... done building primaryMap2meshs') return self._primaryMap2mesh