Ngsxfem installing issues

Hi Tale Bakken,

The release branch is only compatible with the April-NGsolve as you realised. The release branch is only synchronised every now and then. However, the master branch should be working with a recent ngsolve. Please try it out. A new release which is compatible with a recent NGSolve is on the ToDo list.

Best,
Christoph

Hi,
I got also an issue, after my Linux doing an autoupdate. I tried to re-make XFEM, but I got the following error:

/usr/include/netgen/matrix.hpp: In instantiation of ‘ngbla::Vec<H, decltype (ngstd::RemoveConst((mat(0, 0) * vec(0))))> ngbla::operator*(const ngbla::Mat<H, W, T1>&, const ngbla::Vec<W2, T2>&) [with int H = 1; int W = 1; int W2 = 3; T1 = double; T2 = double; decltype (ngstd::RemoveConst((mat(0, 0) * vec(0)))) = double]’:
/home/nepomuk/ngsxfem/cutint/straightcutrule.cpp:571:39: required from ‘void xintegration::TransformQuadUntrafoToIRInterface(const ngfem::IntegrationRule&, const ngfem::ElementTransformation&, const xintegration::LevelsetWrapper&, ngfem::IntegrationRule*, bool, double) [with unsigned int D = 1]’
/home/nepomuk/ngsxfem/cutint/straightcutrule.cpp:641:121: required from here
/usr/include/netgen/matrix.hpp:2247:21: error: static assertion failed: Mat * Vec dimension mismatch!
2247 | static_assert(W == W2, “Mat * Vec dimension mismatch!”);
| ^~~
/usr/include/netgen/matrix.hpp: In instantiation of ‘ngbla::Vec<H, decltype (ngstd::RemoveConst((mat(0, 0) * vec(0))))> ngbla::operator*(const ngbla::Mat<H, W, T1>&, const ngbla::Vec<W2, T2>&) [with int H = 2; int W = 2; int W2 = 3; T1 = double; T2 = double; decltype (ngstd::RemoveConst((mat(0, 0) * vec(0)))) = double]’:
/home/nepomuk/ngsxfem/cutint/straightcutrule.cpp:571:39: required from ‘void xintegration::TransformQuadUntrafoToIRInterface(const ngfem::IntegrationRule&, const ngfem::ElementTransformation&, const xintegration::LevelsetWrapper&, ngfem::IntegrationRule*, bool, double) [with unsigned int D = 2]’
/home/nepomuk/ngsxfem/cutint/straightcutrule.cpp:642:126: required from here
/usr/include/netgen/matrix.hpp:2247:21: error: static assertion failed: Mat * Vec dimension mismatch!

Is this also because of incompatible NGSolve and XFEM versions?

Thanks!
Nepomuk

Hi nepomuk,

Not unlikely that the version don’t match. Which versions are you combining?

Best,
Christoph

Hi Christoph,

I have the latets XFEM (just cloned, I hope its by default from the master branch?) and ngsolve 6.2.2007.

BR,
Nepomuk

Hi Christoph,

so now I have cloned the master branch, the error when making changed somehow…

In file included from /usr/share/ngsxfem/python/…/utils/python_utils.cpp:9,
from /usr/share/ngsxfem/python/python_ngsxfem.cpp:5:
/usr/share/ngsxfem/python/…/utils/…/utils/restrictedblf.hpp:29:25: error: conflicting return type specified for ‘virtual ngla::MatrixGraph ngcomp::RestrictedBilinearForm::GetGraph(int, bool)’
29 | virtual MatrixGraph GetGraph (int level, bool symmetric);
| ^~~~~~~~
In file included from /usr/include/netgen/comp.hpp:57,
from /usr/include/netgen/solve.hpp:19,
from /usr/share/ngsxfem/python/…/cutint/python_cutint.cpp:4,
from /usr/share/ngsxfem/python/python_ngsxfem.cpp:4:
/usr/include/netgen/bilinearform.hpp:202:27: note: overridden function is ‘virtual ngla::MatrixGraph* ngcomp::BilinearForm::GetGraph(int, bool)’
202 | virtual MatrixGraph * GetGraph (int level, bool symmetric);
| ^~~~~~~~

