extend PhysicalParams#16
Conversation
|
|
||
| import JUDI: AbstractSize | ||
|
|
||
| space_offset(N::NTuple{2,<:Integer}, nh::Integer) = AbstractSize((:h, :x, :z), (nh, N[1], N[2])) |
| JUDI.update!(F.options, options) | ||
| offsets = Vector{D}(offsets) | ||
| return judiExtendedJacobian{D, :born, typeof(F)}(F.m, space(F.model.n), F, q, offsets, omni) | ||
| #return judiExtendedJacobian{D, :born, typeof(F)}(F.m, space(F.model.n), F, q, offsets, omni) |
There was a problem hiding this comment.
modified space_offset to include offset dimension
|
|
||
|
|
||
| # --- Adjoint: loop over all sources, sum gradient volumes --- | ||
| function JUDI.multi_src_propagate(J::judiExtendedJacobian{T, :adjoint_born, O}, |
There was a problem hiding this comment.
That doesn't look right this should still be in JUDI, because right now it bypasses all the parallelism and stuff
There was a problem hiding this comment.
removed this entirely and removed PhysicalParameter extension as it was creating JUDI compatibility issues especially with _project_to_physical_domain in propagation.jl. Adjoint born returns plain vector and lsqr works fine as I include a fix in a new commit. Appreciate your review!
mloubout
left a comment
There was a problem hiding this comment.
Some comments, some simple test with PhysicalParameter would be good
| end | ||
|
|
||
| # Avoids PhysicalParameter issue with lsqr! | ||
| import Base: similar |
| end | ||
|
|
||
| # Handle both 1D and 2D offset dimensions | ||
| space_offset(N::NTuple{2,<:Integer}, nh::Integer, ndim::Integer) = ndim == 1 ? AbstractSize((:h, :x, :z), (nh, N[1], N[2])) : AbstractSize((:hx, :hz, :x, :z), (nh, nh, N[1], N[2])) |
There was a problem hiding this comment.
this is only 2D misses (x, y , z)
| end | ||
|
|
||
| # Forward: multi_src_propagate redirects | ||
| function JUDI.multi_src_propagate(J::judiExtendedJacobian{T, :born, O}, |
There was a problem hiding this comment.
this belongs in JUDI for judiComposedPropagator
| return JUDI.multi_src_propagate(J, vec(dm)) | ||
| end | ||
|
|
||
| function JUDI.multi_src_propagate(J::judiExtendedJacobian{T, :born, O}, |
Added a dispatch for PhysicalParameter and made some changes in the adjoint operator so that it returns a PhysicalParameter. Included space_offset() to support lsqr.