class SimPEG.maps.SurjectUnits(indices, **kwargs)[source]#

Bases: IdentityMap

Surjective mapping to all mesh cells.

Let \(\mathbf{m}\) be a model that contains a physical property value for nP geological units. SurjectUnits is used to construct a surjective mapping that projects \(\mathbf{m}\) to the set of voxel cells defining a mesh. As a result, the mapping \(\mathbf{u(\mathbf{m})}\) is defined as a projection matrix \(\mathbf{P}\) acting on the model. Thus:

\[\mathbf{u}(\mathbf{m}) = \mathbf{Pm}\]

The mapping therefore has dimensions (mesh.nC, nP).

indices(nP) list of (mesh.nC) numpy.ndarray

Each entry in the list is a boolean numpy.ndarray of length mesh.nC that assigns the corresponding physical property value to the appropriate mesh cells.


For this example, we have a model that defines the property values for two units. Using SurjectUnit, we construct the mapping from the model to a 1D mesh where the 1st unit’s value is assigned to all cells whose centers are located at x < 0 and the 2nd unit’s value is assigned to all cells whose centers are located at x > 0.

>>> from SimPEG.maps import SurjectUnits
>>> from discretize import TensorMesh
>>> import numpy as np
>>> nP = 8
>>> mesh = TensorMesh([np.ones(nP)], 'C')
>>> unit_1_ind = mesh.cell_centers < 0
>>> indices_list = [unit_1_ind, ~unit_1_ind]
>>> mapping = SurjectUnits(indices_list, nP=nP)
>>> m = np.r_[0.01, 0.05]
>>> mapping * m
array([0.01, 0.01, 0.01, 0.01, 0.05, 0.05, 0.05, 0.05])



Projection matrix from model parameters to mesh cells.


List assigning a given physical property to specific model cells.


Determine whether or not this mapping is a linear operation.


The mesh used for the mapping


Number of parameters the mapping acts on.


Dimensions of the mapping


deriv(m[, v])

Derivative of the mapping with respect to the input parameters.


Multiply two mappings to create a SimPEG.maps.ComboMap.


The transform inverse is not implemented.

test([m, num])

Derivative test for the mapping.

Galleries and Tutorials using SimPEG.maps.SurjectUnits#

Maps: ComboMaps

Maps: ComboMaps