Cahn-Hilliard - Where is basix.ufl?

Hello,

I am trying to learn FENICSX with the Cahn-Hilliard equation example at Cahn-Hilliard equation — DOLFINx 0.7.0.0 documentation.

The script imports basix.ufl which doesn’t seem to exist.

I have tried to run it on a linux machine with fenicsx installed and a docker image of the lastest fenicsx.

What could I do, please?

Thanks

What version of DOLFINx are you running? The module basix.ufl was introduced after the v0.6.0 release.

Hello,

Here are the fenics packages that I am running:

fenics-basix 0.5.1
fenics-dijitso 2019.2.0.dev0
fenics-dolfin 2019.2.0.dev0
fenics-dolfinx 0.5.2
fenics-ffc 2019.2.0.dev0
fenics-ffcx 0.5.0
fenics-fiat 2019.2.0.dev0
fenics-ufl 2022.2.0

It appears I have dolfinx 0.5.2. How may I upgrade it, please?

P/S: I installed fenicsx using “apt install fenicsx”

The 0.6.0 release is not on apt yet. If you want to use the 0.5.1 release, look at the corresponding docs
https://docs.fenicsproject.org/dolfinx/v0.5.1/python/demos/demo_cahn-hilliard.html

Thank you very much!

Dear dokken,

I installed dolfinx v0.6.0 using conda. However, I still got the same error when I used from basix.ufl import element. Where did I go wrong?

Here are the fenics packages:

fenics-basix 0.6.0
fenics-basix-pybind11-abi 0.4.12
fenics-dolfinx 0.6.0
fenics-ffcx 0.6.0
fenics-libbasix 0.6.0
fenics-libdolfinx 0.6.0
fenics-ufcx 0.6.0
fenics-ufl 2023.1.1

I assume you are looking at demos for the main branch. You have v0.6.0 installed, Where the API is slightly different, see: https://github.com/FEniCS/basix/pull/655
for details and
DOLFINx documentation — DOLFINx 0.6.0 documentation and
Basix Python interface documentation — Basix 0.6.0 documentation
for the docs for 0.6.0