You are correct about those… So far after correcting both thos problems, if I run Python in debug mode there is no difficulty loading the mesh from the beam.msh file:
from dolfinx.io import gmshio
from mpi4py import MPI
from dolfinx.mesh import create_mesh
# Initialize MPI
comm = MPI.COMM_WORLD
# Path to the .msh file
msh_filename = "beam.msh"
mesh = gmshio.read_from_msh(msh_filename, comm)
There does seem to be a difficulty if I use the regular run mode of Python I get this traceback:
Info : Reading 'beam.msh'...
Info : 27 entities
Info : 48 nodes
Info : 57 elements
Info : Done reading 'beam.msh'
Entities: [(0, 1), (0, 2), (0, 3), (0, 4), (0, 5), (0, 6), (0, 7), (0, 8), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9), (1, 10), (1, 11), (1, 12), (2, 1), (2, 2), (2, 3), (2, 4), (2, 5), (2, 6), (3, 1)]
Nodes: 48
Elements: 46
Traceback (most recent call last):
File "/home/prusso/dolfinx-demo/main2.py", line 1, in <module>
from dolfinx.io import gmshio
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/dolfinx/__init__.py", line 13, in <module>
from petsc4py import PETSc as _PETSc
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/PETSc.py", line 4, in <module>
PETSc = ImportPETSc(ARCH)
^^^^^^^^^^^^^^^^^
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/lib/__init__.py", line 30, in ImportPETSc
return Import('petsc4py', 'PETSc', path, arch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/lib/__init__.py", line 97, in Import
module = import_module(pkg, name, path, arch)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/petsc4py/lib/__init__.py", line 76, in import_module
spec.loader.exec_module(module)
File "petsc4py/PETSc.pyx", line 1, in init petsc4py.PETSc
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/numpy/__init__.py", line 159, in <module>
from . import ma
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/numpy/ma/__init__.py", line 42, in <module>
from . import core
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/numpy/ma/core.py", line 7940, in <module>
inner.__doc__ = doc_note(np.inner.__doc__,
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/prusso/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.11/site-packages/numpy/ma/core.py", line 125, in doc_note
notesplit = re.split(r'\n\s*?Notes\n\s*?-----', inspect.cleandoc(initialdoc))
^^^^^^^^^^^^^^^^
AttributeError: module 'inspect' has no attribute 'cleandoc'
Is there a way to get this traceback to resolve?