# What role does PoissonBoundary play?

**URL:** <https://community.freefem.org/t/what-role-does-poissonboundary-play/2194>\
**Category:** General Discussion\
**Created:** [December 17, 2022, 12:46am UTC](https://community.freefem.org/t/what-role-does-poissonboundary-play/2194 "2022-12-17T00:46:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)\
**Post date:** [December 17, 2022, 12:46am UTC](https://community.freefem.org/t/what-role-does-poissonboundary-play/2194/1 "2022-12-17T00:46:21Z")

</div>

Would someone please kindly explain to me how this code works? It comes from the following example in the documentation: [FreeFEM - Poisson](https://modules.freefem.org/modules/poisson/). Particularly, I don’t understand how to interpret the matrix Poisson and PoissonBoundary together in setting up the variational problem that is stated in the documentation.

```auto
// Problem
varf vPoisson (u, uh)
	= int3d(Th)(
		  grad(u)' * grad(uh)
	)
	+ int3d(Th)(
		  f * uh
	)
	+ on(1, 2, 3, 4, 5, 6, u=0)
	;
matrix<real> Poisson = vPoisson(Uh, Uh, solver=sparsesolver);
real[int] PoissonBoundary = vPoisson(0, Uh);
u[] = Poisson^-1 * PoissonBoundary;

```

---

<div class="post-metadata">

**Author:** ![cmd](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/cmd/32/67_2.png) [@cmd](https://community.freefem.org/u/cmd)\
**Post date:** [December 18, 2022, 8:28am UTC](https://community.freefem.org/t/what-role-does-poissonboundary-play/2194/2 "2022-12-18T08:28:14Z")

</div>

Here, `vPoisson` defines the variation form. The syntax `vPoisson(Uh, Uh,...)` tells FreeFEM to create a matrix where the test and trial function spaces are defined by `Uh`. This takes care of the `int3d(Th)(grad(u)'*grad(uh))` part. Conversely, the syntax `vPoisson(0, Uh)` tells FreeFEM to create a vector where the trial functions are evaluated for a test function defined in `Uh`. This takes care of the `int3d(Th)(f*uh)` part. Does that make more sense to you?

---

<div class="post-metadata">

**Author:** ![jsmacd](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jsmacd](https://community.freefem.org/u/jsmacd)\
**Post date:** [December 19, 2022, 4:07pm UTC](https://community.freefem.org/t/what-role-does-poissonboundary-play/2194/3 "2022-12-19T16:07:31Z")

</div>

This is what I had come to suspect, but now I feel sure in my understanding. Thank you, Chris!
