Skip to content

Commit

Permalink
2D both working
Browse files Browse the repository at this point in the history
  • Loading branch information
laetitialp committed Aug 24, 2023
1 parent edb3795 commit 82acf3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions examples/Wave2D_Day3.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down
14 changes: 7 additions & 7 deletions examples/Wave2D_Sh_Day4.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using SeismicQ, Plots

function MainSource()

visu=true
# Spatial extent
l = (x = 25.0, y = 12.5)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 82acf3f

Please sign in to comment.