Regional 3D Simulations

Download Jupyter Notebook

This page is automatically generated from a Jupyter Notebook. You can view and download it here and here.

Note that everything here is fully automatically tested against - and thus guaranteed to work - only for the latest repository versions of all the Salvus packages. So please update if anything works differently on your machine.

This tutorial is an extension of the global 3D one to show that everything works exactly the same in 3D, this time on an example that is a bit more realistic. Additionally it showcases the ObsPy integration a bit more.

We will simulate low-frequency wave originating from the March 6th Switzerland earthquake.

%matplotlib inline

import os
import warnings
warnings.simplefilter("ignore")

import salvus_seismo

# Paths are grabbed from environment variables.
PARAVIEW_BIN = os.environ["PARAVIEW_BIN"]
SALVUS_BIN = os.environ["SALVUS_BIN"]

Get event and stations

Step 1 is to get the earthquake and the stations.

# For the event we will use the Italian event web service as they do have a
# moment tensor solution of the earthquake.
from obspy.clients.fdsn import Client
import obspy

# Initialize a client for the INGV webservice.
c = Client("INGV")

cat = c.get_events(starttime=obspy.UTCDateTime(2017, 3, 6), endtime=obspy.UTCDateTime(2017, 3, 7),
                   minmagnitude=4, maxmagnitude=5, latitude=47, longitude=8, maxradius=2)

print(cat)
cat.plot(projection="local")

event = cat[0]
1 Event(s) in Catalog:
2017-03-06T20:12:06.790000Z | +46.916,   +8.931 | 4.0 Mw | manual

png

# For the stations we will use the swiss service and just get
# all stations available at the time of the event.
c = Client("ETH")
inv = c.get_stations(starttime=obspy.UTCDateTime(2017, 3, 6),
                     endtime=obspy.UTCDateTime(2017, 3, 7))
inv.plot(projection="local");

png

Create a mesh

Next step is to create a mesh.

In this tutorial we'll run a sesimic simulation on a 3D regional Earth model. We'll also use the salvus_seismo subpackage to make adding source and receiers a breeze. Let's get a suitable mesh centered around Zurich.

# This nice little tool gets you the coordinates of a place of desire.
!python -m pymesher.getcoordinates zurich
best match:  Zürich, Bezirk Zürich, Zürich, Schweiz, Suisse, Svizzera, Svizra
input for pymesher SphericalChunk3D meshes with geocentric latitude
[47.180579, 8.542322, null]
!python -m pymesher.interface SphericalChunk3D \
    --basic.period=30 \
    --basic.model prem_iso_one_crust \
    --spherical.min_radius=6200 \
    --chunk3D.max_colatitude1=2.0 \
    --chunk3D.max_colatitude2=2.0 \
    --chunk3D.euler_angles 47.176739 8.540443 0 \
    --overwrite
Setting up background model and element sizes...
Creating the skeleton...
Creating the unstructured mesh...
attaching elastic parameters
attaching attenuation parameters
Computing mesh quality...
Computing resolved period...
Writing mesh to file...
==============================================================================
SUMMARY OF MESH PROPERTIES:

  model name                       | prem_iso_one_crust
  dominant period input            |     30.00 s
  elements per wavelength          |      2.00
  Courant Number                   |      0.60

  resolved period (global max)     |     27.80 s
    location (z coordinate)        |   6358.72 km
  resolved period (percentile 95)  |     27.80 s
  time step dt                     |    2.5241 s
    location (z coordinate)        |   6358.72 km
  number of elements               |       400
  number of points                 |       605
  cost factor (nelem / dt)         |  1.58e+02

  max edge aspect ratio            |      1.82
  max equiangular skewness         |      0.00
==============================================================================
GLOBAL VARIABLES:
  dt                         |   2.52414
  ellipticity                |   0.00000
  f_max                      |   1.00000
  f_min                      |   0.00100
  f_ref                      |   1.00000
  minimum_period             |  27.79868
  nr_lin_solids              |   5.00000
  radius                     | 6371000.00000
  w_0                        |   0.00917
  w_1                        |   0.07173
  w_2                        |   0.37598
  w_3                        |   1.66061
  w_4                        |   8.66407
  y_0                        |   1.69035
  y_1                        |   1.13577
  y_2                        |   0.98728
  y_3                        |   0.92424
  y_4                        |   1.46135
