import numpy as np
import os
import salvus.namespace as sn
# Run simulations on this site.
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
# Either load an existing project or create a new one.
p = sn.Project.from_domain(
path="project",
# Should match the volume model.
domain=sn.domain.dim2.BoxDomain(x0=0, x1=3000, y0=-1000, y1=0),
load_if_exists=True,
)
bm
model file.%%writefile layered_model.bm
NAME radial_model
ACOUSTIC true
UNITS m
COLUMNS depth rho vp
0.0 1000.0 1500.0
200.0 1000.0 1500.0
200.0 1300.0 1900.0
500.0 1300.0 1900.0
500.0 2200.0 3200.0
4000.0 2200.0 3200.0
Writing layered_model.bm
%%writefile layered_model_ani.bm
NAME radial_model
ACOUSTIC true
ANISOTROPIC true
UNITS m
COLUMNS depth rho vpv vph
0.0 1000.0 1500.0 1500.0
200.0 1000.0 1500.0 1500.0
200.0 1300.0 1900.0 2100.0
500.0 1300.0 1900.0 2100.0
500.0 2200.0 3200.0 3500.0
4000.0 2200.0 3200.0 3500.0
Writing layered_model_ani.bm
VPV
and VPH
.%%writefile layered_model_fake_ani.bm
NAME radial_model
ACOUSTIC true
ANISOTROPIC true
UNITS m
COLUMNS depth rho vpv vph
0.0 1000.0 1500.0 1500.0
200.0 1000.0 1500.0 1500.0
200.0 1300.0 1900.0 1900.0
500.0 1300.0 1900.0 1900.0
500.0 2200.0 3200.0 3200.0
4000.0 2200.0 3200.0 3200.0
Writing layered_model_fake_ani.bm
for name, bm in zip(
["isotropic", "anisotropic", "fake-anisotropic"],
["layered_model.bm", "layered_model_ani.bm", "layered_model_fake_ani.bm"],
):
p.add_to_project(
sn.SimulationConfiguration(
name=name,
max_frequency_in_hertz=20.0,
elements_per_wavelength=1.5,
model_configuration=sn.ModelConfiguration(
background_model=sn.model.background.one_dimensional.FromBm(
filename=bm, reference_datum=0.0
),
),
event_configuration=sn.EventConfiguration(
wavelet=sn.simple_config.stf.Ricker(center_frequency=10.0),
waveform_simulation_configuration=sn.WaveformSimulationConfiguration(
end_time_in_seconds=1.5,
),
),
absorbing_boundaries=sn.AbsorbingBoundaryParameters(
reference_velocity=2200.0,
reference_frequency=10.0,
number_of_wavelengths=7,
),
),
)
p.viz.nb.simulation_setup("anisotropic")
[2025-02-07 20:21:13,259] INFO: Creating mesh. Hang on.
<salvus.mesh.data_structures.unstructured_mesh.unstructured_mesh.UnstructuredMesh object at 0x7d6630362890>
UnstructuredMeshSimulationConfiguration
.