API Reference
ElasticFDSG.config_template_2dElasticFDSG.config_template_3dElasticFDSG.load_resultsElasticFDSG.runsim
Running simulations
ElasticFDSG.runsim — Function
runsim(config, velmod) -> FDSG or nothingRun an elastic forward simulation.
Arguments
config: simulation configuration — either aDict(built withconfig_template_2d/config_template_3d) or a file path (String) to a.yaml/.ymlfile.velmod: velocity model — either a JuliaAbstractArrayor a file path (String) to a.jld2,.npy, or.npzfile.
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
FDSGstruct whenconfig["settings"]["output_file"]isnothing. nothingwhen 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 pathsConfiguration helpers
ElasticFDSG.config_template_2d — Function
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) -> DictBuild 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.
```
ElasticFDSG.config_template_3d — Function
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) -> DictBuild 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.
```
Loading results
ElasticFDSG.load_results — Function
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"]