Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples: free surface for coupled tti eqs #2173

Merged
merged 9 commits into from
Aug 9, 2023

Conversation

ofmla
Copy link
Contributor

@ofmla ofmla commented Jul 26, 2023

Add FS for TTI case taking advantage of the available structure (subdomain def in model.py, freesurface fctn with mirroring stuff, etc) created for the acoustic case. If I'm missing something, let me know.

@@ -90,7 +96,7 @@ def test_adjoint_F(self, mkey, shape, kernel, space_order, time_order, setup_fun
location from data. This test uses the conventional dot test:
< Fx, y> = <x, F^T y>
"""
tn = 500. # Final time
tn = 1000. if mkey[-3:] == "-fs" else 500. # Final time (twice the time for fs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the truth is that using 500. or 1000. doesn't make difference, the original value can be used.

@@ -155,7 +165,7 @@ def test_adjoint_J(self, mkey, shape, kernel, space_order, time_order, setup_fun
dot test:
< Jx, y> = <x ,J^T y>
"""
tn = 500. # Final time
tn = 1000. if mkey[-3:] == "-fs" else 500. # Final time (twice the time for fs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data in the linearized shot record is close to the end of the register time with very low values and that makes the values of the dot product be very low, that's why I increased the time, although it can be a lower value for example 750.

warning("Bad arguments in AnisotropicWaveSolver() - " +
"if model.fs is True, kernel should be centered. " +
"Switching to 'centered'")
self.kernel = 'centered'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should raise an error not change user set parameters

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will use raise ValueError then.

@mloubout mloubout added the examples examples label Jul 27, 2023
@@ -34,6 +34,10 @@ def __init__(self, model, geometry, space_order=4, kernel='centered',
self.geometry = geometry
self.kernel = kernel

if model.fs and kernel == 'staggered':
raise ValueError("Bad arguments in AnisotropicWaveSolver() - " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Free surface only supported for centered TTI kernel"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok


# Add free surface
if model.fs:
stencils.append(freesurface(model, Eq(unext, stencilp)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to recreate the eq, just freesurface(first_stencil)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

firs_stencil is defined with the "physdomain" subdomain, for that reason I used Eq again

@@ -27,6 +29,8 @@ class TestAdjoint(object):
('layers', (60, 70), 'OT2', 8, 2, acoustic_setup),
('layers', (60, 70), 'OT2', 4, 2, acoustic_setup),
('layers', (60, 70), 'OT4', 2, 2, acoustic_setup),
# 2D test with 2 layers and freesurface
('layers-fs', (200, 80), 'OT2', 4, 2, acoustic_setup),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We trying to avoid these "larger" sizes for CI as it increases the test time quite a bit, would prefer the standard sizes used with the other cases and keep the tn as it is

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're right , I'll keep the smaller sizes and 500. ms

@codecov
Copy link

codecov bot commented Aug 6, 2023

Codecov Report

Merging #2173 (4db0c98) into master (fde335d) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #2173   +/-   ##
=======================================
  Coverage   87.09%   87.10%           
=======================================
  Files         226      226           
  Lines       40175    40180    +5     
  Branches     7331     7332    +1     
=======================================
+ Hits        34990    34998    +8     
+ Misses       4605     4602    -3     
  Partials      580      580           
Files Changed Coverage Δ
examples/seismic/preset_models.py 64.11% <ø> (ø)
tests/test_adjoint.py 100.00% <ø> (ø)
examples/seismic/tti/operators.py 96.76% <100.00%> (+0.05%) ⬆️
examples/seismic/tti/wavesolver.py 90.00% <100.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

@mloubout mloubout merged commit 77d4e82 into devitocodes:master Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
examples examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants