### Fenics does not detect boundary conditions [C++]

The boundary condition is expressed using the class:

```
class wallConstrained : public SubDomain
{
bool inside(const Array<double>& x, bool on_boundary) const
{
return ((x[0]> -DOLFIN_EPS & x[0] < 0.1)*(x[1]>-DOLFIN_EPS & x[1] <0.1)*(x[2] <= DOLFIN_EPS) & on_boundary)|
(((x[0]>0.9 & x[0] <1.0)*(x[1]>5.9 & x[1] <6.0)*(x[2] <= DOLFIN_EPS) ) & on_boundary )
}
};
```

I tried, for instance, to remove "& on_boundary", I tried to relax "x[2] <= -DOLFIN_EPS" with "x[2] <= 0.1" or even "x[2] <= 0.9", I tried to relax "x[0]>5.9 & x[0] <6.0" with "x[0]>5.9 & x[0] <6.1" even going out of the domain, and combination of these. I also checked the mesh, I always assured that the number of elements was enough for detection, without any results: it seems that Fenics can't see any facet on these regions, but actually the inside() function must return 1 on these regions. I even tried "geometric" and "pointwise" options for boundary condition definition, getting very strange results.

What do you suggest to check? Do you have some detailed reference on how boundary conditions work in Fenics?

### 1 Answer

`(on_boundary && ((x[0] < DOLFIN_EPS) || (x[0] > (1.0-DOLFIN_EPS)) || (x[1] < DOLFIN_EPS) || (x[1] > (1.0-DOLFIN_EPS)) || (x[2] < DOLFIN_EPS) || (x[2] > (6.0-DOLFIN_EPS))) )`