[petsc-users] A number of questions about DMDA with SNES and Quasi-Newton methods
Barry Smith
bsmith at mcs.anl.gov
Mon Sep 4 16:33:25 CDT 2017
> On Sep 4, 2017, at 4:09 PM, zakaryah . <zakaryah at gmail.com> wrote:
>
> OK that is super helpful. Just to be sure - for MxNxP, the row r in the Jacobian is at r.i*P*N*3 + r.j*P*3 + r.k*3 + r.c?
It is that way, or the other way around r.k*M*N*3 + r.j*N*3 + r.k*3 + r.c
>
>
> On Mon, Sep 4, 2017 at 4:58 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
> > On Sep 4, 2017, at 3:48 PM, zakaryah . <zakaryah at gmail.com> wrote:
> >
> > One piece of information that would be useful is what ordering PETSc uses for the Jacobian in the snes_test_display. Is it a natural ordering, or the PETSc ordering? For debugging the Jacobian manually, the natural ordering is much easier to work with.
>
> What is displayed is always the natural ordering (internally it is not the natural ordering).
>
> > For -n 1, are the orderings the same?
>
> yes
>
>
>
> >
> > If I use a MatStencil r to represent a field with 3 degrees of freedom, and the dimensions of my 3D DMDA are MxNxP, which row of the Jacobian corresponds to r.i=x, r.j=y, r.k=z, r.c=f?
>
> Internally it is complicated but for any viewing it is just the natural ordering and all the degrees of freedom for a single point are next to each other in the vector/matrix.
>
>
More information about the petsc-users
mailing list