How to use the discretize.utils.meshutils.refine_tree_xyz function in discretize

To help you get started, we’ve selected a few discretize examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github simpeg / simpeg / tutorials / models_mapping / plot_3_tree_models.py View on Github external
def refine_topography(mesh):

    # Define topography and refine
    [xx, yy] = np.meshgrid(mesh.vectorNx, mesh.vectorNy)
    zz = -3*np.exp((xx**2 + yy**2) / 60**2) + 45.
    topo = np.c_[mkvc(xx), mkvc(yy), mkvc(zz)]

    mesh = refine_tree_xyz(
        mesh, topo,
        octree_levels=[3, 2],
        method='surface',
        finalize=False
    )

    return mesh
github simpeg / simpeg / tutorials / models_mapping / plot_3_tree_models.py View on Github external
def refine_box(mesh):

    # Refine for sphere
    xp, yp, zp = np.meshgrid([-55., 50.], [-50., 50.], [-40., 20.])
    xyz = np.c_[mkvc(xp), mkvc(yp), mkvc(zp)]

    mesh = refine_tree_xyz(
        mesh, xyz,
        octree_levels=[2],
        method='box',
        finalize=False
    )

    return mesh