Beispiel #1
0
def compute_model_at(new_grid: Union[ndarray], model: Model, **kwargs):
    """
    This function creates a new custom grid and deactivate all the other grids and compute the model there:

    This function does the same as :func:`compute_model` plus the addition functionallity of
     passing a given array of points where evaluate the model instead of using the :class:`gempy.core.data.GridClass`.

    Args:
        kwargs: :func:`compute_model` arguments

    Returns:
        :class:`Solution`
    """
    # #TODO create backup of the mesh and a method to go back to it
    #     set_grid(model, Grid('custom_grid', custom_grid=new_grid))

    model.grid.deactivate_all_grids()
    model.set_custom_grid(new_grid)

    # Now we are good to compute the model again only in the new point
    sol = compute_model(model, set_solutions=False, **kwargs)
    return sol
Beispiel #2
0
def compute_model_at(new_grid: Union[ndarray], model: Model, **kwargs):
    """
    This function does the same as :func:`gempy.core.gempy_front.compute_model` plus the addion functionallity of
     passing a given array of points where evaluate the model instead of using the :class:`gempy.core.data.GridClass`.

    Args:
        model:
        new_grid (:class:`_np.array`): 2D array with XYZ (columns) coorinates
        kwargs: `compute_model` arguments

    Returns:
        gempy.core.data.Solution
    """
    # #TODO create backup of the mesh and a method to go back to it
    #     set_grid(model, Grid('custom_grid', custom_grid=new_grid))

    model.grid.deactivate_all_grids()
    model.set_custom_grid(new_grid)

    # Now we are good to compute the model again only in the new point
    sol = compute_model(model, set_solutions=False, **kwargs)
    return sol