Using expressions to define subdomains, RuntimeError: Unable to compile C++ code with dijitso

Hello,
I am trying to follow this link (https://fenicsproject.org/pub/tutorial/html/._ftut1013.html) in order to assign different values for the different subdomains. I want to create a hollow circle as below:

from dolfin import *
from mshr import *
domain = Circle(Point(0, 0), 1)
mesh = generate_mesh(domain, 64)
mu_0 = 0
mu_1 = 100
mu = Expression("(x[1])**2 + (x[0])**2 < 0.64 ? mu_0 : mu_1", mu_0 = mu_0, mu_1 = mu_1, degree=0)

However, I get the error: RuntimeError: Unable to compile C++ code with dijitso
Any help is much appreciated.

C++ does not implement the operator **. See for example pow - C++ Reference.

1 Like

Thank you so much for the help!