# How obtain a '1D' element from a 2D element through integrating out second variable

**URL:** <https://community.freefem.org/t/how-obtain-a-1d-element-from-a-2d-element-through-integrating-out-second-variable/1918>\
**Category:** General Discussion\
**Created:** [July 28, 2022, 1:35pm UTC](https://community.freefem.org/t/how-obtain-a-1d-element-from-a-2d-element-through-integrating-out-second-variable/1918 "2022-07-28T13:35:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neutrino](https://avatars.discourse-cdn.com/v4/letter/n/bb73d2/32.png) [@Neutrino](https://community.freefem.org/u/Neutrino)\
**Post date:** [July 28, 2022, 1:35pm UTC](https://community.freefem.org/t/how-obtain-a-1d-element-from-a-2d-element-through-integrating-out-second-variable/1918/1 "2022-07-28T13:35:45Z")

</div>

Say that I have a finite element u on the square [0,L\_1]\times[0,L\_2] and I want a new element \widetilde{u} with the property that for each x\in[0,L\_1] I have \widetilde{u}(x,y) = \frac{1}{L\_2}\int\_0^{L\_2} u(x,y)dy for all y\in [0,L\_2].

In other words, \widetilde{u} is constant on the fiber \{x\}\times [0,L\_2] and is equal to the average of u over that fiber.

Is there a clean way to 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:** [July 29, 2022, 11:47am UTC](https://community.freefem.org/t/how-obtain-a-1d-element-from-a-2d-element-through-integrating-out-second-variable/1918/2 "2022-07-29T11:47:46Z")

</div>

Yes this element the tensorial product of 1d Finite element and constant  
so you can do this with FreeFEM.
