Cannot follow fenicsx tutorial:

This one has to be changed to L= ufl.inner(f, v) * ufl.dx

1 Like

@raboynics So I’ve been looking at your issue with complex mode being default. Could you:

  1. Open the notebook
  2. Go to “Kernel->Change Kernel” and choose “Python3 (ipykernel)”
1 Like

Good catch @dokken, that was indeed the culprit. Now I remember, the first time I ran the command for the Jupyter notebook, I picked the kernel that had “DOLFIN” in it, without realizing it would pick the complex version of it. The Python 3 (ipykernel) didn’t have “dolfin” in its name.

Anyway, even with the wrong (complex) version, I used your tip to quick fix the commands and I could go through the Poisson and membrane parts of the tutorial without any other problem.

I’m in the process of adding some complex problems to the tutorial (and making sure that the default behavior is to launch the real mode kernel).

1 Like

Hey @dokken, I get an error for the magnetic field part of the tutorial.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Input In [7], in <cell line: 14>()
     13 J.x.array[:] = 0
     14 for tag in material_tags:
---> 15     cells = ct.find(tag)
     16     # Set values for mu
     17     if tag == 0:

AttributeError: 'dolfinx.cpp.mesh.MeshTags_int32' object has no attribute 'find'

I recently updated the code to work with complex Numbers, and had to bump the version of dolfinx past the last release 0.4.1. To find the notebooks for the previous version (0.4.0) see: GitHub - jorgensd/dolfinx-tutorial at v0.4.0

2 Likes