# Function in boundary condition, defined on boundary only

**URL:** <https://fenicsproject.discourse.group/t/function-in-boundary-condition-defined-on-boundary-only/5065>\
**Category:** variational formulation\
**Created:** [February 10, 2021, 7:28am UTC](https://fenicsproject.discourse.group/t/function-in-boundary-condition-defined-on-boundary-only/5065 "2021-02-10T07:28:55Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [February 10, 2021, 9:24am UTC](https://fenicsproject.discourse.group/t/function-in-boundary-condition-defined-on-boundary-only/5065/4 "2021-02-10T09:24:12Z")

</div>

> [@mesenev](#):
>
> I would like to be able to manipulate freely with my functions to trace what’s going on. `FacetNormal` gives `Integral of type cell cannot contain a ReferenceNormal` outside of the problem formulation scope (I’m sorry if I’m wrong here) so I personally want to avoid to use it.

I have previously posted a recipe on how to project the FacetNormal to an appropriate volume function space, see: [How to plot normal unit vector of faces in a 2D mesh? - #2 by dokken](https://fenicsproject.discourse.group/t/how-to-plot-normal-unit-vector-of-faces-in-a-2d-mesh/3912/2)  
This function would only give you a normal on the boundary, 0 at all other dofs.

---

_[View the full topic](https://fenicsproject.discourse.group/t/function-in-boundary-condition-defined-on-boundary-only/5065)._
