I have created my mesh using pygmsh with hex elements and it exits without error. I have also visually checked the mesh in paraview and happy with the result.
However, this is the following error i get when i try to read it in:
*** Error: Unable to order hexahedron cell.
*** Reason: Cell is not orderable.
*** Where: This error was encountered inside HexahedronCell.cpp.
*** Process: 0
when i used this command:
mesh = Mesh()
with XDMFFile("hex.xdmf") as infile:
infile.read(mesh)
The support for hexahedron cells in dolfin is quite limited, and require specific ordering of the cells in the mesh to be able to load it. This has been removed in dolfinx and there you can read in hexahedron meshes that are not ordered (for most Finite elements, see The issue tracker for info on current limitations.)
There’s some information on ordering quad/hex meshes in the papers: https://doi.org/10.1137/15M1021325 and https://doi.org/10.1145/3061708. This is much more involved than ordering a triangle/tetrahedron mesh, and isn’t implemented in (old) dolfin, but you could do this to your meshes to make them work.
In dolfinx, we’ve been working on permuting the DoF numbering on each element to avoid the need for ordered meshes. It currently works for continuous polynomial spaces, and other spaces are in development, as the issue tracker link in dokken’s reply says. You can run dolfinx using docker, which is much easier than installing from source; I’d recommend trying this before implementing hex reordering.
Running the following commands will launch a docker container from the current master branch of dolfinx:
docker pull quay.io/fenicsproject/dolfinx:real
docker run -ti --rm quay.io/fenicsproject/dolfinx:real
I use docker for windows and configured the interpreter in pycharm the same way as before in the fenics tutorials. This config worked fine.
Doing the same in dolfinx does not work.
In the docker for windows application I simply run the image.
The defined interpreter shows the versions. Is it this what you asked for?
My problem is, that the code already fails at “import dolfinx”
By the way, how doe fenicsx and dolfinx relate to eachother?
As I do not use windows (or pycharm), Im not sure how to proceed to help you.
fenicsx is just the collective term for all the packages (ufl, ffcx, basix, dolfinx) in the software.
In the old version of dolfin/fenics, it was an alias for importing from dolfin, i.e. from dolfin import * produced the same as from fenics import *.
In FEniCSx, we have kept the packages separately, so if you need anything from ufl you do from ufl import ..., as shown in The FEniCSx tutorial — FEniCSx tutorial
So the pycharm interpreter are at least listing the python packages (and it is therefore strange that it cannot import from the dolfinx one).
Could you specify how you have configured the pycharm interpreter?
Could you try to set the Python interpreter path to /usr/bin/python3, and then the enviroment should show Python Interpreter: Remote Python 3.9.5 Docker (dolfinx/dolfinx:latest) docker://dolfinx/dolfinx:latest/usr/bin/python3
Yes, this path is inside the docker environment. If you spawn the dolfinx/dolfinx docker image in a terminal, you can observe that: root@9cee74de15fc:~# ls /usr/local/dolfinx-real/lib/python3.8/dist-packages
produces: