[petsc-dev] controlling vector values while doing matrix free operations

Philip, Bobby philipb at ornl.gov
Wed Dec 14 20:00:11 CST 2011


Barry:

Thanks. I will take a look at this. I agree that in Newton itself this can end up being a total hack depending on what you choose to implement, however the matvec itself would seem to be a different case though there too the opportunity exists to make a mess of it. Correct me if I am wrong. Thanks for the link - I'll take a look.

Bobby


-----Original Message-----
From: petsc-dev-bounces at mcs.anl.gov [mailto:petsc-dev-bounces at mcs.anl.gov] On Behalf Of Barry Smith
Sent: Wednesday, December 14, 2011 8:55 PM
To: For users of the development version of PETSc
Subject: Re: [petsc-dev] controlling vector values while doing matrix free operations


  Bobby,

    What Matt is trying to tell you is that changing values at this level to prevent function evaluations outside of the function domain inside Newton is a total hack that rarely works well and should be avoided. You really don't want to do this.

    PETSc 3.2 introduced the ability to solve variational inequalities which allow you to define algebraic systems with inequality constraints on variables. See http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESVI.html and http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESVISetVariableBounds.html

   Barry

On Dec 14, 2011, at 7:34 PM, Philip, Bobby wrote:

> Matt:
>  
>  
> From: petsc-dev-bounces at mcs.anl.gov [mailto:petsc-dev-bounces at mcs.anl.gov] On Behalf Of Matthew Knepley
> Sent: Wednesday, December 14, 2011 5:15 PM
> To: For users of the development version of PETSc
> Subject: Re: [petsc-dev] controlling vector values while doing matrix free operations
>  
> On Wed, Dec 14, 2011 at 4:07 PM, Philip, Bobby <philipb at ornl.gov> wrote:
> Hi:
> 
> When doing the following operation in PETSc using FD approximations to a  Jacobian vector product
> 
> J'(u)*a = [J(u+h*a) - J(u)]/h
>  
> Usually, we would put in F where you have J.
>  
> Actually this is taken from PETSc documentation so you may want to modify it. I normally do use F also.
>  
>  
> is there a way for the user to specify that the entries of u+h*a cannot be negative for example?
> Browsing the PETSc documentation it was not obvious whether I could do this.
>  
> You can do whatever you want in your F function, but you should really investigate SNESVI if
> you have bounds on your variables.
>  
> I do indeed control F and u but I do not control h*a. This is determined by PETSc. Hence the possibility
> exists that u+h*a is outside the domain of the function. This is what I would like to control. Being able to
> check whether u+h*a lies in the domain of the function and then potentially modifying it so it does much
> in the flavor of the LineSearchPost and PreCheck functions. Any suggestions?
>  
>   Thanks,
>  
>      Matt
>  
> Thanks,
> Bobby
> 
> 
>  
> -- 
> 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




More information about the petsc-dev mailing list