jorgensd / dolfinx-tutorial

A reimplementation of the Springer book: https://github.com/hplgit/fenics-tutorial/, covering new topics as well as transitioning from dolfin to dolfinx
https://jorgensd.github.io/dolfinx-tutorial/
103 stars 60 forks source link

Issue on page /chapter2/linearelasticity_code.html #63

Closed Wendi-L closed 2 years ago

Wendi-L commented 2 years ago

I have the following error when running the test case:

Traceback (most recent call last): File ".py", line 16, in from dolfinx.mesh import CellType, create_box, locate_entities_boundary ImportError: cannot import name 'CellType' from 'dolfinx.mesh' (/spack/var/spack/environments/fenicsx-env/.spack-env/view/lib/python3.9/site-packages/dolfinx/mesh.py)

I have also tried "from dolfinx import *" instead, but it stuck again as follows: Traceback (most recent call last): File "***.py", line 18, in mesh = create_box(MPI.COMM_WORLD, [np.array([0,0,0]), np.array([L, W, W])], NameError: name 'create_box' is not defined

The version of code I am using is FEniCSX/dolfinX-0.3.0

jorgensd commented 2 years ago

The tutorial is compatible with the commit shown on the webpage; DOLFINx version: 0.3.1.0 based on GIT commit: c472d1d95e49031c73aa3c8d16e066c965ef861f of https://github.com/FEniCS/dolfinx/

To get a compatible version with 0.3.0, see: https://github.com/jorgensd/dolfinx-tutorial/releases/tag/v0.3.0