Skip to content

Commit

Permalink
Merge pull request #222 from slimgroup/oob-rec-fix
Browse files Browse the repository at this point in the history
Fix #88, now skip oob recs since generated code skips then and output…
  • Loading branch information
mloubout authored Jan 23, 2024
2 parents eaec430 + 830829e commit a033abb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JUDI"
uuid = "f3b833dc-6b2e-5b9c-b940-873ed6319979"
authors = ["Philipp Witte, Mathias Louboutin"]
version = "3.3.9"
version = "3.3.10"

This comment has been minimized.

Copy link
@mloubout

mloubout Jan 23, 2024

Author Member

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
5 changes: 0 additions & 5 deletions src/TimeModeling/Modeling/time_modeling_serial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ function time_modeling(model_full::AbstractModel, srcGeometry::GeomOrNot, srcDat
modelPy = devito_model(model, options, dm)
end

# Remove receivers outside the modeling domain (otherwise leads to segmentation faults)
@juditime "Remove OOB src/rec" begin
recGeometry, recData = remove_out_of_bounds_receivers(recGeometry, recData, model)
end

# Devito interface
@juditime "Propagation" begin
argout = devito_interface(modelPy, srcGeometry, srcData, recGeometry, recData, dm, options, illum, fw)
Expand Down
2 changes: 2 additions & 0 deletions src/TimeModeling/Utils/auxiliaryFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ function remove_out_of_bounds_receivers(recGeometry::Geometry{T}, recData::Matri
if typeof(recGeometry.xloc[1]) <: Array
idx_xrec = findall(x -> xmax >= x >= xmin, recGeometry.xloc[1])
recGeometry.xloc[1] = recGeometry.xloc[1][idx_xrec]
length(recGeometry.yloc[1]) > 1 && (recGeometry.yloc[1] = recGeometry.yloc[1][idx_xrec])
recGeometry.zloc[1] = recGeometry.zloc[1][idx_xrec]
recData = recData[:, idx_xrec]
end
Expand All @@ -250,6 +251,7 @@ function remove_out_of_bounds_receivers(recGeometry::Geometry{T}, recData::Matri
if length(size(model)) == 3 && typeof(recGeometry.yloc[1]) <: Array
ymin, ymax = origin(model, 2), origin(model, 2) + (size(model, 2) - 1)*spacing(model, 2)
idx_yrec = findall(x -> ymax >= x >= ymin, recGeometry.yloc[1])
recGeometry.xloc[1] = recGeometry.xloc[1][idx_yrec]
recGeometry.yloc[1] = recGeometry.yloc[1][idx_yrec]
recGeometry.zloc[1] = recGeometry.zloc[1][idx_yrec]
recData = recData[:, idx_yrec]
Expand Down
2 changes: 1 addition & 1 deletion src/pysource/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def wavefield_subsampled(model, u, nt, t_sub, space_order=8):
if t_sub > 1:
time_subsampled = ConditionalDimension(name='t_sub', parent=model.grid.time_dim,
factor=t_sub)
nsave = nt // t_sub + 1
nsave = int(np.ceil((nt + t_sub)/t_sub))
else:
return None
wf_s = []
Expand Down

1 comment on commit a033abb

@JuliaRegistrator
Copy link

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/99386

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

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.10 -m "<description of version>" a033abba9a15faed9fde86660591219abcef04e7
git push origin v3.3.10

Please sign in to comment.