# Problem with boundary conditions in Gridap and GridapGmsh

**URL:** <https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658>\
**Category:** General Usage\
**Tags:** gridap\
**Created:** [November 2, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658 "2022-11-02T12:59:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rouckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rouckas/32/15459_2.png) [@rouckas](https://discourse.julialang.org/u/rouckas)\
**Post date:** [November 2, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658/1 "2022-11-02T12:59:38Z")

</div>

Dear all,  
I am trying to solve some 2D electrostatic problem (Poisson Equation) using Gripap.jl and gmsh for mesh generation. I solve for the potential in space bounded by conductors, which have surface potentials prescribed as Dirichlet boundary conditions U=1 on the outer boundary and U=0 on the inner electrode.

 ![fig1](https://global.discourse-cdn.com/julialang/original/3X/f/5/f596014329619eb469032703e81a6016e55ee728.png)

When the inserted electrode is “small” (only one mesh cell per boundary segment), the solver seems to ignore the potential assigned to the small electrode (U=0) as shown in the figure below.

 ![fig2](https://global.discourse-cdn.com/julialang/original/3X/9/6/96ae5a3816cb9de736c78147595614b56c7a7702.png)

Apparently, the mesh cell number on each side is important as also illustrated by the figure below, where only the sides with two cells per side are correctly represented.

 ![fig3](https://global.discourse-cdn.com/julialang/original/3X/b/f/bf88366a2d20cfd6a5b9076f40706195e93692e8.png)

My source code is available in the following gist:

> **[Jupyter Notebook Viewer](https://nbviewer.org/gist/rouckas/7001f9fed535d86a63a966f5351b635a)**
>
> Check out this Jupyter notebook!

Is there some solver parameter to fix this issue?

I am using the gmsh boundary markers to assign the boundary conditions. Note that in Fenicsx ( [fenicsproject.org](http://fenicsproject.org) ) I can solve on the same mesh without issues.

My software versions are  
Julia 1.8.2  
Gridap 0.17.14  
GridapGmsh 0.6.1

Thanks in advance for any help.

---

<div class="post-metadata">

**Author:** ![eneiva](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eneiva/32/16631_2.png) [@eneiva](https://discourse.julialang.org/u/eneiva)\
**Post date:** [December 15, 2022, 1:39pm UTC](https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658/2 "2022-12-15T13:39:25Z")

</div>

Dear @rouckas,

```julia
Physical Curve("C0", 10) = {bnd1()};
Physical Curve("C1", 20) = {bnd2()};

```

Have you tried assigning the tag `C0` also to the physical points in the closure of `bnd1()` (see this small [example](https://github.com/gridap/GridapGmsh.jl#gotchas) on a disk)?

Sorry for the late answer. The community is more active on [gitter](https://gitter.im/Gridap-jl/community).
