From 82acf3f8b0a12d6cfcdf4340870ab71ce68a4888 Mon Sep 17 00:00:00 2001 From: laetitialp Date: Thu, 24 Aug 2023 14:38:08 +0200 Subject: [PATCH] 2D both working --- examples/Wave2D_Day3.jl | 10 +++++----- examples/Wave2D_Sh_Day4.jl | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Wave2D_Day3.jl b/examples/Wave2D_Day3.jl index 4f10353..f8880ec 100644 --- a/examples/Wave2D_Day3.jl +++ b/examples/Wave2D_Day3.jl @@ -22,7 +22,7 @@ function MainSource() # Source parameters - 𝑓₀ = 200 # Central frequency of the source [Hz] + 𝑓₀ = 50 # Central frequency of the source [Hz] t₀ = 1.2/𝑓₀ isrc = Int((Nc.x/2)+1) jsrc = Int((Nc.y/2)+1) @@ -87,10 +87,10 @@ function MainSource() @. L.i.yx[:,2:end-1] = (V.c.y[2:end,2:end-1] - V.c.y[1:end-1,2:end-1])/Δ.x @. L.j.yx[2:end-1,:] = (V.v.y[2:end,:] - V.v.y[1:end-1,:])/Δ.x - @. L.i.yy[:,2:end-1] = (V.v.y[:,2:end] - V.v.y[:,2:end])/Δ.y + @. L.i.yy[:,2:end-1] = (V.v.y[:,2:end] - V.v.y[:,1:end-1])/Δ.y @. L.j.yy[2:end-1,:] = (V.c.y[2:end-1,2:end] - V.c.y[2:end-1,1:end-1])/Δ.y - @. L.i.xy[:,2:end-1] = (V.v.x[:,2:end] - V.v.x[:,2:end])/Δ.y + @. L.i.xy[:,2:end-1] = (V.v.x[:,2:end] - V.v.x[:,1:end-1])/Δ.y @. L.j.xy[2:end-1,:] = (V.c.x[2:end-1,2:end] - V.c.x[2:end-1,1:end-1])/Δ.y @@ -149,14 +149,14 @@ function MainSource() *((τ.j.xy[3:end-1,2:end-1]-τ.j.xy[2:end-2,2:end-1])/Δ.x + (τ.i.yy[2:end-1,3:end-1]-τ.i.yy[2:end-1,2:end-2])/Δ.y - (P.i[2:end-1,3:end-1]-P.i[2:end-1,2:end-2])/Δ.y - - 0.0*f_ext.v[2:end-1,2:end-1])) + - f_ext.v[2:end-1,2:end-1])) @. V.c.y[2:end-1,2:end-1] = (V.c.y[2:end-1,2:end-1] + Δt/ρ.c[2:end-1,2:end-1] *((τ.i.xy[2:end,2:end-1]-τ.i.xy[1:end-1,2:end-1])/Δ.x + (τ.j.yy[2:end-1,2:end]-τ.j.yy[2:end-1,1:end-1])/Δ.y - (P.j[2:end-1,2:end]-P.j[2:end-1,1:end-1])/Δ.y - - 0.0*Xf_ext.c[2:end-1,2:end-1])) + - f_ext.c[2:end-1,2:end-1])) # # Absorbing boundary Cerjean et al. (1985) diff --git a/examples/Wave2D_Sh_Day4.jl b/examples/Wave2D_Sh_Day4.jl index c82ed11..017f984 100644 --- a/examples/Wave2D_Sh_Day4.jl +++ b/examples/Wave2D_Sh_Day4.jl @@ -1,7 +1,7 @@ using SeismicQ, Plots function MainSource() - + visu=true # Spatial extent l = (x = 25.0, y = 12.5) @@ -210,12 +210,12 @@ function MainSource() # @. τ.xx = τ.xx * bc_filtE_c # Visualisation - # if mod(it, Nout)==0 - # # @. Vnorm = sqrt(V.c.x^2+V.c.y^2) - # # Vmax = max(Vmax, maximum(V.v.z)) - # display( heatmap(X.v.x,X.v.y, V.v.z' , clim=(-1.e-4,1.e-4))) - # sleep(0.1) - # end + if mod(it, Nout)==0 && visu==true + # @. Vnorm = sqrt(V.c.x^2+V.c.y^2) + # Vmax = max(Vmax, maximum(V.v.z)) + display( heatmap(X.v.x,X.v.y, V.v.z' , clim=(-1.e-4,1.e-4))) + sleep(0.1) + end end #@show Vmax end