### Create line inside domain in mesh

303

views

0

Hi,

I am trying to define the 2D Poisson problem where the domain is a circle and in the centre there is a flat electrode (line or degenerate rectangle) on which there is a prescribed potential

Later I will define a Dirchlet BC: U( "electrode") = 1 and on U("circle") = 1 and solve the Poisson equation in this domain and compute the charge distribution on "electrode"

My problem is that mshr does not accept a definition of a degenerate rectangle.

Can this geormetry be described and solved by fenics?

Thanks

I am trying to define the 2D Poisson problem where the domain is a circle and in the centre there is a flat electrode (line or degenerate rectangle) on which there is a prescribed potential

```
R = 1
d = 0.5
circle = Circle(Point(0, 0), R)
electrode = Rectangle(Point(-d, 0), Point(d, 0))
domain = circle - electrode
mesh = generate_mesh(domain, 10)
plot (mesh)
```

Later I will define a Dirchlet BC: U( "electrode") = 1 and on U("circle") = 1 and solve the Poisson equation in this domain and compute the charge distribution on "electrode"

My problem is that mshr does not accept a definition of a degenerate rectangle.

```
Error: Unable to create rectangle.
*** Reason: Rectangle with corner <Point x = -0.25 y = 0 z = 0> and <Point x = 0.25 y = 0 z = 0> degenerated.
*** Where: This error was encountered inside CSGPrimitives2D.cpp.
*** Process: 0
***
*** DOLFIN version: 2017.1.0
*** Git changeset: unknown
```

Can this geormetry be described and solved by fenics?

Thanks

Community: FEniCS Project

Please login to add an answer/comment or follow this question.

Investigate the triangle interface, or use triangle outside of mshr. The domain you describe is very simple and would only require a few lines of a .poly file. Or you could write a python script to generate the .poly file with the fidelity you require.