Forum Message

 

 

We have moved the forum to https://forum.ngsolve.org . This is an archived version of the topics until 05/05/23. All the topics were moved to the new forum and conversations can be continued there. This forum is just kept as legacy to not invalidate old links. If you want to continue a conversation just look for the topic in the new forum.

Notice

The forum is in read only mode.

Exporting mathematical functions

More
6 years 6 months ago #189 by Guosheng Fu
Hello,

I used Joachim's trick
ngsolve.sourceforge.io/index.php/blog/ng...thematical-functions
to import the Bessel functions before, but it stopped working after I upgraded NGsolve to the newest version.

I got the following warning:
warning: ‘PyObject* pybind11_init()’ is deprecated: PYBIND11_PLUGIN is deprecated, use PYBIND11_MODULE [-Wdeprecated-declarations]
return pybind11_init();
when building the myfunctions.so library.

And got import error when trying to import function from myfunctions.so:
undefined symbol: _ZN5ngfem20ExportUnaryFunction2ERN8pybind116moduleESsSt8functionIFSt10shared_ptrINS_19CoefficientFunctionEES6_EES3_IFddEES3_IFSt7complexIdESC_EE

Any idea what might be wrong?

Best,
Guosheng
More
6 years 6 months ago #190 by joachim
Hi Guosheng,

have a look into the github project:
github.com/NGSolve/ngs-special-functions

It's work in progress, its aim is to provide the 1400 special functions from slatec (including complex Bessels).

You can find the new pybind syntax there,

Joachim
More
6 years 6 months ago #191 by Guosheng Fu
Hi Joachim,

This is great! Compiled and succeed.
The function structure looks easy to generalize.
It seems a very recent project and you have 1398 functions to go ;)

Thanks for the quick response!

Best,
Guosheng
More
6 years 6 months ago - 6 years 6 months ago #192 by christopher
Hi Guosheng,
maybe you want to try the cpp17 branch there. You need a compiler with c++17 support, but then you can easily export more functions from there (or from boost.math.special_functions, we started a branch for that too).
In this branch we changed the naming of the functions to be like it is in scipy.special

Best
Christopher
Last edit: 6 years 6 months ago by christopher.
Time to create page: 0.158 seconds