# Boundary SubDomains setting

**URL:** <https://fenicsproject.discourse.group/t/boundary-subdomains-setting/3407>\
**Category:** Uncategorized\
**Created:** [June 2, 2020, 12:39pm UTC](https://fenicsproject.discourse.group/t/boundary-subdomains-setting/3407 "2020-06-02T12:39:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LorenzoP90](https://avatars.discourse-cdn.com/v4/letter/l/aeb1de/32.png) [@LorenzoP90](https://fenicsproject.discourse.group/u/LorenzoP90)\
**Post date:** [June 2, 2020, 12:39pm UTC](https://fenicsproject.discourse.group/t/boundary-subdomains-setting/3407/1 "2020-06-02T12:39:51Z")

</div>

Hi all,

I need to set up boundary subdomains for a square whose sides are divided in 3 parts, on 2 of which I have some BCs and on the third i have another BC, more or less like so:

![forum_aid](https://global.discourse-cdn.com/free1/uploads/fenicsproject1/original/2X/4/4e975339af59f894475667dc389a44d91eb1bb44.png)

I have already read the tutorial on settin up multiple BCs and my porblem is not on the BCs themselve but more on how to define the limits of the 3 different subdomains highlighted in the picture.

I have set up this SubDomains:

```
#Black part of the side
class Omega_1(SubDomain):
    def inside(self, x, on_boundary):
        return on_boundary and near(x[1], 0, tol) and x[0] >= (lenght/3)+tol or x[0] <= (lenght*2/3)+tol

#Red part of the side
class Omega_3(SubDomain):
    def inside(self, x, on_boundary):
        return on_boundary and near(x[1], 0, tol) and x[0] < (lenght/3)+tol or x[0] > (lenght*2/3)+tol

```

The problem is i get the following warning:

`\*\*\* Warning: Found no facets matching domain for boundary condition.

Can anyone help?

Thanks!

---

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [June 2, 2020, 1:53pm UTC](https://fenicsproject.discourse.group/t/boundary-subdomains-setting/3407/2 "2020-06-02T13:53:22Z")

</div>

The error message is quite clear. However, for anyone to help you, you Need to provide a minimal working example including your mesh.
