simpeg.maps.Surject2Dto3D#
- class simpeg.maps.Surject2Dto3D(mesh, normal='y', **kwargs)[source]#
Bases:
IdentityMap
Map 2D tensor model to 3D tensor mesh.
Let \(m\) define the parameters for a 2D tensor model.
Surject2Dto3D
constructs a surjective mapping that projects the 2D tensor model to a 3D tensor mesh.Mathematically, the mapping \(\mathbf{u}(\mathbf{m})\) can be represented by a projection matrix:
\[\mathbf{u}(\mathbf{m}) = \mathbf{Pm}\]- Parameters:
- mesh
discretize.TensorMesh
A 3D tensor mesh
- normal{‘y’, ‘x’, ‘z’}
Define the projection axis.
- mesh
Attributes
Determine whether or not this mapping is a linear operation.
The mesh used for the mapping
Number of model properties.
The projection axis.
Dimensions of the mapping operator
Methods
deriv
(m[, v])Derivative of the mapping with respect to the model paramters.
dot
(map1)Multiply two mappings to create a
simpeg.maps.ComboMap
.inverse
(D)The transform inverse is not implemented.
test
([m, num, random_seed])Derivative test for the mapping.
Examples
Here we project a 3 layered Earth model defined on a 2D tensor mesh to a 3D tensor mesh. We assume that at for some y-location, we have a 2D tensor model which defines the physical property distribution as a function of the x and z location. Using
Surject2Dto3D
, we project the model along the y-axis to obtain a 3D distribution for the physical property (i.e. a 3D tensor model).>>> from simpeg.maps import Surject2Dto3D >>> from discretize import TensorMesh >>> import numpy as np >>> import matplotlib as mpl >>> import matplotlib.pyplot as plt
>>> dh = np.ones(20) >>> mesh2D = TensorMesh([dh, dh], 'CC') >>> mesh3D = TensorMesh([dh, dh, dh], 'CCC')
Here, we define the 2D tensor model.
>>> m = np.zeros(mesh2D.nC) >>> m[mesh2D.cell_centers[:, 1] < 0] = 10. >>> m[mesh2D.cell_centers[:, 1] < -5] = 5.
We then plot the 2D tensor model; which is defined along the x and z axes.
>>> fig1 = plt.figure(figsize=(6, 5)) >>> ax11 = fig1.add_axes([0.1, 0.15, 0.7, 0.8]) >>> mesh2D.plot_image(m, ax=ax11, grid=True) >>> ax11.set_ylabel('z') >>> ax11.set_title('2D Tensor Model') >>> ax12 = fig1.add_axes([0.83, 0.15, 0.05, 0.8]) >>> norm1 = mpl.colors.Normalize(vmin=np.min(m), vmax=np.max(m)) >>> cbar1 = mpl.colorbar.ColorbarBase(ax12, norm=norm1, orientation="vertical")
By setting normal = ‘Y’ we are projecting along the y-axis.
>>> mapping = Surject2Dto3D(mesh3D, normal='Y') >>> u = mapping * m
Finally we plot a slice of the resulting 3D tensor model.
>>> fig2 = plt.figure(figsize=(6, 5)) >>> ax21 = fig2.add_axes([0.1, 0.15, 0.7, 0.8]) >>> mesh3D.plot_slice(u, ax=ax21, ind=10, normal='Y', grid=True) >>> ax21.set_ylabel('z') >>> ax21.set_title('Projected to 3D Mesh (y=0)') >>> ax22 = fig2.add_axes([0.83, 0.15, 0.05, 0.8]) >>> norm2 = mpl.colors.Normalize(vmin=np.min(m), vmax=np.max(m)) >>> cbar2 = mpl.colorbar.ColorbarBase(ax22, norm=norm2, orientation="vertical")
Galleries and Tutorials using simpeg.maps.Surject2Dto3D
#
2D inversion of Loop-Loop EM Data