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!!!