NDF-Poli-USP / spyro

Wave propagators for seismic domains with application to full waveform inversion.
GNU General Public License v3.0
34 stars 15 forks source link

"p, p_r = spyro.solvers.forward(model, mesh, comm, vp, sources, wavelet, receivers)" raises AssertionError #99

Open jinshanmu opened 6 months ago

jinshanmu commented 6 months ago

Hi, I have the same problem running the demo script, including the examples from the paper.

Traceback (most recent call last): File "/home/firedrake/spyro/paper/run_2d/run_forward_2d.py", line 66, in p, p_r = spyro.solvers.forward(model, mesh, comm, vp, sources, wavelet, receivers) File "/home/firedrake/spyro/spyro/io/io.py", line 112, in wrapper u, u_r = func(*args, **dict(kwargs, source_num=snum)) File "/home/firedrake/spyro/spyro/solvers/forward.py", line 252, in forward assembly_callable() File "/home/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 680, in assemble self._as_pyop2_type(self._tensor).zero() File "/home/firedrake/firedrake/src/firedrake/firedrake/assemble.py", line 808, in _as_pyop2_type raise AssertionError AssertionError

I have successfully installed the latest version of Firedrake. I don't understand why this error pops up. Thank you so much.

Olender commented 6 months ago

That is strange. Thanks for pointing out this error! Next week, I will install the latest Firedrake and try to reproduce it. Our assembly_callable() implementation on the main branch uses a deprecated Firedrake feature, and the error probably comes from that. Since it has been a while since a branch was merged with the main our CI tests didn't catch it.

There is currently a fork (https://github.com/Olender/spyro-1/tree/main), which is a refactoring of the code that no longer uses this method. If you need to use the code earlier than next week, please feel free to use that. However, not all of Spyro's features regarding the inversion problem are currently supported on that fork.

This error probably has a very quick fix of just commenting out the assemblycallable() in line 246 of the forward method and substituting it in line 252 for "B = assemble(rhs, tensor=B)".

jinshanmu commented 6 months ago

This error probably has a very quick fix of just commenting out the assemblycallable() in line 246 of the forward method and substituting it in line 252 for "B = assemble(rhs, tensor=B)".

I'll try this quick fix while waiting for the update. Thanks!

jinshanmu commented 6 months ago

This error probably has a very quick fix of just commenting out the assemblycallable() in line 246 of the forward method and substituting it in line 252 for "B = assemble(rhs, tensor=B)".

I'll try this quick fix while waiting for the update. Thanks!

I tried the fix on the forward demo and it worked. Great!