def mapping(self): # secondary mapping # here, we construct the parametric mapping to take the parameters # describing the block in a layered space and map it to a conductivity # model on our mesh if getattr(self, '_mapping', None) is None: print('building secondary mapping') paramMap = Maps.ParametrizedBlockInLayer( self.meshs, indActive=self.indActive ) self._mapping = ( self.expMap * # log sigma --> sigma self.injActMap * # inject air cells paramMap # block in a layered space (subsurface) ) print('... done building secondary mapping') return self._mapping
def run(plotIt=True): """ Maps: Parametrized Block in a Layer =================================== Parametrized description of a block confined to a layer in a wholespace. The mapping can be applied in 2D or 3D. Here we show a 2D example. The model is given by .. code:: m = np.r_[ 'value of the background', 'value in the layer', 'value in the block', 'center of the layer (depth)', 'thickness of the layer', 'x-center of block', 'width of the block' ] """ mesh = Mesh.TensorMesh([50, 50], x0='CC') # 2D Tensor Mesh mapping = Maps.ParametrizedBlockInLayer(mesh) # mapping m = np.hstack(np.r_[1., # value of the background 2., # value in the layer 3., # value in the block -0.1, # center of the layer (depth) 0.2, # thickness of the layer 0.3, # x-center of block 0.2 # width of the block ]) # apply the mapping to define the physical property on the mesh rho = mapping * m if plotIt is True: fig, ax = plt.subplots(1, 1, figsize=(4, 6)) mesh.plotImage(rho, ax=ax)
def run(plotIt=True): mesh = Mesh.TensorMesh([50, 50], x0='CC') # 2D Tensor Mesh mapping = Maps.ParametrizedBlockInLayer(mesh) # mapping m = np.hstack(np.r_[1., # value of the background 2., # value in the layer 3., # value in the block -0.1, # center of the layer (depth) 0.2, # thickness of the layer 0.3, # x-center of block 0.2 # width of the block ]) # apply the mapping to define the physical property on the mesh rho = mapping * m if plotIt is True: fig, ax = plt.subplots(1, 1, figsize=(4, 6)) mesh.plotImage(rho, ax=ax)
# primary mesh hx = [(csx, ncx), (csx, npadx, pf)] hz = [(csz, npadz, -pf), (csz, ncz), (csz, npadz, pf)] meshp = Mesh.CylMesh([hx, 1., hz], x0='0CC') # secondary mesh h = [(csz, npadz - 4, -pf), (csz, ncz), (csz, npadz - 4, pf)] meshs = Mesh.TensorMesh(3 * [h], x0='CCC') # mappings primaryMapping = (Maps.ExpMap(meshp) * Maps.SurjectFull(meshp) * Maps.Projection(nP=8, index=[0])) mapping = ( Maps.ExpMap(meshs) * Maps.ParametrizedBlockInLayer(meshs) * Maps.Projection(nP=8, index=np.hstack([np.r_[0], np.arange(0, 8)]))) primaryMap2Meshs = (Maps.ExpMap(meshs) * Maps.SurjectFull(meshs) * Maps.Projection(nP=8, index=[0])) class PrimSecFDEMTest(object): # --------------------- Run some tests! --------------------- # def DataTest(self): print('\nTesting Data') dpred_primsec = self.secondarySurvey.dpred(model, f=self.fields_primsec) dpred_3D = self.survey3D.dpred(model, f=self.fields_3D)
meshp = Mesh.CylMesh([hx, 1., hz], x0='0CC') # secondary mesh h = [(csz, npadz-4, -pf), (csz, ncz), (csz, npadz-4, pf)] meshs = Mesh.TensorMesh(3*[h], x0 = 'CCC') # mappings primaryMapping = ( Maps.ExpMap(meshp) * Maps.SurjectFull(meshp) * Maps.Projection(nP=8, index=[0]) ) mapping = ( Maps.ExpMap(meshs) * Maps.ParametrizedBlockInLayer(meshs) * Maps.Projection( nP=8, index=np.hstack([np.r_[0], np.arange(0, 8)]) ) ) primaryMap2Meshs = ( Maps.ExpMap(meshs) * Maps.SurjectFull(meshs) * Maps.Projection(nP=8, index=[0]) ) class PrimSecFDEMTest(object): # --------------------- Run some tests! --------------------- #