"Unable to compile C++ code with dijitso" error encountered when trying to simulate flow around an airfoil

Hi everyone,

I am currently trying to run a piece of code in FeniCS 2019.1.0, but I keep getting an error message reading

---------------------------------------------------------------------------
DijitsoError                              Traceback (most recent call last)
File ~/anaconda3/envs/fenics1/lib/python3.8/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 ~/anaconda3/envs/fenics1/lib/python3.8/site-packages/dolfin/jit/jit.py:47, in mpi_jit_decorator.<locals>.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 ~/anaconda3/envs/fenics1/lib/python3.8/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 ~/anaconda3/envs/fenics1/lib/python3.8/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/kaiyuli/Downloads/jitfailure-dolfin_expression_331bf9c60ce95861b00a87db9a76ddcb' for details

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
Cell In[13], line 1
----> 1 env=Env2dAirfoil()
      2 env.evolve(0,0)

Cell In[12], line 102, in Env2dAirfoil.__init__(self)
     85 self.inflow_f=Expression(self.inflow_profile,U_m=Constant(0.45),D=Constant(1),degree=2)
     88 # Jet profile. Jet1 is at the top of the cylinder, and Jet2 is at the bottom of the cylinder.
     89 #"radius" here refers to the chord length of the airfoil.
     90 # self.jet1_f=Expression(('cos(atan2(1/(0.6*(-0.406*pow(x[0]/cos(attack_angle),3)+0.8529*pow(x[0]/cos(attack_angle),2)-0.7152*x[0]/cos(attack_angle)-0.1221+0.14845*pow(x[0]/cos(attack_angle),-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
   (...)
     99 #                    'sin(atan2(1/(0.6*(-0.406*pow(x[0]/cos(attack_angle),3)+0.8529*pow(x[0]/cos(attack_angle),2)-0.7152*x[0]/cos(attack_angle)-0.1221+0.14845*pow(x[0]/cos(attack_angle),-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
    100 #                     Qjet=1,width=0.01,attack_angle=0,x_center=0.6,radius=Constant(1),degree=2)
--> 102 self.jet1_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
    103                    'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
    104                     Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)
    107 self.jet2_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
    108                    'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
    109                     Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)
    111 self.jet1_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
    112                    'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
    113                     Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)

File ~/anaconda3/envs/fenics1/lib/python3.8/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 ~/anaconda3/envs/fenics1/lib/python3.8/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 ~/anaconda3/envs/fenics1/lib/python3.8/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

And this is the part of the code that triggers the error, which is for setting boundary conditions for jets set on the upper surface of a 2D airfoil.

        self.jet1_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
                           'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
                            Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)

        
        self.jet2_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
                           'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
                            Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)

        self.jet1_f=Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))',\
                           'sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),\
                            Qjet=1,width=0.01,attack_angle=0,x_center=0.2,radius=Constant(1),degree=2)

        #Adjust the parameters in the Expressions for the jets according to the initial settings.
        self.jet1_f.width = self.jet_width_rate
        self.jet2_f.width = self.jet_width_rate
        self.jet3_f.width = self.jet_width_rate

        self.jet1_f.attack_angle = self.attack_angle
        self.jet2_f.attack_angle = self.attack_angle
        self.jet3_f.attack_angle = self.attack_angle

        self.jet1_f.x_center = self.jet1_location
        self.jet2_f.x_center = self.jet2_location
        self.jet3_f.x_center = self.jet3_location
        

Since I have spent a lot of time on this error, I would be more than grateful if anyone can tell me what is wrong in my code! Many thanks in advance!!!

Note that you should provide a minimal reproduce example, plus the whole error stack, i.e.

import dolfin
fx = dolfin.Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))','sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),
                            Qjet=1.,width=0.01,attack_angle=0.,x_center=0.2,radius=dolfin.Constant(1),degree=2)

gives

src: /root/shared/jitfailure-dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4/error.log.fa016b4c1d454115a8c1ce5e0aa0d825
dst: /root/shared/jitfailure-dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4/error.log
backup: /root/shared/jitfailure-dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4/error.log.old
Backup file exists, overwriting.
------------------- Start compiler output ------------------------
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp: In member function ‘virtual void dolfin::dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4::eval(Eigen::Ref<Eigen::Matrix<double, -1, 1> >, Eigen::Ref<const Eigen::Matrix<double, -1, 1> >) const’:
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:68:32: error: no matching function for call to ‘atan2(double)’
   68 |           values[0] = cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2));
      |                           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc_geometry.h:9,
                 from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc.h:22,
                 from /usr/local/include/dolfin/function/Expression.h:25,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/c++/11/cmath:155:5: note: candidate: ‘template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::atan2(_Tp, _Up)’
  155 |     atan2(_Tp __y, _Up __x)
      |     ^~~~~
