inversion_ideas.WrappedSimulation#
- class inversion_ideas.WrappedSimulation(simulation, *, store_jacobian=False, cache_fields=True, cache=True)#
Wrapper of SimPEG’s simulations.
Allows to use SimPEG simulations in the new framework, extending them to be compatible with the
inversion_ideas.base.Simulationinterface.Important
This class is meant to be a glue between current SimPEG simulations and the new framework. The ultimate goal is to make SimPEG simulations compatible with this framework. After that, this class will become obsolete and we’ll be able to remove it.
- Parameters:
- simulation
object Instance of a SimPEG simulation.
- store_jacobianbool, optional
Whether to store the jacobian matrix as a dense or sparse matrix. If False, the
jacobian()method will return aLinearOperatorthat calls theJvecandJtvecmethods of the SimPEG simulation. Default to False.- cache_fieldsbool, optional
Whether to cache fields within the simulation or not. If True, the fields in PDE-based SimPEG simualtions will be cached within the
WrappedSimulationobject to avoid recomputing them when the object gets called, or an operation with the Jacobian matrix is performed. Default to True.- cachebool, optional
Whether to cache the last result of the
__call__()andjacobian()methods. Default to True.
- simulation
Attributes
Methods
Attributes#
- WrappedSimulation.n_data#
Number of data values.
- WrappedSimulation.n_params#
Number of model parameters.
Methods#
Methods documentation
- WrappedSimulation.__call__(model)#
Evaluate simulation for a given model.
- WrappedSimulation.jacobian(model)#
Jacobian matrix for a given model.
- Parameters:
- Returns:
- (
n_data,n_params)arrayorLinearOperator 2D dense or sparse array or a
LinearOperatorthat represents the Jacobian matrix: the matrix of first derivatives of the forward model with respect to each model parameter. Ifstore_jacobianis True, a dense or sparse array will be returned. Otherwise, aLinearOperatorwill be returned.
- (