Skip to content

Commit

Permalink
Update version to v0.19.46 in marmousi-acoustic.jl notebook
Browse files Browse the repository at this point in the history
Remove unused import of ColorSchemes in GeoPhyInv.jl
Increase _fd_npml and _fd_npextend values in GeoPhyInv.jl
Add maxiter parameter to IterativeSolvers.lsmr! in fwi.jl
Update dependencies in Project.toml
Add tauii_buffer to P_x_worker_x_pw struct in fdtd.jl
Update add_velocity_source! and add_stress_source! functions in propagate.jl
Remove unused seriescolor line in plots.jl
Update compute_stressii! function in advance_elastic.jl
Update gradient_finitediff_testing.jl notebook
  • Loading branch information
pawbz committed Oct 26, 2024
1 parent 04ce988 commit 7705e8b
Show file tree
Hide file tree
Showing 17 changed files with 721 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.4"
manifest_format = "2.0"
project_hash = "b93906f24b48daeaa115e6a8eb2d9b29862f8e80"
project_hash = "da2b1e181419a1d0edd7834abebe8c15fb72559a"

[[deps.ASL_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
Expand Down
1 change: 0 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
ColorSchemes = "35d6a980-a343-548e-a6ea-1d62b119f2f4"
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Expand Down
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ ENV["GKSwstype"] = "100"

using Documenter, GeoPhyInv, SparseArrays, LinearAlgebra, Random, LinearMaps
using Plots, Test, Luxor
using ColorSchemes

# standard setting for generating doc pages
# @init_parallel_stencil(2, false, Float32, 2)
Expand Down
24 changes: 12 additions & 12 deletions notebooks/gradient_finitediff_testing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ end
# @time update!(m1, pa_mod, [:invK])

# ╔═╡ f49439df-3db3-48ae-bf9d-1387e3c14c8f
N = 2
N = 100

# ╔═╡ 6d47ae1d-2554-4d42-af6c-02ce952bf14e
@bind mpara Select([:invK, :rho])
Expand Down Expand Up @@ -180,7 +180,7 @@ isnan.(pa_inv.dobs[1].d[1])
begin
g = similar(m)
GeoPhyInv.gradient!(g, m, pa_inv)
heatmap(Array(pa_mod.c.gradients[1]))
heatmap(Array(reshape(g, N, N)), c=:seismic)
end

# ╔═╡ aa0f7f1b-65ff-4a0b-9fb0-e6660911fdc8
Expand All @@ -198,6 +198,9 @@ heatmap(Array(reshape(pa_inv.P' * m, Nz, Nx)))
# ╔═╡ 01552458-5de7-4627-b417-21745db2ade1
heatmap(Array(reshape(m, 176, 176)))

# ╔═╡ 8ec00fb7-fe18-4741-b987-813ec97d73fe
heatmap(Array(reshape(gm, N, N)), c=:seismic)

# ╔═╡ cd5bff59-6466-43d7-bd10-795d6f55d4ef
heatmap(Array(reshape(g, 2, 2)), c=:seismic)

Expand All @@ -213,6 +216,9 @@ gKI = reshape(g, N, N)
# ╔═╡ 630faaff-f7f0-46d7-a36f-31a54e589c8e
heatmap(Array(gKI), c=:seismic)

# ╔═╡ c6007b1a-3819-4543-bab4-f0dc0c12e075
gm1 = Array(reshape(gm, N, N))

# ╔═╡ 839cf146-639c-4d13-9470-d25882837169
# prod(step.(pa_true.c.medium.grid)) #
pa_true.c.srcwav[1][1].grid |> step |> abs2
Expand All @@ -223,6 +229,9 @@ GeoPhyInv.Fields(pa_mod.c.attrib_mod, "v")
# ╔═╡ b14a5a36-94c4-4a6c-8b26-730919e3e5ae
filter(x -> x Fields(pa_mod.c.attrib_mod, "d"), Fields(pa_mod.c.attrib_mod, "v"))

# ╔═╡ 60a9adc0-466d-4e54-9838-f01b0a2c50c5
Array(gKI) ./ gm1

# ╔═╡ 417388ad-8709-4d4a-9d81-d4bbb0351a92
heatmap(Array(pa_mod.c.gradients[1]), clim=(-1e-11, 1e-11), c=:seismic)

Expand All @@ -238,16 +247,7 @@ end
Js(GeoPhyInv.Data.Array(xs))

# ╔═╡ c6626e0f-4bf1-4e29-a0c3-1e7f23805f61
gm = grad(central_fdm(2, 1, factor=1e8), Js, xs)[1]

# ╔═╡ 8ec00fb7-fe18-4741-b987-813ec97d73fe
heatmap(Array(reshape(gm, N, N)), c=:seismic)

# ╔═╡ c6007b1a-3819-4543-bab4-f0dc0c12e075
gm1 = Array(reshape(gm, N, N))

# ╔═╡ 60a9adc0-466d-4e54-9838-f01b0a2c50c5
Array(gKI) ./ gm1
# gm = grad(central_fdm(2, 1, factor=1e8), Js, xs)[1]

# ╔═╡ 9371b452-4ad6-4d07-ae98-c86239b6c110
gs = get_xs(g, xs)
Expand Down
2 changes: 1 addition & 1 deletion notebooks/marmousi-acoustic.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.21
# v0.19.46

#> [frontmatter]
#> title = "Marmousi"
Expand Down
52 changes: 46 additions & 6 deletions notebooks/reusing-seisforwexpt.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### A Pluto.jl notebook ###
# v0.19.21
# v0.19.46

#> [frontmatter]
#> title = "SeisForwExpt"
Expand All @@ -8,14 +8,26 @@
using Markdown
using InteractiveUtils

# This Pluto notebook uses @bind for interactivity. When running this notebook outside of Pluto, the following 'mock version' of @bind gives bound variables a default value (instead of an error).
macro bind(def, element)
quote
local iv = try Base.loaded_modules[Base.PkgId(Base.UUID("6e696c72-6542-2067-7265-42206c756150"), "AbstractPlutoDingetjes")].Bonds.initial_value catch; b -> missing; end
local el = $(esc(element))
global $(esc(def)) = Core.applicable(Base.get, el) ? Base.get(el) : iv(el)
el
end
end

# ╔═╡ 5fc7d3bf-418d-4487-a2d6-bc07c736374b
begin
import Pkg
Pkg.add("PlutoLinks")
Pkg.add("Revise")
Pkg.add("PlutoUI")
Pkg.add("PlutoTest")
Pkg.add("Plots")
Pkg.add("CUDA")
using Revise
using PlutoLinks: @revise
using PlutoUI, PlutoTest, Plots, CUDA
end
Expand Down Expand Up @@ -52,8 +64,10 @@ various bundles of medium parameters. We will first load a predefined medium, a
medium = ElasticMedium(Homogeneous(), 5)

# ╔═╡ ded21d43-99d6-453b-a858-e32f3f82e605
# surface seismic acquisition with 3 supersources and 100 receivers
ageom = AGeom(medium.grid, :surf, SSrcs(1), Recs(100))
begin
# surface seismic acquisition with 3 supersources and 100 receivers
ageom = AGeom(medium.grid, :xwell, SSrcs(1), Recs(100));
end

# ╔═╡ a47b1e5d-a08c-4750-b1f3-f8a62225a19f
# lets choose a time grid
Expand Down Expand Up @@ -84,14 +98,19 @@ md"""
Now we have all the stuff necessary to allocate an instance of `SeisForwExpt`.
"""

# ╔═╡ 14713ee7-6753-46a7-98b3-ed0b8ef48ae4
tsnaps=tgrid

# ╔═╡ c7d96dda-17f5-4dbb-98bf-4c29fd784574
pa = SeisForwExpt(
FdtdElastic(),
snaps_field=:vx,
tsnaps=tsnaps,
medium=medium,
ageom=ageom,
srcwav=srcwav,
tgrid=tgrid,
rfields=[:vz],
rfields=[:vz, :vx],
verbose=true,
);

Expand All @@ -103,7 +122,7 @@ Before modeling, we will now generate a perturbed medium, which is "similar" to
# ╔═╡ df4a4072-a91a-471a-88d9-b74ed58e7823
begin
medium_box = deepcopy(medium)
update!(medium_box, [:vp, :rho, :vs], rectangle=[[-500, -500], [500, 500]], perc=5.0) # perturbed velocity box
update!(medium_box, [:vp, :rho, :vs], rectangle=[[-500, -500], [500, 500]], perc=20.0) # perturbed velocity box

end

Expand All @@ -127,6 +146,12 @@ begin
data_box = deepcopy(pa[:data]) # copy data
end

# ╔═╡ e9c4cb8b-20bf-43c3-8da5-9ecb2e0ddfd2
@bind it Slider(1:length(tgrid), show_value=true)

# ╔═╡ 3ea41115-2623-4b55-b5a0-9b3a282b6668
heatmap(pa[:snaps,1][it], c=:seismic,aspect_ratio=:equal)

# ╔═╡ fd11d02d-80cd-4373-a8d1-e0d50d93dcf8
md"""
Lets look at the timer objects.
Expand All @@ -139,7 +164,16 @@ t1
t2

# ╔═╡ 4612405a-530b-4eab-8b84-40dc907929e4
plot(plot(data, 99.9), plot(data_box, 99.9), size=(800, 500))
plot(plot(data, 10), plot(data_box, 10), size=(800, 500))

# ╔═╡ c3b9e67c-ec42-422f-bb65-f12269b659d7
plot(data, 90)

# ╔═╡ 994331fc-95b7-4417-89b2-bfab6f9b912e
data[:vz] |> maximum

# ╔═╡ ca5301e3-6740-4f55-a488-121d50e72358
data[:vx] |> maximum

# ╔═╡ ec7985c6-7072-4ac4-9caa-74a815193750
@test data data_box
Expand All @@ -160,14 +194,20 @@ plot(plot(data, 99.9), plot(data_box, 99.9), size=(800, 500))
# ╠═10be735e-4012-4fa8-b538-9f9a08694458
# ╠═7fa1ddc5-fe10-44e2-b764-533be1840ab6
# ╟─cec954f6-c278-4003-99e4-6c995f74b606
# ╠═14713ee7-6753-46a7-98b3-ed0b8ef48ae4
# ╠═c7d96dda-17f5-4dbb-98bf-4c29fd784574
# ╠═9a3360c0-72c7-420f-a7c0-5565a1383f07
# ╠═df4a4072-a91a-471a-88d9-b74ed58e7823
# ╠═07da9113-a518-4925-8978-8407dc60c605
# ╟─7ac4f51d-73b4-4f9c-88a4-a48911742282
# ╠═033cd313-4e87-4364-a1f8-136e0e06bb65
# ╠═3ea41115-2623-4b55-b5a0-9b3a282b6668
# ╠═e9c4cb8b-20bf-43c3-8da5-9ecb2e0ddfd2
# ╠═fd11d02d-80cd-4373-a8d1-e0d50d93dcf8
# ╠═368c2bbd-94fb-4826-96eb-8fa37a7e35a3
# ╠═7236dc4a-fe04-492d-9532-170ac7c22fb8
# ╠═4612405a-530b-4eab-8b84-40dc907929e4
# ╠═c3b9e67c-ec42-422f-bb65-f12269b659d7
# ╠═994331fc-95b7-4417-89b2-bfab6f9b912e
# ╠═ca5301e3-6740-4f55-a488-121d50e72358
# ╠═ec7985c6-7072-4ac4-9caa-74a815193750
Loading

0 comments on commit 7705e8b

Please sign in to comment.