DA Jacobian

Jianing Shi js2615 at columbia.edu
Sun Dec 10 19:57:46 CST 2006


Hi Aron,

I have gone through the spatial kernel part, which was indeed a
dense matrix on the local communicator.  Here for the ADIC, I try
to create the Jacobian for the SNES solver.  Though Matt told me
that ADIC is an advanced functional in the developers' version.

Jianing

Quoting Aron Ahmadia <aja2111 at columbia.edu>:

> Hi Jianing,
>
> You are not using ADIC, this isn't the type of matrix you want to
> create.  You want a dense matrix on the local communicator, not a
> DAAD
> matrix.
>
> ~Aron
>
> On 12/9/06, Jianing Shi <js2615 at columbia.edu> wrote:
> > I just added PETSC_HAVE_ADIC, and seems that the compiler does
> not
> > complain any more.
> >
> >   #if defined(PETSC_HAVE_ADIC)
> >   if (adicmf_jacobian)
> >   {
> >     ierr =
> >
>
DASetLocalAdicMFFunction(user.da,admf_FormFunctionLocal);CHKERRQ(ierr);
> >     ierr = MatRegisterDAAD();CHKERRQ(ierr);
> >     ierr = MatCreateDAAD(user.da,&A);CHKERRQ(ierr);
> >     ierr = MatDAADSetSNES(A,snes);CHKERRQ(ierr);
> >     ierr = MatDAADSetCtx(A,&user);CHKERRQ(ierr);
> >   }
> >   #endif
> >
> > Though what is the trick if I really want to use ADIC?
> >
> > Jianing
> >
> > Quoting Matthew Knepley <knepley at gmail.com>:
> >
> > > Are you really using ADIC?
> > >
> > >   Matt
> > >
> > > On 12/9/06, Jianing Shi <js2615 at columbia.edu> wrote:
> > > > I have a question about creating the jacobian here.
> > > > Here is the code I use to create it.
> > > >
> > > > -------------------------------------------------------
> > > >   ierr = DAGetMatrix(user.da,MATAIJ,&J);CHKERRQ(ierr);
> > > >   A = J;
> > > >
> > > >   ierr =
> > > >
> > >
> >
>
DASetLocalAdicMFFunction(user.da,admf_FormFunctionLocal);CHKERRQ(ierr);
> > > >   ierr = MatRegisterDAAD();CHKERRQ(ierr);
> > > >   ierr = MatCreateDAAD(user.da,&A);CHKERRQ(ierr);
> > > >   ierr = MatDAADSetSNES(A,snes);CHKERRQ(ierr);
> > > >   ierr = MatDAADSetCtx(A,&user);CHKERRQ(ierr);
> > > > ------------------------------------------------------
> > > >
> > > > I included the head files
> > > > petscsnes.h    petscda.h
> > > >
> > > > When I compile it, I got the following linking error:
> > > >
> > > > ld: Undefined symbols:
> > > > _MatCreateDAAD
> > > > _MatDAADSetCtx
> > > > _MatDAADSetSNES
> > > > _MatRegisterDAAD
> > > > make: [paraImplicitV1] Error 1 (ignored)
> > > >
> > > > Not sure what went wrong.
> > > >
> > > > Jianing
> > > >
> > > >
> > >
> > >
> > > --
> > > "Failure has a thousand explanations. Success doesn't need
> one"
> > > -- Sir
> > > Alec Guiness
> > >
> > >
> >
> >
> >
>





More information about the petsc-users mailing list