Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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