# Problem with finding the boundary

Hello,

Ive tried to define the inner circle of a tire as a dirichlet boundary like that:

def Restboundary2(

tol = 1E-6

return on_boundary and sqrt(x[

u_i=Constant(

bci=DirichletBC

with 0.22 the inner radius.

when i start solving i get the error:

"Found no facets matching domain for boundary condition."

when i try the same with a neumann boundary

class NeumannBoundary

def inside(self, x ,on_boundary):

tol = 1E-6

return on_boundary and sqrt(x[

boundary_parts= MeshFunction(

boundary_

nm_boundary2=

nm_boundary2.

and plot the boundary parts i can see that it finds the boundary as i want it.

so does anybody has an idea whats wrong??

thanks

## Question information

- Language:
- English Edit question

- Status:
- Solved

- Assignee:
- No assignee Edit question

- Solved by:
- Anders Logg

- Solved:
- 2013-02-16

- Last query:
- 2013-02-16

- Last reply:
- 2013-02-15

Anders Logg (logg) said : | #1 |

On Fri, Feb 15, 2013 at 12:06:05PM -0000, Roman Moritz wrote:

> New question #221951 on FEniCS Project:

> https:/

> Ive tried to define the inner circle of a tire as a dirichlet boundary like that:

> def Restboundary2(

> tol = 1E-6

> return on_boundary and sqrt(x[

> u_i=Constant(

> bci=DirichletBC

> with 0.22 the inner radius.

> when i start solving i get the error:

> "Found no facets matching domain for boundary condition."

> when i try the same with a neumann boundary

> class NeumannBoundary

> def inside(self, x ,on_boundary):

> tol = 1E-6

> return on_boundary and sqrt(x[

> boundary_parts= MeshFunction(

> boundary_

> nm_boundary2=

> nm_boundary2.

> and plot the boundary parts i can see that it finds the boundary as i want it.

> so does anybody has an idea whats wrong??

> thanks

Very strange... What you do with the Neumann boundary is exactly the

same thing that happens inside DirichletBC when it extracts a

MeshFunction for the markers using SubDomain.mark:

// Mark everything as sub domain 1

sub_domains = 1;

// Mark the sub domain as sub domain 0

sub_domain-

Does it work if you create your DirichletBC by

bci = DirichletBC(V, u_i, boundary_parts, 2)

?

--

Anders

Roman Moritz (r-moritz) said : | #2 |

Thanks Anders Logg, that solved my question.