# Add interior Point to Dirichlet Boundary

**URL:** https://fenicsproject.discourse.group/t/add-interior-point-to-dirichlet-boundary/1423
**Category:** mesh
**Created:** [August 29, 2019, 8:25pm UTC](https://fenicsproject.discourse.group/t/add-interior-point-to-dirichlet-boundary/1423 "2019-08-29T20:25:17Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![kamensky](https://avatars.discourse-cdn.com/v4/letter/k/e95f7d/32.png) [@kamensky](https://fenicsproject.discourse.group/u/kamensky)
#### Post date: [August 29, 2019, 8:47pm UTC](https://fenicsproject.discourse.group/t/add-interior-point-to-dirichlet-boundary/1423/2 "2019-08-29T20:47:10Z")

</div>

In this example, (0,0) is part of the boundary; did you perhaps mean (\frac{1}{2},\frac{1}{2})? You can do that as follows:

```python
from dolfin import *
import matplotlib.pyplot as plt
mesh=UnitSquareMesh(4,4)
V = FunctionSpace(mesh, "P" ,1)
bc = DirichletBC(V,Constant(0.0), "on_boundary" )

# Add another BC, where the condition is checked "pointwise":
bc_pt = DirichletBC(V,Constant(0.0),
                    "near(x[0],0.5) && near(x[1],0.5)",
                    "pointwise")
bcs = [bc,bc_pt]

f = Constant(1.0)
u = TrialFunction(V)
v = TestFunction(V)
a = dot(grad(u), grad(v))*dx
L = f*v*dx
u_h = Function(V)
solve(a == L, u_h, bcs) # (Note: Changed argument from bc to bcs)
plot(u_h)
plot(mesh)
plt.show()

```

When applying BCs pointwise, there just needs to be a DoF at the corresponding point (so, (0.7,0.3) would not work in this example).

---

_[View the full topic](https://fenicsproject.discourse.group/t/add-interior-point-to-dirichlet-boundary/1423)._