==============================================================================
ELEMENTAL FIELDS:
  QKAPPA_0
  QKAPPA_1
  QKAPPA_2
  QKAPPA_3
  QKAPPA_4
  QKAPPA_5
  QKAPPA_6
  QKAPPA_7
  QMU_0
  QMU_1
  QMU_2
  QMU_3
  QMU_4
  QMU_5
  QMU_6
  QMU_7
  RHO_0
  RHO_1
  RHO_2
  RHO_3
  RHO_4
  RHO_5
  RHO_6
  RHO_7
  VP_0
  VP_1
  VP_2
  VP_3
  VP_4
  VP_5
  VP_6
  VP_7
  VS_0
  VS_1
  VS_2
  VS_3
  VS_4
  VS_5
  VS_6
  VS_7
  dt
  edge_aspect_ratio
  element_type
  equiangular_skewness
  fluid
  minimum_period
==============================================================================
NODAL FIELDS:
==============================================================================
SIDE SETS:
  p0
  p1
  r0
  r1
  t0
  t1
==============================================================================

SUCCESSFULLY GENERATED MESH IN 0.344692 SECONDS.
SAVED TO 'SphericalChunk3D_prem_iso_one_crust_30.e' (261.0 KB).

Now, let's visualize the mesh in Paraview and inspect it.

!$PARAVIEW_BIN ./SphericalChunk3D_prem_iso_one_crust_30.e

Below, we'll rely on salvus_seismo to generate a call to Salvus for us. This is a python package which makes it simple to generate sources and receivers for use in global 2D/3D Earth models. No more messing around on the command line line as before! Check out the comments below for an explanation of the individual parameters.

import salvus_seismo

src = salvus_seismo.Source.parse(event)
recs = salvus_seismo.Receiver.parse(inv)

# Choose a center frequency suitable for our mesh.
src.center_frequency = 1.0 / 33.0

# Generate the configuration object for salvus_seismo. Note the presence of "salvus_call"
# here. This can be use to pass any special commands, such as mpirun.
#
# This is a short simulation for speed reasons. Set the endtime to maybe 120 seconds
# if you have some time.
config = salvus_seismo.Config(
    mesh_file="./SphericalChunk3D_prem_iso_one_crust_30.e",
    end_time=30,
    salvus_call=SALVUS_BIN,
    movie_file_name="test_movie.h5",
    movie_fields=["u_ELASTIC"],
    polynomial_order=4,
    verbose=False,
    dimensions=3)

# Ensure a clean directory. Salvus_seismo will fail to produce the configuration files if
# the directory already exists.
!rm -rf 3d_example/

# Automatically generate the command line call for salvus. This takes the mesh file as an
# argument, as salvus_seismo will ensure that the source / receiver positions are adjusted
# to respect the mesh topology.
salvus_seismo.generate_cli_call(
    source=src, receivers=recs, config=config,
    output_folder="3d_example",
    exodus_file="./SphericalChunk3D_prem_iso_one_crust_30.e")
