# Error with my code

Hello guys i have this code

from fenics import *

# Material properties for VeroWhitePlus

E_vero = Constant(6e6) # Young’s modulus ¶
k_vero = Constant(0.14) # Thermal conductivity (W / (m K))
rho_vero = Constant(1050) # Density (kg/m^3)
Cp_vero = Constant(2300) # Specific heat (J / (kg K))
alpha_vero_values = [0, -1.3, -1.35, -1.4, -1.6] # Thermal expansion values for different temperatures
T_vero_values = [273, 300.15, 310, 320, 343.15] # Corresponding temperatures (K)
alpha_vero = Expression(“interp(x[0], x_vals, alpha_vals)”,
x_vals=T_vero_values, alpha_vals=alpha_vero_values, degree=1)

# Material properties for TangoBlackPlus

E_tango = Constant(3e6) # Young’s modulus ¶
k_tango = Constant(1.4) # Thermal conductivity (W / (m K))
rho_tango = Constant(1200) # Density (kg/m^3)
Cp_tango = Constant(1300) # Specific heat (J / (kg K))
alpha_tango_values = [0, -0.9, -1.2, -1.2, -1.3] # Thermal expansion values for different temperatures
T_tango_values = [273, 300.15, 310, 320, 343.15] # Corresponding temperatures (K)
alpha_tango = Expression(“interp(x[0], x_vals, alpha_vals)”,
x_vals=T_tango_values, alpha_vals=alpha_tango_values, degree=1)

# Define function spaces

mesh = BoxMesh(Point(0, 0, 0), Point(1, 1, 1), 10, 10, 10)
V = VectorFunctionSpace(mesh, ‘P’, 1)
T = FunctionSpace(mesh, ‘P’, 1)

# Define boundary condition

def boundary(x, on_boundary):
return on_boundary

bc = DirichletBC(V, Constant((0, 0, 0)), boundary)

# Define trial and test functions

u = TrialFunction(V)
v = TestFunction(V)
T = TrialFunction(T)
S = TestFunction(T)

u = Function(V)
T = Function(T)

# Define strain and stress tensors

def epsilon(u):

def sigma(E, alpha, T, T0, eps):
return Eeps + Ealpha*(T - T0)*Identity(len(u))

# Define initial temperature

T0 = Constant(273) # Initial temperature (K)

# Solve variational problem

solve(F == 0, u, bc)

# Output results

File(“displacement.pvd”) << u

i am recieving this error

Backup file exists, overwriting.
------------------- Start compiler output ------------------------
/tmp/tmp4puy8801/dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f.cpp: In member function ‘virtual void dolfin::dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f::eval(Eigen::Ref<Eigen::Matrix<double, -1, 1> >, Eigen::Ref<const Eigen::Matrix<double, -1, 1> >) const’:
/tmp/tmp4puy8801/dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f.cpp:61:36: error: ‘x_vals’ was not declared in this scope
61 | values[0] = interp(x[0], x_vals, alpha_vals);
| ^~~~~~
/tmp/tmp4puy8801/dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f.cpp:61:44: error: ‘alpha_vals’ was not declared in this scope
61 | values[0] = interp(x[0], x_vals, alpha_vals);
| ^~~~~~~~~~
/tmp/tmp4puy8801/dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f.cpp:61:23: error: ‘interp’ was not declared in this scope
61 | values[0] = interp(x[0], x_vals, alpha_vals);
| ^~~~~~

## ------------------- End compiler output ------------------------ Compilation failed! Sources, command, and errors have been written to: /home/hamza/jitfailure-dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f

DijitsoError Traceback (most recent call last)
File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/jit/jit.py:165, in compile_class(cpp_data, mpi_comm)
164 try:
→ 165 module, signature = dijitso_jit(cpp_data, module_name, params,
166 generate=cpp_data[‘jit_generate’],
167 mpi_comm=mpi_comm)
168 submodule = dijitso.extract_factory_function(module, “create_” + module_name)()

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/jit/jit.py:47, in mpi_jit_decorator..mpi_jit(*args, **kwargs)
46 if MPI.size(mpi_comm) == 1:
—> 47 return local_jit(*args, **kwargs)
49 # Default status (0 == ok, 1 == fail)

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/jit/jit.py:103, in dijitso_jit(*args, **kwargs)
101 @mpi_jit_decorator
102 def dijitso_jit(*args, **kwargs):
→ 103 return dijitso.jit(*args, **kwargs)

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dijitso/jit.py:216, in jit(jitable, name, params, generate, send, receive, wait)
214 if err_info:
215 # TODO: Parse output to find error(s) for better error messages
→ 216 raise DijitsoError(“Dijitso JIT compilation failed, see ‘%s’ for details”
217 % err_info[‘fail_dir’], err_info)
219 # Return built library and its signature

DijitsoError: Dijitso JIT compilation failed, see ‘/home/hamza/jitfailure-dolfin_expression_b2f642d4c69a83f93de7edaf0439c44f’ for details

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last)
Cell In[14], line 10
8 alpha_vero_values = [0, -1.3, -1.35, -1.4, -1.6] # Thermal expansion values for different temperatures
9 T_vero_values = [273, 300.15, 310, 320, 343.15] # Corresponding temperatures (K)
—> 10 alpha_vero = Expression(“interp(x[0], x_vals, alpha_vals)”,
11 x_vals=T_vero_values, alpha_vals=alpha_vero_values, degree=1)
13 # Material properties for TangoBlackPlus
14 E_tango = Constant(3e6) # Young’s modulus ¶

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/function/expression.py:400, in Expression.init(self, cpp_code, *args, **kwargs)
397 if not isinstance(k, str):
398 raise KeyError(“User parameter key must be a string”)
→ 400 self._cpp_object = jit.compile_expression(cpp_code, params)
401 self._parameters = ExpressionParameters(self._cpp_object, params)
403 if element and degree:

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/function/jit.py:158, in compile_expression(statements, properties)
154 mpi_comm = properties.pop(“mpi_comm”, MPI.comm_world)
155 cpp_data = {‘statements’: statements, ‘properties’: properties,
156 ‘name’: ‘expression’, ‘jit_generate’: jit_generate}
→ 158 expression = compile_class(cpp_data, mpi_comm=mpi_comm)
159 return expression

File ~/miniconda3/envs/fenics_env/lib/python3.12/site-packages/dolfin/jit/jit.py:170, in compile_class(cpp_data, mpi_comm)
168 submodule = dijitso.extract_factory_function(module, “create_” + module_name)()
169 except Exception:
→ 170 raise RuntimeError(“Unable to compile C++ code with dijitso”)
172 if name == ‘expression’:
173 python_object = cpp.function.make_dolfin_expression(submodule)

RuntimeError: Unable to compile C++ code with dijitso