thanospol / DIRECTFN

GNU General Public License v3.0
6 stars 4 forks source link

Complex wave numbers #1

Open shash-sharma opened 5 years ago

shash-sharma commented 5 years ago

Hello, I've been experimenting with DIRECTFN, and I was wondering if you've considered the case of complex wave numbers? I was able to modify your code so that "set_wavenumber" accepts complex arguments, and it compiles fine. But I'm not sure if the results would be correct.

If so, do you think that the code would work correctly for very large wave numbers (e.g. lossy conductors)?

Thanks.

tambova commented 5 years ago

Hello, The algorithm would work for any kernel function ~1/R^p, where p = 1 for the case of coincident elements and p = 1,2 for the case of edge adjacent or vertex adjacent elements. So, for example, for the scalar Green function exp(-i k R)/R, using the complex wavenumber k = a + i b would just mean multiplication by exp(-b R) = O(1) when R -> 0. So it wouldn't change the asymptotic behavior of the original kernel and DIRECTFN would work, in particular, for very large wavenumbers.

P.S. I have modified the code a bit to allow using custom kernel functions. If you need, you may just go to the end of file directfn_greenfunc.cpp and modify the User_GreenFunc class. (from line 145). Finally, you should go to the file directfn_kernel_base.cpp and change the line 18 (up_greenfunc(nullptr)), to up_greenfunc(new User_GreenFunc()), and that's it.

Best, Alexandra

shash-sharma commented 5 years ago

Great, thank you!