Retrieving surface information from exodus file ... [DONE in 0.03 seconds]
Automatically determined the following absorbing boundary side sets: p0, p1, r0, t0, t1
Could not locate station Z3.A024B on mesh. Outside of mesh? latitude =  14.14, longitude =  47.91
Could not locate station Z3.A186A on mesh. Outside of mesh? latitude =   5.59, longitude =  44.60
Could not locate station Z3.A307A on mesh. Outside of mesh? latitude =  11.44, longitude =  44.47
Could not locate station Z3.A185A on mesh. Outside of mesh? latitude =   5.07, longitude =  44.93
Could not locate station Z3.A192A on mesh. Outside of mesh? latitude =   4.59, longitude =  44.31
Could not locate station Z3.A213A on mesh. Outside of mesh? latitude =   5.48, longitude =  47.30
Could not locate station Z3.A291A on mesh. Outside of mesh? latitude =  11.88, longitude =  46.43
Could not locate station Z3.A250A on mesh. Outside of mesh? latitude =  14.91, longitude =  44.89
Could not locate station Z3.A050A on mesh. Outside of mesh? latitude =  16.53, longitude =  44.29
Could not locate station Z3.A052A on mesh. Outside of mesh? latitude =  17.51, longitude =  44.91
Could not locate station Z3.A036A on mesh. Outside of mesh? latitude =  12.31, longitude =  47.19
Could not locate station Z3.A051A on mesh. Outside of mesh? latitude =  16.91, longitude =  44.82
Could not locate station Z3.A280A on mesh. Outside of mesh? latitude =   7.91, longitude =  44.35
Could not locate station Z3.A282A on mesh. Outside of mesh? latitude =   7.61, longitude =  45.06
Could not locate station Z3.A251A on mesh. Outside of mesh? latitude =  16.27, longitude =  44.94
Could not locate station Z3.A252A on mesh. Outside of mesh? latitude =  17.85, longitude =  45.24
Could not locate station Z3.A273A on mesh. Outside of mesh? latitude =  17.82, longitude =  45.72
Could not locate station Z3.A331A on mesh. Outside of mesh? latitude =  18.22, longitude =  48.96
Could not locate station Z3.A284A on mesh. Outside of mesh? latitude =   9.38, longitude =  44.94
Could not locate station Z3.A030A on mesh. Outside of mesh? latitude =  13.56, longitude =  47.64
Could not locate station Z3.A286A on mesh. Outside of mesh? latitude =   8.83, longitude =  45.17
Could not locate station Z3.A032A on mesh. Outside of mesh? latitude =  13.31, longitude =  47.93
Could not locate station Z3.A283B on mesh. Outside of mesh? latitude =   8.29, longitude =  45.05
Could not locate station Z3.A285A on mesh. Outside of mesh? latitude =   9.91, longitude =  44.70
Could not locate station Z3.A260A on mesh. Outside of mesh? latitude =  16.71, longitude =  47.09
Could not locate station Z3.A271A on mesh. Outside of mesh? latitude =  18.83, longitude =  46.96
Could not locate station Z3.A281A on mesh. Outside of mesh? latitude =   7.71, longitude =  44.66
Could not locate station Z3.A035A on mesh. Outside of mesh? latitude =  12.72, longitude =  47.00
Could not locate station Z3.A272A on mesh. Outside of mesh? latitude =  18.97, longitude =  46.55
Could not locate station Z3.A033A on mesh. Outside of mesh? latitude =  13.13, longitude =  47.29
Could not locate station Z3.A031A on mesh. Outside of mesh? latitude =  13.50, longitude =  48.24
Could not locate station Z3.A303A on mesh. Outside of mesh? latitude =  12.32, longitude =  45.15
Could not locate station Z3.A023A on mesh. Outside of mesh? latitude =  14.07, longitude =  48.27
Could not locate station Z3.A022A on mesh. Outside of mesh? latitude =  14.73, longitude =  48.44
Could not locate station Z3.A015A on mesh. Outside of mesh? latitude =  14.99, longitude =  48.74
Could not locate station Z3.A025A on mesh. Outside of mesh? latitude =  14.42, longitude =  47.33
Could not locate station Z3.A029A on mesh. Outside of mesh? latitude =  13.76, longitude =  47.24
Could not locate station Z3.A028A on mesh. Outside of mesh? latitude =  14.00, longitude =  46.91
Could not locate station Z3.A027A on mesh. Outside of mesh? latitude =  14.01, longitude =  46.62
Could not locate station Z3.A026A on mesh. Outside of mesh? latitude =  14.55, longitude =  46.74
Could not locate station Z3.A111A on mesh. Outside of mesh? latitude =  10.21, longitude =  49.66
Could not locate station Z3.A112A on mesh. Outside of mesh? latitude =   7.91, longitude =  49.46
Could not locate station Z3.A113A on mesh. Outside of mesh? latitude =   8.73, longitude =  49.36
Could not locate station Z3.A114A on mesh. Outside of mesh? latitude =   9.18, longitude =  49.40
Could not locate station Z3.A116A on mesh. Outside of mesh? latitude =   9.48, longitude =  49.21
Could not locate station Z3.A216A on mesh. Outside of mesh? latitude =   5.55, longitude =  44.24
Could not locate station Z3.A200A on mesh. Outside of mesh? latitude =   4.19, longitude =  43.50
Could not locate station Z3.A194A on mesh. Outside of mesh? latitude =   6.50, longitude =  44.20
Could not locate station Z3.A202A on mesh. Outside of mesh? latitude =   3.26, longitude =  43.31
Could not locate station Z3.A199A on mesh. Outside of mesh? latitude =   3.69, longitude =  43.55
Could not locate station Z3.A204A on mesh. Outside of mesh? latitude =   5.61, longitude =  43.05
Could not locate station Z3.A078A on mesh. Outside of mesh? latitude =  14.28, longitude =  48.67
Could not locate station Z3.A205A on mesh. Outside of mesh? latitude =   6.23, longitude =  43.01
Could not locate station Z3.A350A on mesh. Outside of mesh? latitude =  11.57, longitude =  49.98
Could not locate station Z3.A351A on mesh. Outside of mesh? latitude =  10.79, longitude =  49.81
Could not locate station Z3.A351B on mesh. Outside of mesh? latitude =  10.76, longitude =  49.81
Could not locate station Z3.A352A on mesh. Outside of mesh? latitude =  11.69, longitude =  49.63
Could not locate station Z3.A353A on mesh. Outside of mesh? latitude =  10.54, longitude =  49.33
Could not locate station Z3.A354A on mesh. Outside of mesh? latitude =  10.97, longitude =  49.26
Could not locate station Z3.A355A on mesh. Outside of mesh? latitude =  12.38, longitude =  49.16
Could not locate station Z3.A356A on mesh. Outside of mesh? latitude =  12.21, longitude =  48.85
Could not locate station Z3.A357B on mesh. Outside of mesh? latitude =  11.95, longitude =  48.51
Could not locate station Z3.A358A on mesh. Outside of mesh? latitude =  13.19, longitude =  48.68
Could not locate station Z3.A209A on mesh. Outside of mesh? latitude =   9.49, longitude =  42.31
Could not locate station Z3.A160A on mesh. Outside of mesh? latitude =   5.05, longitude =  47.50
Could not locate station Z3.A208A on mesh. Outside of mesh? latitude =   8.79, longitude =  42.04
Could not locate station Z3.A163A on mesh. Outside of mesh? latitude =   5.20, longitude =  47.01
Could not locate station Z3.A359A on mesh. Outside of mesh? latitude =  12.64, longitude =  48.64
Could not locate station Z3.A268A on mesh. Outside of mesh? latitude =  17.92, longitude =  47.24
Could not locate station Z3.A145A on mesh. Outside of mesh? latitude =  12.40, longitude =  47.68
Could not locate station Z3.A317A on mesh. Outside of mesh? latitude =   9.84, longitude =  42.86
Could not locate station Z3.A255A on mesh. Outside of mesh? latitude =  16.05, longitude =  45.32
Could not locate station Z3.A144A on mesh. Outside of mesh? latitude =  12.08, longitude =  47.91
Could not locate station Z3.A367A on mesh. Outside of mesh? latitude =  11.92, longitude =  48.12
Could not locate station Z3.A001A on mesh. Outside of mesh? latitude =  16.59, longitude =  48.54
Could not locate station Z3.A002B on mesh. Outside of mesh? latitude =  16.59, longitude =  48.17
Could not locate station Z3.A005B on mesh. Outside of mesh? latitude =  16.21, longitude =  48.18
Could not locate station Z3.A020A on mesh. Outside of mesh? latitude =  15.30, longitude =  46.76
Could not locate station Z3.A034A on mesh. Outside of mesh? latitude =  13.08, longitude =  46.72
Could not locate station Z3.A110A on mesh. Outside of mesh? latitude =   8.73, longitude =  49.59
Could not locate station Z3.A082A on mesh. Outside of mesh? latitude =  15.65, longitude =  49.87
Could not locate station Z3.A076A on mesh. Outside of mesh? latitude =  14.15, longitude =  49.43
Could not locate station Z3.A072A on mesh. Outside of mesh? latitude =  13.17, longitude =  49.28
Could not locate station Z3.A080A on mesh. Outside of mesh? latitude =  14.93, longitude =  49.49
Could not locate station Z3.A084A on mesh. Outside of mesh? latitude =  15.70, longitude =  48.75
Could not locate station Z3.A079A on mesh. Outside of mesh? latitude =  14.71, longitude =  49.04
Could not locate station Z3.A077A on mesh. Outside of mesh? latitude =  14.07, longitude =  49.08
Could not locate station Z3.A086A on mesh. Outside of mesh? latitude =  16.15, longitude =  49.66
Could not locate station Z3.A083A on mesh. Outside of mesh? latitude =  15.61, longitude =  49.51
Could not locate station Z3.A090A on mesh. Outside of mesh? latitude =  17.83, longitude =  49.18
Could not locate station Z3.A074A on mesh. Outside of mesh? latitude =  13.53, longitude =  49.48
Could not locate station Z3.A075A on mesh. Outside of mesh? latitude =  13.87, longitude =  49.85
Could not locate station Z3.A088A on mesh. Outside of mesh? latitude =  17.29, longitude =  49.24
Could not locate station Z3.A089A on mesh. Outside of mesh? latitude =  17.09, longitude =  48.96
Could not locate station Z3.A073A on mesh. Outside of mesh? latitude =  13.23, longitude =  49.80
Could not locate station Z3.A087A on mesh. Outside of mesh? latitude =  16.89, longitude =  49.51
Could not locate station Z3.A085A on mesh. Outside of mesh? latitude =  16.20, longitude =  49.25
Could not locate station Z3.A071A on mesh. Outside of mesh? latitude =  12.69, longitude =  49.55
Could not locate station Z3.A081A on mesh. Outside of mesh? latitude =  15.03, longitude =  49.89
Could not locate station Z3.A038A on mesh. Outside of mesh? latitude =  11.92, longitude =  47.27
Could not locate station Z3.A141A on mesh. Outside of mesh? latitude =  11.85, longitude =  47.56
Could not locate station Z3.A146A on mesh. Outside of mesh? latitude =  12.97, longitude =  48.10
Could not locate station Z3.A147B on mesh. Outside of mesh? latitude =  12.98, longitude =  48.34
Could not locate station Z3.A148B on mesh. Outside of mesh? latitude =  12.48, longitude =  48.32
Could not locate station Z3.A128A on mesh. Outside of mesh? latitude =   8.60, longitude =  49.21
Could not locate station Z3.A003A on mesh. Outside of mesh? latitude =  17.05, longitude =  47.57
Could not locate station Z3.A304A on mesh. Outside of mesh? latitude =  12.03, longitude =  44.82
Could not locate station Z3.A319A on mesh. Outside of mesh? latitude =  10.58, longitude =  43.28
Could not locate station Z3.A253A on mesh. Outside of mesh? latitude =  13.82, longitude =  45.10
Could not locate station Z3.A254A on mesh. Outside of mesh? latitude =  15.80, longitude =  45.12
Could not locate station Z3.A006A on mesh. Outside of mesh? latitude =  16.02, longitude =  48.55
Could not locate station Z3.A270A on mesh. Outside of mesh? latitude =  19.02, longitude =  47.65
Could not locate station Z3.A217A on mesh. Outside of mesh? latitude =   6.07, longitude =  44.18
Could not locate station Z3.A004A on mesh. Outside of mesh? latitude =  16.40, longitude =  47.77
Could not locate station Z3.A007A on mesh. Outside of mesh? latitude =  15.53, longitude =  48.53
Could not locate station Z3.A008A on mesh. Outside of mesh? latitude =  15.65, longitude =  48.18
Could not locate station Z3.A009A on mesh. Outside of mesh? latitude =  16.09, longitude =  47.49
Could not locate station Z3.A010A on mesh. Outside of mesh? latitude =  16.08, longitude =  46.88
Could not locate station Z3.A011B on mesh. Outside of mesh? latitude =  15.96, longitude =  47.22
Could not locate station Z3.A012A on mesh. Outside of mesh? latitude =  15.59, longitude =  47.41
Could not locate station Z3.A013A on mesh. Outside of mesh? latitude =  15.41, longitude =  47.87
Could not locate station Z3.A014A on mesh. Outside of mesh? latitude =  15.16, longitude =  48.16
Could not locate station Z3.A016A on mesh. Outside of mesh? latitude =  14.65, longitude =  48.11
Could not locate station Z3.A017A on mesh. Outside of mesh? latitude =  14.76, longitude =  47.76
Could not locate station Z3.A018A on mesh. Outside of mesh? latitude =  15.08, longitude =  47.55
Could not locate station Z3.A019A on mesh. Outside of mesh? latitude =  15.09, longitude =  47.25
Could not locate station Z3.A021A on mesh. Outside of mesh? latitude =  15.83, longitude =  46.56
Could not locate station Z3.A332A on mesh. Outside of mesh? latitude =  18.46, longitude =  48.61
Could not locate station Z3.A333A on mesh. Outside of mesh? latitude =  17.10, longitude =  48.52
Could not locate station Z3.A334A on mesh. Outside of mesh? latitude =  17.67, longitude =  48.41
Could not locate station Z3.A335A on mesh. Outside of mesh? latitude =  18.34, longitude =  48.26
Could not locate station Z3.A336A on mesh. Outside of mesh? latitude =  19.00, longitude =  48.04
Could not locate station Z3.A337A on mesh. Outside of mesh? latitude =  17.79, longitude =  48.05
Could not locate station Z3.A338A on mesh. Outside of mesh? latitude =  18.35, longitude =  47.82
Could not locate station Z3.A339A on mesh. Outside of mesh? latitude =  17.66, longitude =  47.64
Could not locate station Z3.A263A on mesh. Outside of mesh? latitude =  17.31, longitude =  46.45
Could not locate station Z3.A262A on mesh. Outside of mesh? latitude =  16.53, longitude =  46.67
Could not locate station Z3.A318A on mesh. Outside of mesh? latitude =  10.57, longitude =  42.93
Could not locate station Z3.A265A on mesh. Outside of mesh? latitude =  17.80, longitude =  46.23
Could not locate station Z3.A206A on mesh. Outside of mesh? latitude =   6.60, longitude =  43.03
Could not locate station Z3.A312A on mesh. Outside of mesh? latitude =  10.48, longitude =  44.91
Could not locate station Z3.A193A on mesh. Outside of mesh? latitude =   5.15, longitude =  44.18
Could not locate station Z3.A309A on mesh. Outside of mesh? latitude =  12.24, longitude =  43.98
Could not locate station Z3.A306A on mesh. Outside of mesh? latitude =  10.60, longitude =  44.34
Could not locate station Z3.A316A on mesh. Outside of mesh? latitude =  10.30, longitude =  42.14
Could not locate station Z3.A269A on mesh. Outside of mesh? latitude =  18.38, longitude =  47.45
Could not locate station Z3.A302A on mesh. Outside of mesh? latitude =  11.97, longitude =  45.44
Could not locate station Z3.A188A on mesh. Outside of mesh? latitude =   3.94, longitude =  44.41
Could not locate station Z3.A313A on mesh. Outside of mesh? latitude =  10.66, longitude =  45.12
Could not locate station Z3.A261A on mesh. Outside of mesh? latitude =  17.15, longitude =  46.76
Could not locate station Z3.A305A on mesh. Outside of mesh? latitude =  12.43, longitude =  44.77
Could not locate station Z3.A264A on mesh. Outside of mesh? latitude =  17.29, longitude =  45.97
Could not locate station Z3.A301A on mesh. Outside of mesh? latitude =  12.62, longitude =  45.43
Could not locate station Z3.A266A on mesh. Outside of mesh? latitude =  18.26, longitude =  46.33
Could not locate station Z3.A308A on mesh. Outside of mesh? latitude =  12.01, longitude =  44.39
Could not locate station Z3.A184A on mesh. Outside of mesh? latitude =   4.45, longitude =  44.70
Could not locate station Z3.A267A on mesh. Outside of mesh? latitude =  18.48, longitude =  46.75
Could not locate station Z3.A300A on mesh. Outside of mesh? latitude =  13.13, longitude =  45.63
Could not locate station DK.ILULI on mesh. Outside of mesh? latitude = -51.10, longitude =  69.08
Could not locate station DK.NUUG on mesh. Outside of mesh? latitude = -53.20, longitude =  71.42
Could not locate station DK.KULLO on mesh. Outside of mesh? latitude = -57.22, longitude =  74.48
Could not locate station 8X.CA03A on mesh. Outside of mesh? latitude =  18.42, longitude =  43.68
Could not locate station 8X.CA06A on mesh. Outside of mesh? latitude =  16.25, longitude =  42.20
Could not locate station 8X.CA01A on mesh. Outside of mesh? latitude =  19.37, longitude =  43.43
Could not locate station 8X.CA07A on mesh. Outside of mesh? latitude =  16.06, longitude =  43.40
Could not locate station 8X.CA05A on mesh. Outside of mesh? latitude =  16.18, longitude =  42.86
Could not locate station 8X.CA02A on mesh. Outside of mesh? latitude =  18.59, longitude =  42.98
Could not locate station 8X.CA09A on mesh. Outside of mesh? latitude =  17.15, longitude =  42.79
Could not locate station 8X.CA08A on mesh. Outside of mesh? latitude =  17.36, longitude =  42.58
Could not locate station 8X.CA04A on mesh. Outside of mesh? latitude =  18.10, longitude =  43.11
Could not locate station 8X.CA04A on mesh. Outside of mesh? latitude =  18.10, longitude =  43.11
Could not locate station 8X.CA01A on mesh. Outside of mesh? latitude =  19.37, longitude =  43.43
Could not locate station 8X.CA07A on mesh. Outside of mesh? latitude =  16.06, longitude =  43.40
Could not locate station 8X.CA05A on mesh. Outside of mesh? latitude =  16.18, longitude =  42.86
Could not locate station 8X.CA02A on mesh. Outside of mesh? latitude =  18.59, longitude =  42.98
Could not locate station 8X.CA09A on mesh. Outside of mesh? latitude =  17.15, longitude =  42.79
Could not locate station 8X.CA08A on mesh. Outside of mesh? latitude =  17.36, longitude =  42.58
Could not locate station 8X.CA04A on mesh. Outside of mesh? latitude =  18.10, longitude =  43.11
Could not locate station 8X.CA04A on mesh. Outside of mesh? latitude =  18.10, longitude =  43.11
Wrote 228 receivers into the TOML file.