/usr/include/c++/11/cmath:155:5: note:   template argument deduction/substitution failed:
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:68:32: note:   candidate expects 2 arguments, 1 provided
   68 |           values[0] = cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2));
      |                           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/bits/stl_algobase.h:59,
                 from /usr/include/c++/11/vector:60,
                 from /usr/local/include/dolfin/function/Expression.h:24,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note: candidate: ‘double atan2(double, double)’
   59 | __MATHCALL_VEC (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc_geometry.h:9,
                 from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc.h:22,
                 from /usr/local/include/dolfin/function/Expression.h:25,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/c++/11/cmath:148:3: note: candidate: ‘constexpr long double std::atan2(long double, long double)’
  148 |   atan2(long double __y, long double __x)
      |   ^~~~~
/usr/include/c++/11/cmath:148:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/11/cmath:144:3: note: candidate: ‘constexpr float std::atan2(float, float)’
  144 |   atan2(float __y, float __x)
      |   ^~~~~
/usr/include/c++/11/cmath:144:3: note:   candidate expects 2 arguments, 1 provided
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:69:32: error: no matching function for call to ‘atan2(double)’
   69 |           values[1] = sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2));
      |                           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc_geometry.h:9,
                 from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc.h:22,
                 from /usr/local/include/dolfin/function/Expression.h:25,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/c++/11/cmath:155:5: note: candidate: ‘template<class _Tp, class _Up> constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type std::atan2(_Tp, _Up)’
  155 |     atan2(_Tp __y, _Up __x)
      |     ^~~~~
/usr/include/c++/11/cmath:155:5: note:   template argument deduction/substitution failed:
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:69:32: note:   candidate expects 2 arguments, 1 provided
   69 |           values[1] = sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2));
      |                           ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/features.h:486,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/os_defines.h:39,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/c++config.h:586,
                 from /usr/include/c++/11/bits/stl_algobase.h:59,
                 from /usr/include/c++/11/vector:60,
                 from /usr/local/include/dolfin/function/Expression.h:24,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note: candidate: ‘double atan2(double, double)’
   59 | __MATHCALL_VEC (atan2,, (_Mdouble_ __y, _Mdouble_ __x));
      | ^~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:59:1: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc_geometry.h:9,
                 from /usr/lib/python3/dist-packages/ffc/backends/ufc/ufc.h:22,
                 from /usr/local/include/dolfin/function/Expression.h:25,
                 from /tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:13:
/usr/include/c++/11/cmath:148:3: note: candidate: ‘constexpr long double std::atan2(long double, long double)’
  148 |   atan2(long double __y, long double __x)
      |   ^~~~~
/usr/include/c++/11/cmath:148:3: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/11/cmath:144:3: note: candidate: ‘constexpr float std::atan2(float, float)’
  144 |   atan2(float __y, float __x)
      |   ^~~~~
/usr/include/c++/11/cmath:144:3: note:   candidate expects 2 arguments, 1 provided
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp: In member function ‘virtual double dolfin::dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4::get_property(std::string) const’:
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:81:11: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
   81 |           if (name == "Qjet") return Qjet;          if (name == "width") return width;          if (name == "attack_angle") return attack_angle;          if (name == "x_center") return x_center;
      |           ^~
/tmp/tmp6g4q3f98/dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4.cpp:81:53: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   81 |           if (name == "Qjet") return Qjet;          if (name == "width") return width;          if (name == "attack_angle") return attack_angle;          if (name == "x_center") return x_center;
      |                                                     ^~

-------------------  End compiler output  ------------------------
Compilation failed! Sources, command, and errors have been written to: /root/shared/jitfailure-dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dolfin/jit/jit.py", line 165, in compile_class
    module, signature = dijitso_jit(cpp_data, module_name, params,
  File "/usr/lib/python3/dist-packages/dolfin/jit/jit.py", line 47, in mpi_jit
    return local_jit(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/dolfin/jit/jit.py", line 103, in dijitso_jit
    return dijitso.jit(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/dijitso/jit.py", line 216, in jit
    raise DijitsoError("Dijitso JIT compilation failed, see '%s' for details"
dijitso.jit.DijitsoError: Dijitso JIT compilation failed, see '/root/shared/jitfailure-dolfin_expression_6f0f4cf36c9657f8a5a8a29b6a6f1ec4' for details

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/root/shared/mwe_ditji.py", line 5, in <module>
    fx = dolfin.Expression(('cos(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))','sin(atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))-attack_angle)*cos((x[0]-x_center)/(width*cos(attack_angle)))*Qjet*pi/(2*width*pow(radius,2))'),
  File "/usr/lib/python3/dist-packages/dolfin/function/expression.py", line 400, in __init__
    self._cpp_object = jit.compile_expression(cpp_code, params)
  File "/usr/lib/python3/dist-packages/dolfin/function/jit.py", line 158, in compile_expression
    expression = compile_class(cpp_data, mpi_comm=mpi_comm)
  File "/usr/lib/python3/dist-packages/dolfin/jit/jit.py", line 170, in compile_class
    raise RuntimeError("Unable to compile C++ code with dijitso")
RuntimeError: Unable to compile C++ code with dijitso

which points to atan2 being the issue.
You can reduce your problem to:

fx = dolfin.Expression('atan2(-1/(0.6*(-0.406*pow(x[0],3)+0.8529*pow(x[0],2)-0.7152*x[0]-0.1221+0.14845*pow(x[0],-0.5))))', degree=2)

which is the first part of your expression

and then you see that you are missing a , in arctan2, as it takes in 2 arguments atan2 - Wikipedia

1 Like