-
Notifications
You must be signed in to change notification settings - Fork 47
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
save time snapshots #29
Comments
Hello,
To store the entire wavefield I normally recommend putting a receiver in
every cell. This will record the wavefield at each timestep of the source,
which is usually fine for 2D, but for 3D it is probably not feasible as you
will likely run out of memory. The only way around that, I think, would be
to call the compiled propagator directly (as in
https://github.com/ar4/deepwave/blob/9142ecaad9f7ce42f7257321eb0ccb111935f2fc/deepwave/scalar/scalar.py#L125),
as the memory used to store the wavefield is the first argument. It's
likely to be a bit messy, but if you want to do that I can try to help if
you need it.
I should also note that I am not completely sure that the absorbing
boundaries work correctly in 3D. I only ever use the 2D propagator, so I
haven't tested the 3D one enough to be confident.
|
Thank you so much. I would like to help with testing 3D boundary conditions and maybe improving that piece of this code. |
I have written some code to call the compiled propagator directly so that we can access the wavefields at arbitrary time steps:
It is a bit hacky - it runs the setup for a regular propagator and then extracts the variables that are passed to the forward method of the propagator. It then uses these to run all of the code in the usual forward propagator up to the point where the compiled propagator gets called, and saves the arguments to this so that they can be used when you actually want to run forward time steps of the propagator. The benefit of doing all of this setup is that the actual stepping part is then quite easy - we just get the right bits of the source wavelet for the desired steps, run the compiled propagator, and then swap some memory around if necessary to make sure it is in the right place. Here is an example of how to use it:
The CPU implementation of propagation in 3D is here. If I remember correctly, I used the same PML as PySIT. |
Thank you so much for getting me started. I will update you on my progess |
The code fails with the following error |
Did you get this error while running the example code that I provided? I
have tried it on two systems and on both it ran correctly.
|
Yes I ran your code as it is. I even tried to update deepwave, I have the
latest version. Thank you.
…On Fri, Aug 27, 2021, 3:53 AM Alan Richardson ***@***.***> wrote:
Did you get this error while running the example code that I provided? I
have tried it on two systems and on both it ran correctly.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#29 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAYL3H4UYTGIIKUNHKR6QILT65ODJANCNFSM5CNDGUWA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Very strange! Here is a notebook where I ran the code:
https://colab.research.google.com/drive/1Ba1nTfp7uwyvM4GEr_ei1F9lrk1z0GfS?usp=sharing
If you are able to download that notebook, can you try running it on your
system just to be absolutely certain that we run the same code but get
different results?
Which version of PyTorch are you using?
|
From the message that you got, it sounds like your version of PyTorch is complaining about some of the return values from the forward function in SteppingPropagatorFunction not being Tensors. Perhaps you could try this version of the code instead:
The example code to run the propagator should be the same. |
This code works. Thank you so much. I will keep you posted. |
Is there a way to store time snapshots of 3D wavefield at given time intervals for visualization?
The text was updated successfully, but these errors were encountered: