示例#1
0
def make_example_mesh():

    # Base mesh parameters
    dh = 5.0  # base cell size
    nbc = 32  # total width of mesh in terms of number of base mesh cells
    h = dh * np.ones(nbc)

    mesh = TreeMesh([h, h, h], x0="CCC")

    # Refine to largest possible cell size
    mesh.refine(3, finalize=False)

    return mesh
示例#2
0
def baseline_octree_mesh(N, delta):
    """
    Set up a basic regular Cartesian octree mesh as a default; this can then
    be refined once we specify model features or voxelizations, so it is NOT
    currently finalized
    :param N: length of one edge of a cubical volume in cells
    :param delta: length of one edge of a mesh cube
    :return: TreeMesh instance
    """
    h = delta * np.ones(N)
    mesh = TreeMesh([h, h, h], x0="CCC")
    mesh.refine(3, finalize=False)
    return mesh
示例#3
0
## Refine surface no alvo
#xp, yp, zp = np.meshgrid([-5000., 5000.], [-5000., 5000.], [-1000., -2000.])
#xyz = np.c_[mkvc(xp), mkvc(yp), mkvc(zp)]
#
#M = refine_tree_xyz(
#    M, xyz, octree_levels=[1,0], method='surface', finalize=False)


#Refine rest of the grid
def refine(cell):
    if np.sqrt(((np.r_[cell.center] - 0.5)**2).sum()) < 0.4:
        return 1
    return 1


M.refine(refine)
M.finalize()

conds = [0.01, 1]  # [heterogeneidade,background]
sig = simpeg.Utils.ModelBuilder.defineBlock(M.gridCC, [-500, -500, -200],
                                            [500, 500, -100], conds)

#sig[M.gridCC[:,2] > -1000] = 3.3    # água
sig[M.gridCC[:, 2] > 0] = 1e-12  # ar

sigBG = np.zeros(M.nC) + conds[1]
#sigBG[M.gridCC[:, 2] > -1000] = 3.3
sigBG[M.gridCC[:, 2] > 0] = 1e-12

# MESH 1D (para modelo de background)
mesh1d = simpeg.Mesh.TensorMesh([M.hz], np.array([M.x0[2]]))