BR,
Nepomuk

Hi Nepomuk,

  • The default branch is ‘release’ rather than ‘master’
  • ngsxfem was updated to work with the then current master branch of ngsolve on the 7th August. I’m guessing that the difference in ngsolve was introduced between the 7th and the release of ngsolve v6.2.2007.

You can therefore go back a commit on the xfem master branch to 8fe562bfef4fb3478648dda9d1167247e511b329 which compiles with ngsolve v6.2.2007 or go to the latest master branches on both ngsolve and xfem which are also compatible.

Best wishes,
Henry

Hi Henry,

it worked. Thanks a lot!

Best regards,
Nepomuk

Hi all,

I am having issues installing xfem. I had ngsolve previously installed so to add the xfem module I simply did:

pip3 install xfem

in terminal. It says xfem version 2.0.2204 is successfully installed. When I try “import xfem” in a jupyter notebook, I receive the following error:ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xfem/ngsxfem_py.so, 2): Symbol not found: __ZNK6ngcomp14S_BilinearFormINSt3__17complexIdEEE17LapackEigenSystemERN5ngbla10FlatMatrixIS3_LNS5_8ORDERINGE1EEERN6ngcore9LocalHeapE
Referenced from: /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xfem/ngsxfem_py.so
Expected in: /Applications/Netgen.app/Contents/MacOS/libngcomp.dylib
in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/xfem/ngsxfem_py.so

Any suggestions on how to fix this? I’ve been stuck for days trying to get xfem to work.

Best,
Diana

Hi Diana,

which version of NGSolve do you have?

Best wishes,
Henry

Hi Henry,

I have netgen-mesher version 6.2.2301 and ngsolve version 6.2.2301 installed.

Best,
Diana

Could you please try, if the lates pre-release on pypi works? I.e.

pip install xfem==2.0.2204.post27.dev0

Best wishes, Henry

I still didn’t work. It says xfem is successfully installed but the same error message persists. Any other suggestions?

Thanks so much,
Diana

We’ll do a new pre release of xfem on pypi to be compatible with the current ngsolve release. I’ll let you know once that’s available.

Best wishes, Henry

Hi Henry,

Thank you so much! Let me know when the new release is ready.

All the best,
Diana

We’ve done a new mac release. Please try it with

pip install xfem==2.0.2204.post35.dev0

This should now be compatible with your ngsolve version.

Best wishes, Henry

Hi Henry,

I just tried installing the new xfem version and unfortunately the error still persists. Any other suggestions?

Best,
Diana

Hi Diana,

I don’t know why that error persists. The latest dev builds on pypi are built with ngsolve 6.2.2301 from pypi, so they should be compatible. Maybe try and remove ngsolve/netgen and xfem and try a fresh installation of everything. Otherwise, the fastest way to get xfem working would be to build it from source.

Best wishes,
Henry

Hi Diana,

one more suggestion: Remove your current xfem, ngsolve, netgen installations, install the ngsolve version compatible with the last stable release of xfem (pip install ngsolve==6.2.2204) and then install xfem (pip install xfem).

Hope this helps.

Best wishes,
Henry

Hi Henry,

Sorry for the late reply. Just wanted to say this worked! Thank you for your assistance :slight_smile:

Best,
Diana

Hi Henry,

I’m getting a new laptop setup with all of the required packages and now when I try “pip install ngsolve==6.2.2204” in terminal I get an error message that states:

ERROR: Could not find a version that satisfies the requirement ngsolve==6.2.2204 (from versions: none)ERROR: No matching distribution found for ngsolve==6.2.2204

What could be the reason for this? I’m afraid of installing a newer ngsolve version in case there’s compatibility issues with xfem (which I am yet to install on this new machine). I appreciate your help!

Best,
Diana