-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #183 from slimgroup/elastic
Elastic forward
- Loading branch information
Showing
49 changed files
with
930 additions
and
496 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
|
||
/.luarc.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Example for basic 3D modeling: | ||
# The receiver positions and the source wavelets are the same for each of the four experiments. | ||
# Author: Philipp Witte, pwitte@eos.ubc.ca | ||
# Date: January 2017 | ||
# | ||
|
||
using JUDI | ||
|
||
# Set up model structure | ||
n = (120, 100) # (x,y,z) or (x,z) | ||
d = (10., 10.) | ||
o = (0., 0.) | ||
|
||
# Velocity [km/s] | ||
v = ones(Float32,n) .+ .5f0 | ||
v[:, Int(round(end/2)):end] .= 4.0f0 | ||
rho = ones(Float32, n) | ||
vs = zeros(Float32,n) | ||
vs[:, Int(round(end/2)):end] .= 2f0 | ||
|
||
# Slowness squared [s^2/km^2] | ||
m = (1f0 ./ v).^2 | ||
# Setup model structure | ||
nsrc = 1 | ||
model = Model(n, d, o, m; rho=rho, vs=vs) | ||
|
||
# Set up 3D receiver geometry by defining one receiver vector in each x and y direction | ||
nxrec = 120 | ||
nyrec = 100 | ||
xrec = range(50f0, stop=1150f0, length=nxrec) | ||
yrec = 0f0 | ||
zrec = range(0f0, stop=0f0, length=nxrec) | ||
|
||
# receiver sampling and recording time | ||
timeR = 1500f0 # receiver recording time [ms] | ||
dtR = 4f0 # receiver sampling interval | ||
|
||
# Set up receiver structure | ||
recGeometry = Geometry(xrec, yrec, zrec; dt=dtR, t=timeR, nsrc=nsrc) | ||
|
||
# Set up source geometry (cell array with source locations for each shot) | ||
xsrc = 600f0 | ||
ysrc = 0f0 | ||
zsrc = 0f0 | ||
|
||
# source sampling and number of time steps | ||
timeS = 1500f0 # source length in [ms] | ||
dtS = 2f0 # source sampling interval | ||
|
||
# Set up source structure | ||
srcGeometry = Geometry(xsrc, ysrc, zsrc; dt=dtS, t=timeS) | ||
|
||
# setup wavelet | ||
f0 = 0.01f0 | ||
wavelet = ricker_wavelet(timeS, dtS, f0) | ||
|
||
################################################################################################### | ||
|
||
# Setup operators | ||
F = judiModeling(model, srcGeometry, recGeometry) | ||
q = judiVector(srcGeometry, wavelet) | ||
|
||
# Nonlinear modeling | ||
dobs = F*q |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
############################################################################# | ||
(F::judiModeling{D, O})(m::AbstractModel{D, N}) where {D, O, N} = judiModeling(m; options=F.options) | ||
(FS::judiDataSourceModeling{D, O})(F::judiModeling{D, O}) where {D, O} = judiDataSourceModeling{D, O}(FS.rInterpolation, F, FS.qInjection) | ||
(FS::judiDataModeling{D, O})(F::judiModeling{D, O}) where {D, O} = judiDataModeling{D, O}(FS.rInterpolation, F) | ||
(FS::judiPointSourceModeling{D, O})(F::judiModeling{D, O}) where {D, O} = judiPointSourceModeling{D, O}(F, FS.qInjection) | ||
|
||
(J::judiJacobian{D, O, FT})(F::judiModeling{D, O}) where {D, O, FT} = judiJacobian(J.F(F), J.q) | ||
|
||
for FT in [judiPointSourceModeling, judiDataModeling, judiDataSourceModeling, judiJacobian] | ||
@eval begin | ||
(F::$(FT))(m::AbstractModel) = F(F.F(m)) | ||
end | ||
end | ||
|
||
function (F::judiPropagator)(;kwargs...) | ||
Fl = deepcopy(F) | ||
for (k, v) in kwargs | ||
k in _mparams(Fl.model) && getfield(Fl.model, k) .= v | ||
end | ||
Fl | ||
end | ||
|
||
function (F::judiPropagator)(m, q) | ||
Fm = F(;m=m) | ||
_track_illum(F.model, Fm.model) | ||
return Fm*as_src(q) | ||
end | ||
|
||
function (F::judiPropagator)(m::AbstractArray) | ||
@info "Assuming m to be squared slowness for $(typeof(F))" | ||
return F(;m=m) | ||
end | ||
|
||
(F::judiPropagator)(m::AbstractModel, q) = F(m)*as_src(q) | ||
|
||
function (J::judiJacobian{D, O, FT})(q::judiMultiSourceVector) where {D, O, FT} | ||
newJ = judiJacobian{D, O, FT}(J.m, J.n, J.F, q) | ||
_track_illum(J.model, newJ.model) | ||
return newJ | ||
end | ||
|
||
function (J::judiJacobian{D, O, FT})(x::Array{D, N}) where {D, O, FT, N} | ||
if length(x) == prod(J.model.n) | ||
return J(;m=m) | ||
end | ||
new_q = _as_src(J.qInjection.op, J.model, x) | ||
newJ = judiJacobian{D, O, FT}(J.m, J.n, J.F, new_q) | ||
_track_illum(J.model, newJ.model) | ||
return newJ | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
1 comment
on commit 16aa54a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/84543
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v3.3.0 -m "<description of version>" 16aa54abc9e1a18d8bd59636895afbd90718b0b7
git push origin v3.3.0
@JuliaRegistrator register