# Matrix-vector multiplication in weak formulation

**URL:** <https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449>\
**Category:** General Discussion\
**Created:** [May 31, 2020, 3:14pm UTC](https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449 "2020-05-31T15:14:04Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![Lee](https://avatars.discourse-cdn.com/v4/letter/l/bc8723/32.png) [@Lee](https://community.freefem.org/u/Lee)\
**Post date:** [July 29, 2020, 1:29am UTC](https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449/28 "2020-07-29T01:29:47Z")

</div>

Thans for your timely reply.

I have found that in the definition of funcRes and funcJ, “tgv” is used in the vector and matrix forming such as “Loc = vPb(Wh, Wh, tgv = -2)” in SNESSolve. The tgv in FreeFem++ is always represent 1e30 to implement Dirichlet boundary conditions and in most situation can be neglected.

So is it necessary to define funcRes and funcJ with the form “Loc = vPb(Wh, Wh, tgv = -2)” or with the form in which tgv can be neglected as “Loc = vPb(Wh, Wh)”?

If correct form is Loc = vPb(Wh, Wh, tgv = -2), which value of tgv should be used, -1, -2 or 1e30 and why?

Thank you.

---

_[View the full topic](https://community.freefem.org/t/matrix-vector-multiplication-in-weak-formulation/449)._
