Matt, > There is a misunderstanding. The application context is separate from both > the Function context and the Jacobian context.
If the object completely belongs to the user, can I use this function to pass on pointers to my user objects ? Or is there some advanced usage that would conflict with this procedure ? Alternately I did try using SetFunction/Jacobian() already followed by SetFromOptions and it does pass the correct user context as expected. The glitch in this path is that even when I have -snes_mf, my Jacobian function is being called with a MFFD Mat type. And hence, I get an error there while trying to manipulate it. I should note that the first time I use my SNES object, the Jacobian is never called. It happens only after I set the Jacobian again. Please do let me know if the first method or the second one would be a good choice and the workaround needed to get it working. Thanks. 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 > > > > 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 > > > > > > > > > > -- > 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 incoming message. > Checked by AVG. > Version: 7.5.519 / Virus Database: 269.22.0/1342 - Release Date: 3/25/2008 > 10:26 AM > 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
