# Using levelset to integrate a fespace variable in a subregion of the mesh

**URL:** <https://community.freefem.org/t/using-levelset-to-integrate-a-fespace-variable-in-a-subregion-of-the-mesh/3561>\
**Category:** General Discussion\
**Created:** [October 23, 2024, 1:35pm UTC](https://community.freefem.org/t/using-levelset-to-integrate-a-fespace-variable-in-a-subregion-of-the-mesh/3561 "2024-10-23T13:35:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [October 24, 2024, 9:31am UTC](https://community.freefem.org/t/using-levelset-to-integrate-a-fespace-variable-in-a-subregion-of-the-mesh/3561/2 "2024-10-24T09:31:29Z")

</div>

Hello,  
according to the FreeFem documentation, when you write  
`int3d(Th3D,levelset=phi)` the integral is performed where phi\<0.  
Thus you must change your definition of `flevelset`  
Otherwise you can do also as in [Vectorial PDE, conditions, stiffness matrix - #4 by fb77](https://community.freefem.org/t/vectorial-pde-conditions-stiffness-matrix/3543/4)

---

_[View the full topic](https://community.freefem.org/t/using-levelset-to-integrate-a-fespace-variable-in-a-subregion-of-the-mesh/3561)._
