Menu

Python functions as NGSpy coefficients

2016-12-29
2017-01-04
  • Jay Gopalakrishnan

    This is motivated by/related to Sofi’s question https://sourceforge.net/p/ngsolve/discussion/ngs-py/thread/65164235/ today (but I’m starting a new thread since its not exactly the same question).

    Isn’t it a good idea to have an NGSpy mechanism in place to use the special function facilities in python (eg., from the scipy.special module)?

    Attached is a small example code to clarify what I mean and achieve this goal. If there are potential problems with this approach, please let me know and please suggest any improvements.

    • Jay
     
    • Jay Gopalakrishnan

      Hopefully the c++ code is now attached.
      In python, I use it like so:

      from fun2ngs import *
      from ngsolve import *
      import scipy.special as scf

      besselj0 = lambda zeta : scf.jv(0,zeta)
      besselj0_z = NGSpyCoefficient(besselj0, x+1j*y )

       
  • Sofi Esterhazy

    Sofi Esterhazy - 2017-01-04

    Hi Jay!!

    Sorry I only saw your post right now!
    If I could include the boost bessel function, I would prefer that of course. But I thought the boost library was not included anymore since many things got replaced by pybind11 now..?
    Joachim send me also the link to new blog in the other thread, so I will try to continue from there.

    Best, Sofi

     

Anonymous
Anonymous

Add attachments
Cancel