Mesh cannot run due to TypeError

,

Dear all,
my dolfinx.mesh cannot work even for the simplest unit interval mesh generation. Here is the code:

 from mpi4py import MPI
 import numpy as np
 import ufl
 from dolfinx import mesh
 comm = MPI.COMM_WORLD
 nx = 20
 msh = mesh.create_unit_interval(comm,nx)

and here is the error message:

Exception has occurred: TypeError
create_interval_float64(): incompatible function arguments. The following argument types are supported:
1. create_interval_float64(comm: MPICommWrapper, n: int, p: collections.abc.Sequence[float], ghost_mode: dolfinx.cpp.mesh.GhostMode, partitioner: collections.abc.Callable[[MPICommWrapper, int, collections.abc.Sequence[dolfinx.cpp.mesh.CellType], collections.abc.Sequence[numpy.ndarray[dtype=int64, writable=False]]], dolfinx.cpp.graph.AdjacencyList_int32] | None) → dolfinx.cpp.mesh.Mesh_float64

Invoked with types: Intracomm, int, list, dolfinx.cpp.mesh.GhostMode, NoneType
File “/home/yjin6/Work/FEnicsX demo/import ufl.py”, line 8, in
msh = mesh.create_unit_interval(comm,nx)
TypeError: create_interval_float64(): incompatible function arguments. The following argument types are supported:
1. create_interval_float64(comm: MPICommWrapper, n: int, p: collections.abc.Sequence[float], ghost_mode: dolfinx.cpp.mesh.GhostMode, partitioner: collections.abc.Callable[[MPICommWrapper, int, collections.abc.Sequence[dolfinx.cpp.mesh.CellType], collections.abc.Sequence[numpy.ndarray[dtype=int64, writable=False]]], dolfinx.cpp.graph.AdjacencyList_int32] | None) → dolfinx.cpp.mesh.Mesh_float64

Invoked with types: Intracomm, int, list, dolfinx.cpp.mesh.GhostMode, NoneType

I have tested my py4mpi that worked well. I am very confused which argument type is not accepted for the mesh generation.

Your code is correct, at least for v0.10. Could you provide the necessary details to understand your setup? Which version are you running, how did you install things, etc.

Hello Stein,
Thank you very much for your reply. Sorry about my silly question. I downloaded the main branch which is under development. When I installed the release version, I did not meet mesh issue anymore. I will close this question.

The code should still run on the main branch, but I guess you are mixing conda and installing from source?

Hello Dokken,

Thanks for your reply. I found the problem comes from the function handle difference due to multiple compiler (gcc/intel icx/gfort/intel ifx). That makes the _cpp class cannot figure out the argument transferring. I am still configuring the whole python interface including mpi4py\petsc4py\slepc4py and fenics .etc.