# Get information about facet-connectivity of the mesh

**URL:** <https://fenicsproject.discourse.group/t/get-information-about-facet-connectivity-of-the-mesh/12524>\
**Category:** mesh\
**Created:** [October 23, 2023, 6:45am UTC](https://fenicsproject.discourse.group/t/get-information-about-facet-connectivity-of-the-mesh/12524 "2023-10-23T06:45:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![plugged](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/plugged/32/5115_2.png) [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Post date:** [October 23, 2023, 6:45am UTC](https://fenicsproject.discourse.group/t/get-information-about-facet-connectivity-of-the-mesh/12524/1 "2023-10-23T06:45:44Z")

</div>

Hello,

I’ve got a quick question regarding getting information about the mesh connectivity in FEniCS 2019.1.  
My problem is as follows: There are the following methods for a mesh available: `mesh.coordinates` and `mesh.cells`, which give the list of coordinates of the mesh vertices (`mesh.coordinates`) as well as the composition of the cells (triangles, tetrahedrons, etc.) with `mesh.cells`. See, e.g.,

```auto
from fenics import *

mesh = UnitSquareMesh(2, 2)
print(f"{mesh.coordinates() = }")
print(f"{mesh.cells() = }")

```

My question is: Is there any analogous functionality which gives a representation of the facets (e.g. line segments, triangles, etc.) of the mesh? And I need two things from this function: It should be fast (so no loops in python) and also possible to compute in parallel.

Thansk in advance for your help!

---

<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:** [October 23, 2023, 9:20am UTC](https://fenicsproject.discourse.group/t/get-information-about-facet-connectivity-of-the-mesh/12524/2 "2023-10-23T09:20:23Z")

</div>

```python
from dolfin import * 
mesh = UnitSquareMesh(10, 10)
mesh.init(mesh.topology().dim()-1, 0)
f_to_v = mesh.topology()(mesh.topology().dim()-1, 0)

```

where you for each facet can access the connectivity through `f_to_v(index)` or by using `f_to_v()` to get the flattened list for all facets.
