multiphenics / multiphenicsx

multiphenicsx - easy prototyping of multiphysics problems in FEniCSx
https://multiphenics.github.io/
GNU Lesser General Public License v3.0
39 stars 7 forks source link

Problem with complex version of petsc #23

Closed AlirezaSharif closed 5 months ago

AlirezaSharif commented 5 months ago

Hi,

I was trying to work with complex numbers in FEniCSx and multiphenicsx and to do so, installed the proper version using:

conda create -n env3-12 -c conda-forge python=3.12 fenics-dolfinx mpich

Then, I installed multiphenicsx by simply following the instructions here. However, I could not import multiphenicsx.fem while running my script and got this error:

error: 'full_extent' is not a member of 'std::experimental'; did you mean 'std::full_extent'?
  218 |       unrestricted_cell_dofs, c, std::experimental::full_extent);
      |                                                     ^~~~~~~~~~~
In file included from /env3-12-complex/include/dolfinx/fem/DofMap.h:13,
                 from/envs/env3-12-complex/lib/python3.12/site-packages/multiphenicsx/cpp/multiphenicsx/fem/DofMapRestriction.cpp:7:
/envs/env3-12-complex/include/basix/mdspan.hpp:1068:40: note: 'std::full_extent' declared here
 1068 | _MDSPAN_INLINE_VARIABLE constexpr auto full_extent = full_extent_t{ };
      |                                        ^~~~~~~~~~~
error: command '/envs/env3-12-complex/bin/x86_64-conda-linux-gnu-cc' failed with exit code 1

Can you help me how to resolve this issue?

francesco-ballarin commented 5 months ago

Hi, there are two sets of instructions in the page you linked. Which of the two did you follow?

francesco-ballarin commented 5 months ago

You may want to try and manually apply the change in https://github.com/multiphenics/multiphenicsx/commit/77f39fd8ddb71829edb16b2faf8f32f6a0b682bf to see if that solves the issue. Still, my gut feeling is that you are not following the correct installation instructions.

AlirezaSharif commented 5 months ago

Thank you Francesco for your quick reply. I used the instructions regarding Dolfinx release. I will try your other solution.

AlirezaSharif commented 5 months ago

Hi again, Uninstalling and installing again solved the problem. Thanks again @francesco-ballarin