[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: matrix free for linear solver
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: matrix free for linear solver
- From: "Matthew Knepley" <knepley@xxxxxxxxx>
- Date: Mon, 3 Mar 2008 12:22:25 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=37jHs9VBMAkFr1uabeJz6NCYRHNRqQ4C9FBpiYjpxSk=; b=EoShMSomePJdFkGuj+ORDGsXtfndv31icZJhVoKICgBkagYCcaRYQWTR+uBoz9+H7NPmz9oxoG8ad7K1Gv6ZrsgEMuEr6cPxLyXQJUIZVpU3vrd9zmPkAXEHkTz0lSubt/+iWUDuXb1637OrJRsGcHd+MZQH0hPaUm+zX8DwYFg=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=emq2/6um5Nwka/XjSXxII4LhfZRLixc1tzj2u9rAVz9kkvn72A5WmvYl/1YMir3cS7/EwNEUCUCgwqu9YrvTjhhiw5rrzLhvBg3fxxPO0l6cy99ELs60BZ/X/4ZM2GWTIZG6gYp8cnxHNpmcu2OqoDDPQXOcqiMD/9Z85xaT22E=
- In-reply-to: <826323.76252.qm@web36811.mail.mud.yahoo.com>
- References: <a9f269830803030907r4e73c111gb7558bc2755bee75@mail.gmail.com> <826323.76252.qm@web36811.mail.mud.yahoo.com>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
On Mon, Mar 3, 2008 at 12:16 PM, li pan <li76pan@xxxxxxxxx> wrote:
> hi Matt,
> I used to discuss with somebody about SNES for
> nonlinear equation. One can use -snes_mf_operator for
> matrix free calculation. As far as I know, SNES uses a
> Newton-Kryplov Method. In each Newton, one has to
> solve a linear equation, which is :
> residual = Jacobian * delt_u
> If I can solve the linear equation in a iterative way
> in Kryplov space, then I only need to optimise
> Jacobian*delt_u - residual
> The matrix vector multiplication can be expressed
> through the gradient calculation for residual. That's
> why we can forget the Jacobian matrix. The method is
> generally called Jacobian free Newton Kryplov mehtod
> (JFNK). You must know it.
> Actually, that's the way snes works with -snes_mf.
> Here, we define the function SNESSetFunction(). And as
> argument, we give the calculation of residual.
> I wrote so much only because of the continuity of the
> context.
> Now my question is, if the SNES method includes a JFNK
> method to solve the linear equation, why can't I use
> it for my linear equation directly? And how?
The "matrix-free" you refer to above uses a finite difference
approximation to the Jacobian of a nonlinear function. If you
have a linear equation, the Jacobian is THE EQUATION ITSELF.
Thus, what you propose makes no sense to me at all. Again,
I recommend you look at MATSHELL since I think this is what
you want.
Matt
> thanx
>
> pan
>
>
> --- Matthew Knepley <knepley@xxxxxxxxx> wrote:
>
> > On Mon, Mar 3, 2008 at 11:05 AM, li pan
> > <li76pan@xxxxxxxxx> wrote:
> > > Dear all,
> > > If I want to solve a linear equation in matrix
> > free
> > > scheme, how is the command line argument? I only
> > know
> > > for nonlinear solver it is _snes_mf
> >
> > What do you mean here? How do you have linear
> > equations without
> > a matrix? If you mean that you would only like to
> > specify the action
> > of the operator, you should use MATSHELL.
> >
> > Matt
> >
> > > thanx
> > >
> > > pan
> > >
> > >
> > >
> > >
> >
> ____________________________________________________________________________________
> > > Looking for last minute shopping deals?
> > > Find them fast with Yahoo! Search.
> >
> http://tools.search.yahoo.com/newsearch/category.php?category=shopping
> > >
> > >
> >
> >
> >
> > --
> > 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
> >
> >
>
>
>
>
> ____________________________________________________________________________________
> Never miss a thing. Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
>
--
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