simpeg.potential_fields.base.BasePFSimulation#

class simpeg.potential_fields.base.BasePFSimulation(mesh, active_cells=None, store_sensitivities='ram', n_processes=1, sensitivity_dtype=<class 'numpy.float32'>, engine='geoana', numba_parallel=True, ind_active=None, **kwargs)[source]#

Bases: LinearSimulation

Base class for potential field simulations that use integral formulations.

For integral formulations, the forward simulation for a set of voxel cells can be defined as a linear operation of the form:

\[\mathbf{d} = \mathbf{Am}\]

where \(\mathbf{d}\) are the data, \(\mathbf{m}\) are the model paramters and \(\mathbf{A}\) is a linear operator defining the sensitivities. The primary difference between child simulation classes is the kernel function used to create the rows of \(\mathbf{A}\).

Parameters:
meshdiscretize.TensorMesh or discretize.TreeMesh

A 3D tensor or tree mesh.

active_cellsnp.ndarray of int or bool

Indices array denoting the active topography cells.

store_sensitivities{‘ram’, ‘disk’, ‘forward_only’}

Options for storing sensitivities. There are 3 options

  • ‘ram’: sensitivities are stored in the computer’s RAM

  • ‘disk’: sensitivities are written to a directory

  • ‘forward_only’: you intend only do perform a forward simulation and sensitivities do not need to be stored

n_processesNone or int, optional

The number of processes to use in the internal multiprocessing pool for forward modeling. The default value of 1 will not use multiprocessing. Any other setting will. None implies setting by the number of cpus. If engine is "choclo", then this argument will be ignored.

engine{“geoana”, “choclo”}, optional

Choose which engine should be used to run the forward model.

numba_parallelbool, optional

If True, the simulation will run in parallel. If False, it will run in serial. If engine is not "choclo" this argument will be ignored.

ind_activenp.ndarray of int or bool

Deprecated since version 0.23.0: Argument ind_active is deprecated in favor of active_cells and will be removed in SimPEG v0.24.0.

Attributes

G

The linear operator.

active_cells

Active cells in the mesh.

clean_on_model_update

A list of solver objects to clean when the model is updated

counter

SimPEG Counter object to store iterations and run-times.

deleteTheseOnModelUpdate

A list of properties stored on this object to delete when the model is updated

engine

Engine that will be used to run the simulation.

ind_active

active_cells.ind_active has been deprecated.

linear_model

The model for a linear problem physical property model.

mesh

Mesh for the simulation.

model

The inversion model.

model_deriv

Derivative of The model for a linear problem wrt the model.

model_map

Mapping of the inversion model to The model for a linear problem.

needs_model

True if a model is necessary

numba_parallel

Run simulation in parallel or single-threaded when using Numba.

sensitivity_dtype

dtype of the sensitivity matrix.

sensitivity_path

Path to directory where sensitivity file is stored.

solver_opts

Solver-specific parameters.

store_sensitivities

Options for storing sensitivities.

survey

The survey for the simulation.

verbose

Verbose progress printout.

n_processes

solver

Methods

Jtvec(m, v[, f])

Compute the Jacobian transpose times a vector for the model provided.

Jtvec_approx(m, v[, f])

Approximation of the Jacobian transpose times a vector for the model provided.

Jvec(m, v[, f])

Compute the Jacobian times a vector for the model provided.

Jvec_approx(m, v[, f])

Approximation of the Jacobian times a vector for the model provided.

dpred([m, f])

Predicted data for the model provided.

fields(m)

Return the computed geophysical fields for the model provided.

getJ(m[, f])

Returns the full Jacobian.

linear_operator()

Return linear operator.

make_synthetic_data(m[, relative_error, ...])

Make synthetic data for the model and Gaussian noise provided.

residual(m, dobs[, f])

The data residual.

Notes

If using multiprocessing by setting n_processes to a value other than 1, you must be aware of the method your operating system uses to spawn the subprocesses. On Windows the default method starts new processes that all import the main script. Therefor you must protect the calls to this class by testing if you are in the main process with:

>>> from simpeg.potential_fields import gravity
>>> if __name__ == '__main__':
...     # Do your processing here
...     sim = gravity.Simulation3DIntegral(n_processes=4, ...)
...     sim.dpred(m)

This usually does not affect jupyter notebook environments.

Galleries and Tutorials using simpeg.potential_fields.base.BasePFSimulation#

Maps: ComboMaps

Maps: ComboMaps

PF: Gravity: Tiled Inversion Linear

PF: Gravity: Tiled Inversion Linear

Magnetic inversion on a TreeMesh with remanence

Magnetic inversion on a TreeMesh with remanence

Magnetic inversion on a TreeMesh

Magnetic inversion on a TreeMesh

Magnetic Amplitude inversion on a TreeMesh

Magnetic Amplitude inversion on a TreeMesh

PF: Gravity: Laguna del Maule Bouguer Gravity

PF: Gravity: Laguna del Maule Bouguer Gravity

Forward Simulation of Gravity Anomaly Data on a Tensor Mesh

Forward Simulation of Gravity Anomaly Data on a Tensor Mesh

Forward Simulation of Gradiometry Data on a Tree Mesh

Forward Simulation of Gradiometry Data on a Tree Mesh

Least-Squares Inversion of Gravity Anomaly Data

Least-Squares Inversion of Gravity Anomaly Data

Sparse Norm Inversion of Gravity Anomaly Data

Sparse Norm Inversion of Gravity Anomaly Data

Compare weighting strategy with Inversion of surface Gravity Anomaly Data

Compare weighting strategy with Inversion of surface Gravity Anomaly Data

Forward Simulation of Total Magnetic Intensity Data

Forward Simulation of Total Magnetic Intensity Data

Forward Simulation of Gradiometry Data for Magnetic Vector Models

Forward Simulation of Gradiometry Data for Magnetic Vector Models

Sparse Norm Inversion for Total Magnetic Intensity Data on a Tensor Mesh

Sparse Norm Inversion for Total Magnetic Intensity Data on a Tensor Mesh

Joint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh using full petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information

Joint PGI of Gravity + Magnetic on an Octree mesh without petrophysical information

Cross-gradient Joint Inversion of Gravity and Magnetic Anomaly Data

Cross-gradient Joint Inversion of Gravity and Magnetic Anomaly Data