Matt, The first method from my previous email works fine. If I use SNES(Set/Get)ApplicationContext, I can store and retrieve user objects from the SNES object. And this is what I wanted.
Thanks for the help and clarifying my mistake. Vijay > -----Original Message----- > From: owner-petsc-users at mcs.anl.gov [mailto:owner-petsc-users at > mcs.anl.gov] > On Behalf Of Matthew Knepley > Sent: Tuesday, March 25, 2008 9:16 PM > To: petsc-users at mcs.anl.gov > Subject: Re: SNESSetApplicationContext usage > > On Tue, Mar 25, 2008 at 8:54 PM, Vijay S. Mahadevan <vijay.m at gmail.com> > wrote: > > Hi, > > > > I am trying to use the SNESSetApplicationContext function to set an > object > > as a user application context. This is being done after the SNESSolve > was > > already called once on the SNES object, using a NULL application > context. > > > > For some reason, after the SNESSetApplicationContext call, the > application > > context on SNES is not being set. I am wondering if maybe I need to set > some > > flag to tell the SNES object to include this new context in further > residual > > and Jacobian calls. I saw the code for the SNESSetApplicationContext > > function and it doesn't look like it but may be I am missing something > ? > > There is a misunderstanding. The application context is separate from both > the > Function context and the Jacobian context. If you want to change these, > you > must call SetFunction/Jacobian() again. > > Matt > > > Thanks for the help. > > > > Vijay > > > > > -- > 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 > No virus found in this outgoing message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 10:26 AM
