According to About the functions LinearCG a symmetric elimination is possible with tgv=-2, although I never tried myself, and it is not available for the rhs, as far as I remember. On the other hand, the implementation is not that hard; at Exact Dirichlet BC I have presented a naive implementation at the level of FreeFEM itself.

Thanks for your info. So I tried tgv=-2 and it does what you said! Interesting, but this is no where mentioned in the documentation and I would assume it a hidden utility? (But don’t know why hidden )

And tgv=-2 doesn’t do anything on rhs as you said but can do a fix. I don’t like to write too many nested loops in freefem so I do this to implement the rhs needed for the symmetric matrix:

If you look at the two figures in the opening post, MD is just the matrix (a13, a23) and we multiply it by the dirichlet bc values to get the final rhs.

But this is actually a horrible way of doing this, as I am using two extra matrices (MD & MS) to achieve such a simple thing. It would be much much better if the tgv=-2 becomes a built-in feature.

I know it is not proper documentation but the pdf http://jolivet.perso.enseeiht.fr/FreeFem-tutorial/main.pdf might help. Slides 18 to 20 (page 9 of the document) define symetric/nonsymetric elimination and penalization. Slide 34 (page 17 of the document) shows the corresponding values of tgv.