Hi,<br><br>I know that I should call PetscViewerDestroy() when I have done with each<br>
viewer. But if I called this I just can view the last Matrix and vector. What I want<br>to do is that I let it do three steps of SNES, view the jacobian of each step.<br>I found that A*x is correct at the first step and it's wrong for the second and <br>
third step. <br>I also tried using the binary output and input, and it has the same results.<br><br>But If I destroy the matrix A after the first SNES, recreate it and then do the <br>second and third SNES, it will be alright. Thanks.<br>
<br>Best,<br><br>Rongliang<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Tue, 30 Nov 2010 09:29:17 +0100<br>
From: Jed Brown <jed@59A2.org><br>
Subject: Re: [petsc-users] petsc-users Digest, Vol 23, Issue 32<br>
To: PETSc users list <<a href="mailto:petsc-users@mcs.anl.gov" target="_blank">petsc-users@mcs.anl.gov</a>><br>
Message-ID:<br>
<<a href="mailto:AANLkTinOWxSWHvgxAefqv1Sp5es9ao24qnrH53zAepvq@mail.gmail.com" target="_blank">AANLkTinOWxSWHvgxAefqv1Sp5es9ao24qnrH53zAepvq@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
On Tue, Nov 30, 2010 at 03:26, Rongliang Chen <<a href="mailto:rongliang.chan@gmail.com" target="_blank">rongliang.chan@gmail.com</a>>wrote:<br>
<br>
> [A,x,y] = PetscBinaryRead('binaryoutput'), can this command load<br>
> the binary files into matlab matrix and vector?<br>
><br>
<br>
Yes, this reads the binary files. You will need to add<br>
$PETSC_DIR/bin/matlab to your path (see "help addpath").<br>
<br>
You should also call PetscViewerDestroy() when you are done with each<br>
viewer. In the source you quoted, this is never called.<br>
<br>
Jed<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <<a href="http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101130/c1eb3531/attachment-0001.htm" target="_blank">http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101130/c1eb3531/attachment-0001.htm</a>><br>
<br>
------------------------------<br>
<br>
</blockquote></div><br>