On Wed, 21 Jun 2006, li pan wrote:
> just one simple question. Does it make any difference,
> if solution_in was or was not set to zero before I
> call PetscLinearSolver::solve(...)?
It should. The solution you pass in gets used as the initial iterate
to the solver, and so should be as close to the expected final
solution as possible. That may mean you want to set it to zero (e.g.
if you're solving for the difference between two Newton iterates), but
it may mean you want to leave it set to a previous iterate (e.g. if
you're doing one linear solve for the solution at the next timestep,
or if you're using a nonlinear iteration scheme and solving directly
for the next iterate).