# User defined function; pass fe or mesh arguments?

**URL:** <https://community.freefem.org/t/user-defined-function-pass-fe-or-mesh-arguments/3897>\
**Category:** General Discussion\
**Created:** [May 2, 2025, 8:07pm UTC](https://community.freefem.org/t/user-defined-function-pass-fe-or-mesh-arguments/3897 "2025-05-02T20:07:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pi.3.141](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@pi.3.141](https://community.freefem.org/u/pi.3.141)\
**Post date:** [May 2, 2025, 8:07pm UTC](https://community.freefem.org/t/user-defined-function-pass-fe-or-mesh-arguments/3897/1 "2025-05-02T20:07:27Z")

</div>

Hello Freefem community,  
I wonder if it is possible to pass to user defined functions a finite element or mesh argument.  
For example, would it be possible something like below?  
Thank you!

mesh Th=square(10,10)  
fespace Vh(Th,P1);  
Vh f=x;  
funct real myfunc(mesh &Th, Vh &f) {  
// anything …  
return 0;  
}

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [May 3, 2025, 4:44am UTC](https://community.freefem.org/t/user-defined-function-pass-fe-or-mesh-arguments/3897/2 "2025-05-03T04:44:59Z")

</div>

No, it’s not possible.

---

<div class="post-metadata">

**Author:** ![pi.3.141](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@pi.3.141](https://community.freefem.org/u/pi.3.141)\
**Post date:** [May 5, 2025, 2:07pm UTC](https://community.freefem.org/t/user-defined-function-pass-fe-or-mesh-arguments/3897/3 "2025-05-05T14:07:13Z")

</div>

Thank you for letting me know.
