# Boundary conditions on loaded mesh

**URL:** <https://community.freefem.org/t/boundary-conditions-on-loaded-mesh/3207>\
**Category:** General Discussion\
**Created:** [May 2, 2024, 5:47pm UTC](https://community.freefem.org/t/boundary-conditions-on-loaded-mesh/3207 "2024-05-02T17:47:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dakyn](https://avatars.discourse-cdn.com/v4/letter/d/b5ac83/32.png) [@Dakyn](https://community.freefem.org/u/Dakyn)\
**Post date:** [May 2, 2024, 5:47pm UTC](https://community.freefem.org/t/boundary-conditions-on-loaded-mesh/3207/1 "2024-05-02T17:47:28Z")

</div>

Dear Community,  
I am struggling with the problem of how to properly set the boundary conditions for the Poisson equation on my loaded mesh. I’ve tried several options, but usually my calculation always stops at one value and convergence does not improve. Does anyone know how to set the boundary conditions correctly on the whole loaded mesh.  
Thank you very much in advance  
I am attaching a section of code where I define this beginning.

```auto
string meshFileName = "mix.mesh";
mesh3 Th = readmesh3(meshFileName);
plot(Th, wait=1,fill=1,boundary = 1);
meshS ThS = extract(Th);

fespace Vh(Th,P1);
fespace Ph(Th,P0);

macro Grad(u) [dx(u),dy(u),dz(u)] // EOM
func f = (cos(x)*x^5)/sin(x)*(x/20)*(x-200); // right hand side
func g = 0;

varf vaglobal(u,v) = int3d(Th)(Grad(u)'*Grad(v))
                           + on(0,u=g) + int3d(Th)(f*v);

```
