# Solve PDE with infinite nb of solutions by adding a constraint

**URL:** https://community.freefem.org/t/solve-pde-with-infinite-nb-of-solutions-by-adding-a-constraint/462
**Category:** General Discussion
**Created:** [June 10, 2020, 3:45pm UTC](https://community.freefem.org/t/solve-pde-with-infinite-nb-of-solutions-by-adding-a-constraint/462 "2020-06-10T15:45:32Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![BeniaminBogosel](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BeniaminBogosel](https://community.freefem.org/u/BeniaminBogosel)
#### Post date: [June 10, 2020, 3:45pm UTC](https://community.freefem.org/t/solve-pde-with-infinite-nb-of-solutions-by-adding-a-constraint/462/1 "2020-06-10T15:45:32Z")

</div>

Hello,

I would like to use FreeFEM to solve a PDE with an infinte number of solutions, and recover a unique solution by imposing a constraint.

I found some other post on the forum linking to this page: [http://jolivet.perso.enseeiht.fr/FreeFem-tutorial/section\_8/example5.edp](http://jolivet.perso.enseeiht.fr/FreeFem-tutorial/section_8/example5.edp) where an example is given for the parallel version. I tried, but not managed to make the example work in plain FreeFem. I keep getting some weird “segmentation faults” and I don’t see where is the problem.

In particular, the command changeNumbering does not seem to work (I don’t know if this is important). Anyway, if it is not too much trouble, would it be possible to have a working code for the simple case:

-\Delta u = f, u \in H^1(\omega), \int\_\omega u=0, \partial\_n u = 0.

Thank you!

---

<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: [June 10, 2020, 4:33pm UTC](https://community.freefem.org/t/solve-pde-with-infinite-nb-of-solutions-by-adding-a-constraint/462/2 "2020-06-10T16:33:01Z")

</div>

You can launch the mentioned code with just `ff-mpirun -n 1 example5.edp`, and add on top of that “plain FreeFem”. The exact sequential counterpart is available [here](https://github.com/FreeFem/FreeFem-sources/blob/develop/examples/tutorial/Laplace-lagrange-mult.edp).

---

<div class="post-metadata">

### Author: ![BeniaminBogosel](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@BeniaminBogosel](https://community.freefem.org/u/BeniaminBogosel)
#### Post date: [June 11, 2020, 7:54am UTC](https://community.freefem.org/t/solve-pde-with-infinite-nb-of-solutions-by-adding-a-constraint/462/3 "2020-06-11T07:54:39Z")

</div>

Thank you for your answer @prj . I managed to make my example work now.
