[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: SNESSetApplicationContext usage
- To: <petsc-users@xxxxxxxxxxx>
- Subject: RE: SNESSetApplicationContext usage
- From: "Vijay S. Mahadevan" <vijay.m@xxxxxxxxx>
- Date: Tue, 25 Mar 2008 21:31:45 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole; bh=LP/RgrMQ0YL6C61/exGUz61oXGod8/9qHQiaXMLgpYU=; b=FmKs7W4cJH+CwBRh/KrASVyHTA+n1yEE0m8LIgaxqFhYPhG7ReLG3PCaEgmidbA+1xOus9B8Qd0MGusNjekr31Lm61hk2tfI4lzZthEgXjbP23mk541ZI8J8r+CixwezLf0acIllzKlmbC1je5goeHtvpwB0NTOWFWD2r+ortvI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=from:to:subject:date:message-id:mime-version:content-type:content-transfer-encoding:x-mailer:in-reply-to:thread-index:x-mimeole; b=qDq5QBMGscaSyRyuM4MB2KJy43SHY5a56nnpn25+1MrQeZ1pDXUVviZhhU2lrq7Rm7i49AhqFPT40Vw56WGBDCgzMoRrldkPF5NJXfqhHh2uIwyrC7U33AsOSa2M69H7DhtD0JWhK2dPwKvf2GA2OS0A8RBONhlLbgseCdI8978=
- In-reply-to: <a9f269830803251915t76e94f63pbe1c2a866738e0e4@mail.gmail.com>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
- Thread-index: AciO52MGMpnN/frjQ2CNdmS6PvwtgQAAPk3w
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@xxxxxxxxxxx [mailto:owner-petsc-users@xxxxxxxxxxx]
> On Behalf Of Matthew Knepley
> Sent: Tuesday, March 25, 2008 9:16 PM
> To: petsc-users@xxxxxxxxxxx
> Subject: Re: SNESSetApplicationContext usage
>
> On Tue, Mar 25, 2008 at 8:54 PM, Vijay S. Mahadevan <vijay.m@xxxxxxxxx>
> 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