Probleme with boundaries conditions

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

I cannot reproduce this error using the docker image quay.io/fenicsproject/dev:latest.
First question is: How did you install dolfin?

Anyhow, you need to properly format your code, using ```, making it possible for others to run the code above. Right now one has to make several modifications to your text for it to be executable.

i have installed dolfin with:

sudo apt-get upgrade
sudo apt-get install -y python-dolfin

Could you check which version of dolfin this is:

import dolfin
print(dolfin.__version__)

the version is 2019.1.0

Have you previously had an older version of dolfin installed?

yes
it was already installed before i update it

I would clean the ditjitso cache by calling ditjitso clean

i have done it
but the problem is not solved
i have forgotten to say you that i have installed fenics with anaconda and ubuntu both,because fenics with ananconda didnt work.maybe is the sour of the problem

The easiest way to work around this problem is by using docker. It is always tricky with multiple installations on the computer itself, as files are hidden everywhere

iam very novice
have you a tutorial explain how using docker

See https://fenics-containers.readthedocs.io/en/latest/introduction.html

thank you very much dokken .
i have installed docker and every things go well
god bless you.