# What role does PoissonBoundary play?

Would someone please kindly explain to me how this code works? It comes from the following example in the documentation: FreeFEM - 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.

// Problem
varf vPoisson (u, uh)
= int3d(Th)(
)
+ 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;

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?

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

1 Like