Boundary conditions on loaded mesh

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.

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);