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.