SimPEG.utils.model_builder.create_from_function#

SimPEG.utils.model_builder.create_from_function(cell_centers, fun_handle)[source]#

Define physical property model from scalar analytic function.

For a function handle that defines a scalar physical property as function of location, create_from_function outputs the discrete representation of the physical property distribution on the mesh provided.

Parameters:
cell_centers(n_cells, dim) numpy.ndarray or discretize.base.BaseMesh

A mesh or its gridded cell center locations.

fun_handlefunction

A function which defines a scalar physical property value as a function of location. The input argument for the location must be an (n, dim) numpy.ndarray.

Returns:
(n_cells) numpy.ndarray

Cell-centered physical property model for the mesh.