[petsc-users] snes_type aspin error

Xiangdong epscodes at gmail.com
Thu Jun 23 13:36:45 CDT 2016


Hi Barry and Matt,

The behavior I reported before can be reproduced with snes example ex18.

http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex18.c.html

./ex18 -sens_type aspin -snes_fd_color is okay;

./ex18 -snes_type aspin crashes.

So there is something messed up in the function  FormJacobian(SNES snes,Vec
X,Mat jac,Mat jacpre,void *ptr).

If the analytical Jacobian is calculated and put into the matrix jac (like
ex18.c), the program crash with the aspin option. However, if the same
analytical Jacobian is put into jacpre (like ex20.c), it works fine with
the aspin option.

In general, for the analytical Jacobian, should I put it into jac or jacpre
in the FormJaciban() function?

Thanks.

Best,
Xiangdong




On Mon, Jun 20, 2016 at 9:51 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
>   Could you reproduce the error with a PETSc example or send us the code?
> If we can run a code that generates an error then we can debug it and maybe
> fix it. If we can't run something with the same error it is hard for us to
> fix it. We'd just be making wild guesses.
>
>   Barry
>
> > On Jun 20, 2016, at 8:06 PM, Xiangdong <epscodes at gmail.com> wrote:
> >
> >
> >
> > On Mon, Jun 20, 2016 at 1:02 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> >    Are you providing a shell matrix to the solver?
> >
> > No. The matrix (global Jacobian) is setup by MatSetValuesStencil. It
> works for the standard newtonls as well as nasm preconditioner. I think the
> aspin will assemble the new Jacobian for me based on the information of old
> Jacobian.
> >
> > Do I need to provide something special to use the aspin?
> >
> > Thanks.
> >
> > Best,
> > Xiangdong
> >
> >  Barry
> >
> > > On Jun 20, 2016, at 11:32 AM, Xiangdong <epscodes at gmail.com> wrote:
> > >
> > > Hello everyone,
> > >
> > > I am trying different snes_type in petsc. The newtonls and nasm all
> works well. However, when I switched to aspin, I got the error like "No
> support for this operation for this object type" "Mat type shell". I am
> using the dmda 3d in petsc 3.6.3. The full error messages are below.
> > >
> > > Any hint for me to fix this? Thanks.
> > >
> > > Best,
> > > Xiangdong
> > >
> > > [0]PETSC ERROR: --------------------- Error Message
> --------------------------------------------------------------
> > > [0]PETSC ERROR: No support for this operation for this object type
> > > [0]PETSC ERROR: Mat type shell
> > > [0]PETSC ERROR: See
> http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting.
> > > [0]PETSC ERROR: Petsc Release Version 3.6.3, unknown
> > > [0]PETSC ERROR: #1 MatZeroEntries() line 5404 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/mat/interface/matrix.c
> > > [0]PETSC ERROR: #2 FormJacobianLocal() line 37 in
> /home/MyCodes/epscprplus/Jacobian.c
> > > [0]PETSC ERROR: #3 SNESComputeJacobian_DMDA() line 175 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/utils/dmdasnes.c
> > > [0]PETSC ERROR: #4 SNESComputeJacobian() line 2232 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/interface/snes.c
> > > [0]PETSC ERROR: #5 SNESNASMComputeFinalJacobian_Private() line 770 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/impls/nasm/nasm.c
> > > [0]PETSC ERROR: #6 SNESSolve_NASM() line 888 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/impls/nasm/nasm.c
> > > [0]PETSC ERROR: #7 SNESSolve() line 3906 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/interface/snes.c
> > > [0]PETSC ERROR: #8 SNESApplyNPC() line 48 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/interface/snespc.c
> > > [0]PETSC ERROR: #9 SNESSolve_NEWTONLS() line 173 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/impls/ls/ls.c
> > > [0]PETSC ERROR: #10 SNESSolve() line 3906 in
> /home/shared/MyLocal_stor/petsc/petsc-dev/src/snes/interface/snes.c
> > > [0]PETSC ERROR: #11 main() line 794 in
> /home/MyCodes/epscprplus/twophaseow.c
> > >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20160623/83f29287/attachment.html>


More information about the petsc-users mailing list