# Point grounding

I am trying to solve a Laplace problem with a point grounding.
I am imposing periodic boundary conditions on top and bottom.
I expect one-dimensional which is consistent with the following.

``````cond1 = AA(  0) ==  0;
cond2 = DA(d/2) ==  0;
ode = diff(diff(AA,x),x) == -1
Az = dsolve(ode,[cond1,cond2]));
``````

The following is the NGSolve Python script… Please give me an advise.

``````from netgen.occ import *
from numpy import *

d = 0.005
h = 0.005
xp = [-d/2, d/2, d/2,-d/2]
yp = [-h/2,-h/2, h/2, h/2]

face = MoveTo(xp[0], yp[0]).LineTo(xp[1], yp[1]).LineTo(xp[2], yp[2]).LineTo(xp[3], yp[3]).Close().Face()
face.faces.name = "air"
face.edges.Nearest((-d/2, 0, 0)).name = "left"
face.edges.Nearest(( d/2, 0, 0)).name = "right"
face.edges.Nearest(( 0,-h/2, 0)).name = "top"
face.edges.Nearest(( 0, h/2, 0)).name = "bottom"
face.vertices.Nearest((-d/2, -h/2, 0)).name = "gnd"
face.edges.Min(Y).Identify(face.edges.Max(Y), "periodicy", IdentificationType.PERIODIC)

from ngsolve import *
from ngsolve import Mesh
from ngsolve.webgui import Draw
geo = OCCGeometry(face, dim=2)
Draw(mesh)

fes = H1(mesh, order=2, dirichlet='gnd')
u = fes.TrialFunction()
v = fes.TestFunction()

a = BilinearForm(fes)
c = Preconditioner(a, type="bddc")
a.Assemble()
f = LinearForm(fes)
f += v*dx
f.Assemble()
gfAz = GridFunction(fes)
solvers.CG(sol=gfAz.vec, rhs=f.vec, mat=a.mat, pre=c.mat, printrates='', tol=1e-16, maxsteps=10000)
Draw(gfAz, mesh)
``````

this will be

``````fes = H1(mesh, order=2, dirichlet_bbbnd='gnd')
``````

Joachim

`````` |  dirichlet_bbnd: regexpr
|    Regular expression string defining the dirichlet bboundary,
|    i.e. points in 2D and edges in 3D.
|    More than one boundary can be combined by the | operator,
|    i.e.: dirichlet_bbnd = 'top|right'
|  dirichlet_bbbnd: regexpr
|    Regular expression string defining the dirichlet bbboundary,
|    i.e. points in 3D.
|    More than one boundary can be combined by the | operator,
|    i.e.: dirichlet_bbbnd = 'top|right'

``````