Hi everyone
i have i big probleme with ‘‘DirichletBC’’
i have this error:
RuntimeError: Unable to compile C++ code with dijits0
the full code is :
import matplotlib.pyplot as plt
import numpy as np
from fenics import *
from dolfin import *
Create mesh and define function space
mesh = UnitSquareMesh(64, 64)
P2 = VectorElement(‘P’, triangle, 2)
P1 = FiniteElement(‘P’, triangle, 1)
TH = P2 * P1
W = FunctionSpace(mesh, TH)
Define variational problem
(u, p) = TrialFunctions(W)
(v, q) = TestFunctions(W)
a = inner(grad(u), grad(v))dx - pdiv(v)*dx + div(u)qdx
f = Constant((0,0))
L = dot(f, v)*dx
Define boundaries
roof = ‘near(x[1], 1)’
walls = 'near(x[0], 0) || near(x[0], 1) || near(x[1], 0) ’
Define boundary conditions
bcu_noslip =DirichletBC(W.sub(0), Constant((0, 0)), walls)
after the boundary conditionss i have this error:
Moving new file over differing existing file:
src: /home/sambou/Downloads/jitfailure-dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54/error.log.d88351399d0e49f49b6acb3e953ad311
dst: /home/sambou/Downloads/jitfailure-dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54/error.log
backup: /home/sambou/Downloads/jitfailure-dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54/error.log.old
Backup file exists, overwriting.
------------------- Start compiler output ------------------------
/tmp/tmpq3mg2ka_/dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54.cpp:13:10: fatal error: dolfin/common/Array.h: No such file or directory
#include <dolfin/common/Array.h>
^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
------------------- End compiler output ------------------------
Compilation failed! Sources, command, and errors have been written to: /home/sambou/Downloads/jitfailure-dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54
DijitsoError Traceback (most recent call last)
/usr/lib/python3/dist-packages/dolfin/jit/jit.py in compile_class(cpp_data, mpi_comm)
166 generate=cpp_data[‘jit_generate’],
–> 167 mpi_comm=mpi_comm)
168 submodule = dijitso.extract_factory_function(module, “create_” + module_name)()
/usr/lib/python3/dist-packages/dolfin/jit/jit.py in mpi_jit(*args, **kwargs)
46 if MPI.size(mpi_comm) == 1:
—> 47 return local_jit(*args, **kwargs)
48
/usr/lib/python3/dist-packages/dolfin/jit/jit.py in dijitso_jit(*args, **kwargs)
102 def dijitso_jit(*args, **kwargs):
–> 103 return dijitso.jit(*args, **kwargs)
104
/home/sambou/.local/lib/python3.6/site-packages/dijitso/jit.py in jit(jitable, name, params, generate, send, receive, wait)
216 raise DijitsoError(“Dijitso JIT compilation failed, see ‘%s’ for details”
–> 217 % err_info[‘fail_dir’], err_info)
218
DijitsoError: Dijitso JIT compilation failed, see ‘/home/sambou/Downloads/jitfailure-dolfin_subdomain_26c39b28b572cd13bf0d18c9c0e81b54’ for details
During handling of the above exception, another exception occurred:
RuntimeError Traceback (most recent call last)
in ()
28
29 # Define boundary conditions
—> 30 bcu_noslip =DirichletBC(W.sub(0), Constant((0, 0)), walls)
/usr/lib/python3/dist-packages/dolfin/fem/dirichletbc.py in init(self, *args, **kwargs)
109 args = args[:2] + (self.sub_domain,) + args[3:]
110 elif isinstance(args[2], str):
–> 111 self.sub_domain = CompiledSubDomain(args[2], mpi_comm=args[0].mesh().mpi_comm())
112 args = args[:2] + (self.sub_domain,) + args[3:]
113 elif isinstance(args[2], cpp.mesh.MeshFunctionSizet):
/usr/lib/python3/dist-packages/dolfin/mesh/subdomain.py in new(cls, inside_code, **kwargs)
123 def new(cls, inside_code, **kwargs):
124 properties = kwargs
–> 125 return compile_subdomain(inside_code, properties)
/usr/lib/python3/dist-packages/dolfin/mesh/subdomain.py in compile_subdomain(inside_code, properties)
116 ‘name’: ‘subdomain’, ‘jit_generate’: jit_generate}
117
–> 118 subdomain = compile_class(cpp_data, mpi_comm=mpi_comm)
119 return subdomain
120
/usr/lib/python3/dist-packages/dolfin/jit/jit.py 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”)
171
172 if name == ‘expression’:
RuntimeError: Unable to compile C++ code with dijitso