API Reference

Running simulations

ElasticFDSG.runsimFunction
runsim(config, velmod) -> FDSG or nothing

Run an elastic forward simulation.

Arguments

  • config: simulation configuration — either a Dict (built with config_template_2d / config_template_3d) or a file path (String) to a .yaml / .yml file.
  • velmod: velocity model — either a Julia AbstractArray or a file path (String) to a .jld2, .npy, or .npz file.

The simulation dimension (2D / 3D) is detected automatically: a (7, nx, nz) array triggers a 2D run; a (13, nx, ny, nz) array triggers 3D.

Returns

  • The populated FDSG struct when config["settings"]["output_file"] is nothing.
  • nothing when an output file path is given (results are written to HDF5).

Example

fdsg = runsim(config_dict, velmod_array)
runsum(config, velmod)                  # from dict and array 
runsim("config.yaml", "velmod.jld2")    # from file paths
source

Configuration helpers

ElasticFDSG.config_template_2dFunction
config_template_2d(; device, precision, fd_order, verbose, output_file,
                     t_start, t_end, dt,
                     fdom, wavelet, wavelet_center, seismic_moment,
                     src_x, src_z, Mxx, Mxz, Mzz, anisotropic,
                     xstart, xend, zstart, zend, pml_layer,
                     geophones, das_x_aligned, das_z_aligned,
                     snapshot_times, snapshot_fields) -> Dict

Build a 2D simulation configuration dictionary.

All keyword arguments are required. The returned Dict can be passed directly to runsim or serialised to YAML by the user.

```

source
ElasticFDSG.config_template_3dFunction
config_template_3d(; device, precision, fd_order, verbose, output_file,
                     t_start, t_end, dt,
                     fdom, wavelet, wavelet_center, seismic_moment,
                     src_x, src_y, src_z,
                     Mxx, Mxy, Mxz, Myy, Myz, Mzz, anisotropic,
                     xstart, xend, ystart, yend, zstart, zend, pml_layer,
                     geophones, das_x_aligned, das_y_aligned, das_z_aligned,
                     snapshot_positions, snapshot_times, snapshot_fields) -> Dict

Build a 3D simulation configuration dictionary.

All keyword arguments are required. The returned Dict can be passed directly to runsim or serialised to YAML by the user.

```

source

Loading results

ElasticFDSG.load_resultsFunction
load_results(path) -> Dict{String, Any}

Load simulation results from an HDF5 file into a nested Julia dictionary.

Example

data = load_results("output.h5")
vx_snap = data["snapshots"]["XZ"]   # 2D wavefield snapshots
geo1    = data["geophones"]["geophone_1"]["data"]
source