This documentation is not for the latest stable Salvus version.
SalvusComputewhere the coordinates are already known exactly. In many scenarios this is not necessarily the case. Imaging a mesh with potentially arbitrarily shaped and curved elements and you want to exactly locate a source or receiver relative to the local surface or for example at the ocean bottom. This problem is dependent on the exact mesh used for the simulation.
# This line helps with tab-completion of the simple_config objects. # The IPython/Jupyter project default to a differnet inference based # tab completion engine which unfortunately does not yet fully work # with SalvusFlow. This is completely optional and a convenience # option. %config Completer.use_jedi = False
# SalvusFlow and SalvusMesh convenience interfaces. from salvus.flow import simple_config from salvus.mesh import simple_mesh # We'll also use numpy. import numpy as np
SalvusComputethese are used to specify boundary conditions, here we will use them to locate source and receiver relative to them. The following example mesh has 4 side-sets, each denoting one side of the mesh. Please note, that the names are arbitrary and mesh dependent.
SideSetand all the coordinates are replaced with a
m = simple_mesh.Cartesian2D() m.basic.min_period_in_seconds = 1500.0 m.basic.model = "prem_iso_no_crust" m.basic.elements_per_wavelength = 2.0 m.advanced.tensor_order = 4 mesh = m.create_mesh() # Add a nice curve to the mesh surface. # Note how it would not longer be trivial to add sources # or receivers exactly at the surface of the mesh! x_range = mesh.points[:, 0].ptp() mesh.points[:, 1] += np.sin(mesh.points[:, 0] / x_range * 2 * np.pi) * 3e5 mesh