[petsc-users] Initial estimation on SNES and KSP

2014-09-04 Thread Miguel Angel Salazar de Troya
Dear all

SNES uses internally a KSP to solve the linear system of equations right?
Now the case that we had a linear system of equations that we are solving
with SNES, how could we set the initial estimation for the KSP? If we just
included the option -ksp_initial_guess_nonzero, the KSP will grab the
vector X we passed to the SNES? Thanks in advance.

Miguel

-- 
*Miguel Angel Salazar de Troya*
Graduate Research Assistant
Department of Mechanical Science and Engineering
University of Illinois at Urbana-Champaign
(217) 550-2360
salaz...@illinois.edu


Re: [petsc-users] Initial estimation on SNES and KSP

2014-09-04 Thread Jed Brown
Miguel Angel Salazar de Troya salazardetr...@gmail.com writes:

 Dear all

 SNES uses internally a KSP to solve the linear system of equations right?
 Now the case that we had a linear system of equations that we are solving
 with SNES, how could we set the initial estimation for the KSP? If we just
 included the option -ksp_initial_guess_nonzero, the KSP will grab the
 vector X we passed to the SNES? 

You definitely don't want this for Newton-type methods.  If you have a
nonzero guess for the solution of the linear system, you should have
evaluated the Jacobian at that point.  A zero initial guess is optimal
for Newton-type methods.


pgpz7SreS0X9D.pgp
Description: PGP signature


Re: [petsc-users] Initial estimation on SNES and KSP

2014-09-04 Thread Matthew Knepley
On Thu, Sep 4, 2014 at 12:28 PM, Jed Brown j...@jedbrown.org wrote:

 Miguel Angel Salazar de Troya salazardetr...@gmail.com writes:

  Dear all
 
  SNES uses internally a KSP to solve the linear system of equations right?
  Now the case that we had a linear system of equations that we are solving
  with SNES, how could we set the initial estimation for the KSP? If we
 just
  included the option -ksp_initial_guess_nonzero, the KSP will grab the
  vector X we passed to the SNES?

 You definitely don't want this for Newton-type methods.  If you have a
 nonzero guess for the solution of the linear system, you should have
 evaluated the Jacobian at that point.  A zero initial guess is optimal
 for Newton-type methods.


Notice that Newton is solving for the correction, not the solution itself.

  Matt

-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener