# Interpolating results on an edge

**URL:** <https://fenicsproject.discourse.group/t/interpolating-results-on-an-edge/8804>\
**Category:** Uncategorized\
**Created:** [July 18, 2022, 1:18pm UTC](https://fenicsproject.discourse.group/t/interpolating-results-on-an-edge/8804 "2022-07-18T13:18:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sbhasan](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Post date:** [July 18, 2022, 1:18pm UTC](https://fenicsproject.discourse.group/t/interpolating-results-on-an-edge/8804/1 "2022-07-18T13:18:44Z")

</div>

Hi,

I am using dolfinx 0.4.1 installed from conda. I have a simulation performed in a 2d unit square geometry and I am wondering how to interpolate an expression only on the left edge. The simple thing to do is of course to use the approach demonstrated in this [tutorial](https://github.com/jorgensd/dolfinx-tutorial/blob/v0.4.0/chapter1/membrane_code.ipynb). But I am going to consider problems involving curved edges which will be easier to access through their tags. If this is possible, I will appreciate if someone could explain how or point me to an existing example.

Thanks a lot.

---

<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:** [July 18, 2022, 1:51pm UTC](https://fenicsproject.discourse.group/t/interpolating-results-on-an-edge/8804/2 "2022-07-18T13:51:04Z")

</div>

There is currently only very experimental support for interpolation onto sub entities (facets, edges, vertices).  
However, you can use: `dolfinx.mesh.compute_incident_entities` to only interpolate onto cells containing a set of facets.  
See the [Documentation of compute\_indicident\_entities](https://docs.fenicsproject.org/dolfinx/main/cpp/mesh.html?highlight=compute_incident_entities#_CPPv4N7dolfinx4mesh25compute_incident_entitiesERK4MeshRKNSt4spanIKNSt7int32_tEEEii) for the documentation of the input, or [dolfinx/test\_refinement.py at 621d1479adf1e1a8beb9eed86cc8ad3de963f223 · FEniCS/dolfinx · GitHub](https://github.com/FEniCS/dolfinx/blob/621d1479adf1e1a8beb9eed86cc8ad3de963f223/python/test/unit/mesh/test_refinement.py#L114) for an example (which computes the edges from a set of cells).  
You can then pass the cells into `u.interpolate` as the second argument, ref: [dolfinx.fem — DOLFINx 0.4.2.0 documentation](https://docs.fenicsproject.org/dolfinx/main/python/generated/dolfinx.fem.html?highlight=interpolate#dolfinx.fem.Function.interpolate)

---

<div class="post-metadata">

**Author:** ![sbhasan](https://avatars.discourse-cdn.com/v4/letter/s/ed655f/32.png) [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Post date:** [July 18, 2022, 1:59pm UTC](https://fenicsproject.discourse.group/t/interpolating-results-on-an-edge/8804/3 "2022-07-18T13:59:39Z")

</div>

Thanks so much for the pointer!
