looked at the source code
Sorry for disturbing. When I looked at the source code, I found that I could not find the code shown in the image. And I have modified the form of the source wave equation. Do you think this idea can be realized?
It is not a disturbance. Thank you for your question.
The C and CUDA code in Deepwave is compiled to produce those files. If I understand correctly, you downloaded the Deepwave code from GitHub, modified it, and are now trying to run it. If that is correct, then you will need to also compile the C and (if you want to run on a GPU) CUDA files. Do you feel comfortable doing that? Are you running on Linux, Windows, or MacOS?
I looked in the pytorch package and found this, but I couldn't find the exact location. I want to change the expression of the wave equation, add some pseudo-spectral operation, I wonder whether it is feasible?
Ah, I see. You have not yet modified Deepwave; you wish to modify it to change the way that the wave equation is implemented. I do not have experience with pseudo-spectral methods, so I am not sure what is needed, but if your question is where the wave equation is implemented in Deepwave, you can find the C implementation of the scalar wave equation in the file https://github.com/ar4/deepwave/blob/master/src/deepwave/scalar.c . The forward wave equation, in particular, is here: https://github.com/ar4/deepwave/blob/53862031102ee759388700e77b57dd13c1729ba9/src/deepwave/scalar.c#L83 . It is currently a standard finite difference implementation (see the last line in that function), but looks a little bit complicated because of the PML to add absorbing boundaries.
I installed it with pip install deepwave. In previous versions of deeowave you can see these C code implementation, why in the latest version of pytorch deepwave package there is no C code,
Previous versions of Deepwave compiled the C/CUDA code on your computer when you installed Deepwave. That unfortunately caused problems for some users, so I switched to a different approach where I compile the C/CUDA code and only distribute the compiled libraries so that users do not have to compile it themselves. It seems to have been successful as I now rarely receive reports of difficulty installing Deepwave. If you wish to modify the C/CUDA code yourself, you can download the code from GitHub (such as by downloading https://github.com/ar4/deepwave/archive/refs/heads/master.zip), modify it, and then compile it (which I can help you with).
Ok, I have roughly understood your meaning, thank you for your reply
Good, but just to be sure, I will try to explain it again.
Most people just want to install Deepwave and use it, without modifying Deepwave's code. They can use pip to install it. So that the C/CUDA code does not need to be compiled on their computer (which sometimes causes problems), pip downloads already compiled libraries of the C/CUDA code. It therefore does not need the C/CUDA code itself.
If you wish to modify the C/CUDA code, you need the C/CUDA code, not the
already compiled libraries of it. Therefore instead of running pip install deepwave, you will need to download the code (which includes the C/CUDA
code) from GitHub. You can then modify it and compile it yourself.
I hope this Issue is resolved, so I am going to close it. Please feel free to reopen it if you have further questions about this.