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.

Integral over product space

More
3 years 11 months ago - 3 years 11 months ago #2751 by philipp
Replied by philipp on topic Integral over product space
Hi,

that is exactly what I was expecting, thus the confusion.
The zip is attached. I kept all paths as in my configuration and
commented out a "fix" (namely explicitely binding CoefficientFunction)
that shouldn't be necessary.
To my further confusion, importing ngsolve in python doesn't help.

All the best,
Philipp
Last edit: 3 years 11 months ago by philipp.
More
3 years 11 months ago - 3 years 11 months ago #2753 by christopher
Hi, after commenting out your stuff in the CMakeLists.txt it worked for me.
Do you use a self compiled ngsolve or the installer?
Last edit: 3 years 11 months ago by christopher.
More
3 years 11 months ago - 3 years 11 months ago #2754 by philipp
Replied by philipp on topic Integral over product space
Do you mean the CoefficientFunction export? With this, it works for me too, but this should be done with the ngsolve import already, right? It was just a "dirty" fix of mine and was not part of the "mylittlengsolve" example.
I compiled my own version.
It is okay for me to export the ngsolve core classes manually. I just thought this might later cause problems since I got something wrong.
Last edit: 3 years 11 months ago by philipp.
More
3 years 11 months ago - 3 years 11 months ago #2755 by christopher
No, what I mean I just commented out the setting of the python executable with your hard paths and so (this should actually automatically be set correctly with the find_package(NGSolve))
You should only need this in your CMakeLists.txt:
Code:
project(mylittlengsolve) cmake_minimum_required(VERSION 3.1) find_package(NGSolve CONFIG REQUIRED HINTS path_to_ngsolve_dir) add_ngsolve_python_module(myngspy myngspy.cpp 1_myFEM/myCoefficient.cpp ) install(TARGETS myngspy DESTINATION .)

There should be no need to export any of the ngsolve core functionality
Last edit: 3 years 11 months ago by christopher.
More
3 years 11 months ago #2756 by philipp
Replied by philipp on topic Integral over product space
Ah, sorry. It's been a long day. You already stated that quite clearly.
I have to check this. I added the python paths
since my system is on python 3.8, but my ngsolve is based on python 3.7.
The python paths I specify are all correct (I just checked). Removing them causes me another error
Code:
terminate called after throwing an instance of 'pybind11::error_already_set' what(): SystemError: <built-in method __contains__ of dict object at 0x7fccec96fc80> returned a result with an error set Caught SIGABRT: usually caused by abort() or assert()
I think this is highly related to my setup and so I don't want to bother you with this anymore. Can you maybe just tell me what python path(s) would be responsible for the correct loading of the pybind11 code for the ngsolve internal classes?

Thank you very much for your time!
Philipp
More
3 years 11 months ago #2757 by christopher
If you use python 3.8 you should build ngsolve against 3.8 as well, since ngsolve/pybind needs to link against the correct python libraries.
I guess you have 2 python versions around and ngsolve and your module find different ones which messes everything up ;)
The following user(s) said Thank You: philipp
Time to create page: 0.117 seconds