# How to address point boundary condition?

**URL:** <https://fenicsproject.discourse.group/t/how-to-address-point-boundary-condition/3286>\
**Category:** Uncategorized\
**Created:** [May 22, 2020, 1:52am UTC](https://fenicsproject.discourse.group/t/how-to-address-point-boundary-condition/3286 "2020-05-22T01:52:18Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Leo](https://avatars.discourse-cdn.com/v4/letter/l/c2a13f/32.png) [@Leo](https://fenicsproject.discourse.group/u/Leo)\
**Post date:** [May 22, 2020, 6:07am UTC](https://fenicsproject.discourse.group/t/how-to-address-point-boundary-condition/3286/2 "2020-05-22T06:07:53Z")

</div>

Hello  
Lets say you want to apply a point load equal to 100 N downward in Y direction at coordinate (5,5):

```
class Load(UserExpression):

    def __init__ (self, **kwargs):
        super(). __init__ (degree=kwargs["degree"])

        self.point = kwargs['point']
        self.value = kwargs['value']

    def eval(self, value, x):

        if near(x[0], self.point[0]) and near(x[1], self.point[1]):
            value[0] = self.value[0]
            value[1] = self.value[1]
        else:  
            value[0] = 0
            value[1] = 0

    def value_shape(self):
        return (2,)

```

You can call it by:

```
T = Load(point=(5, 5), value=(0, -100), degree=1)

```

**Regarding applying boundary condition at a specific point:**

Lest say you want to fix a point at coordinate (0,0). You can do as following:

```
def point(x, on_boundary):
    tol = DOLFIN_EPS
    return (abs(x[0] - 0) < tol) and (abs(x[1] -0) < tol)

BC_POINT = DirichletBC(V, Constant((0., 0.)), point,method="pointwise")
```

---

_[View the full topic](https://fenicsproject.discourse.group/t/how-to-address-point-boundary-condition/3286)._
