Closed kgullikson88 closed 2 months ago
You are indexing u
with the wrong time dimension. You create u
as save=nt
so its time dimension is time
(grid.time_dim
) not t
(grid.stepping_dim
). By using the wrong time dimension it is breaking the time loop due to mismatch.
If you replace your bc by bc = [Eq(u[time+1,x,0], u[time+1,x,1])]
then it works fine
Huh, that does work but now I get a similar error if I do not save. What is the conceptual difference between grid.time_dim
and grid.stepping_dim
? Do I just need to know if I am saving the wavefield to know which thing to use?
You just need to always use the dimension of u
which you can easily do by using some of the API tools such as using u.forward._subs(y, 0)
rather than u[time+1,x, 0]
as it will always be the correct dimension, or getting the dimension from u
i.e ut = u.dimensions[0]
then do u[ut+1, ...]
Ah, that works. Thanks for the help and the prompt reply!
I am trying to use hybrid boundary conditions while saving the forward wavefield. I found the reference notebook for these boundary conditions here, and updated in two ways:
save=time_range.num
op(time=nt-1,dt=dt0)
However, this now produces compilation errors as shown below:
I tracked it down to the free surface boundary conditions, defined below:
If I exclude those from the operator definition, it works. Is indexing like this not allowed when saving the wavefield? Is there a different way to implement the corners?
I've also attached the full notebook I used, for reference/reproducibility.
habc_with_save (1).ipynb.zip