# How to access edge matrix in FreeFEM++?

**URL:** <https://community.freefem.org/t/how-to-access-edge-matrix-in-freefem/1737>\
**Category:** General Discussion\
**Created:** [May 13, 2022, 4:33am UTC](https://community.freefem.org/t/how-to-access-edge-matrix-in-freefem/1737 "2022-05-13T04:33:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jftrabago](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jftrabago](https://community.freefem.org/u/jftrabago)\
**Post date:** [May 13, 2022, 4:33am UTC](https://community.freefem.org/t/how-to-access-edge-matrix-in-freefem/1737/1 "2022-05-13T04:33:35Z")

</div>

Is it possible to access the edge matrices in FreeFEM++? How does do it in FreeFEM++?

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [May 16, 2022, 11:58am UTC](https://community.freefem.org/t/how-to-access-edge-matrix-in-freefem/1737/2 "2022-05-16T11:58:47Z")

</div>

What is edge matrices ?  
if you want to have access of the edge numbering, the answer is yes.

```auto
    mesh Th= square(10,10);
   fespace Eh(Th,P0edge);// use a finite element on edge 
   for (k=0; k<Th.nt; ++k) 
    for (int e =0; e< 3;++e)
       Eh(k,e) ; // number of edge e of triangle k
      // the vertex of edges e1= (e+1)%3, e2= (e+2)%3 in triangle k.

```

---

<div class="post-metadata">

**Author:** ![jftrabago](https://avatars.discourse-cdn.com/v4/letter/j/d2c977/32.png) [@jftrabago](https://community.freefem.org/u/jftrabago)\
**Post date:** [July 5, 2022, 11:16pm UTC](https://community.freefem.org/t/how-to-access-edge-matrix-in-freefem/1737/3 "2022-07-05T23:16:18Z")

</div>

Dear Prof. Hecht,

Thank you for your response, and my apologies for the very late reply to your comment.  
The edge matrix corresponding to element K is given as follows:

E^K = [E^K\_1, . . . , E^K\_d] = [x^K\_1 − x^K\_0, . . . , x^K\_d − x^K\_0].

Here, the i-th column vector E^K\_i = x^K\_i −x^K\_0, i=1,…,d, represents an edge of the triangle or element K.

Thank you.