This call should generate a directory with some parameter files inside. All the receiver information is now contained within the file receivers.toml, and a snippet containing the command line parameters can be seen in run_salvus.sh. We'll take a look at them below.

!echo "\n\nreceivers.toml:\n"
!head -n 20 3d_example/receivers.toml

!echo "\n\nSalvus run command:\n"
!cat 3d_example/run_salvus.sh
receivers.toml:

[[receiver]]
network = "Z3"
station = "A118B"
location = ""
physical_latitude = 49.15436
physical_longitude = 9.97441
physical_depth_in_meters = 0.00000
medium = "solid"
salvus_coordinates = [4103777.30905, 721717.02978, 4819467.37409]
transform_matrix = [ [0.64414, 0.11328, 0.75647],
                     [-0.74504, -0.13103, 0.65402],
                     [-0.17321, 0.98489, 0.00000] ]

[[receiver]]
network = "Z3"
station = "A289A"
location = ""
physical_latitude = 45.85498
physical_longitude = 9.76100
physical_depth_in_meters = 0.00000


Salvus run command:

/Users/lion/workspace/code/salvus_wave/build/salvus --dimension 3 --mesh-file ./SphericalChunk3D_prem_iso_one_crust_30.e --model-file ./SphericalChunk3D_prem_iso_one_crust_30.e --end-time 30.0 --polynomial-order 4 --receiver-file-name receiver.h5 --receiver-fields u_ELASTIC --cmd-line-source true --source-temporal-type ricker --source-center-frequency 0.030303030303030304 --absorbing-boundaries p0,p1,r0,t0,t1 --save-movie --movie-file-name test_movie.h5 --movie-fields u_ELASTIC --source-location-x 4312282.72881 --source-location-y 677660.616715 --source-location-z 4636076.75239 --source-spatial-type moment_tensor --source-scale 5.98189e14,-7.2272e14,1.2453e14,7.37973e14,-3.53576e14,-6.45137e14 --receiver-toml 3d_example/receivers.toml
!sh ./3d_example/run_salvus.sh
====================================================
Salvus version 0.0.1-686-g644f5f44-dirty
Floating point size: 64
Compiled for GLL orders: 4
Running on 1 rank(s).
====================================================

--source-time-delay not set. Will auto-calculate.
Initializing problem.
Start time set to -51.459989.
Time step set to: 0.281515 s.
Start time set to -51.459989.
Begin time loop.
Time loop progress [100%].
Time loop completed in 2.68026 seconds.
Begin post processing.
Problem complete.

When the simulation is done, we can go ahead and view the movie using the topology output by petsc.

!python ./petsc_gen_xdmf.py ./test_movie.h5
!$PARAVIEW_BIN ./test_movie.xmf

Feel free to load the data in the ASDF sextant to view it in a convenient way.