[petsc-users] SNESVINEWTONRSLS: definition of active set?

Asbjørn Nilsen Riseth riseth at maths.ox.ac.uk
Fri May 29 19:09:05 CDT 2015


Hey Barry,

thanks for the offer to have a look at the code. I ran SNESTEST today:
user-defined failed, 1.0 and -1.0 seemed to work fine. My first step will
have to be to find out what's wrong with my jacobian. If I've still got
issues after that, I'll try to set up an easy-to-experiment code

The code is a DG0 FVM formulation set up in Firedrake (a "fork" of FEniCS).
I was assuming UFL would sort the Jacobian for me.
Lesson learnt: always do a SNESTEST.


Ozzy

On Fri, 29 May 2015 at 19:21 Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> > On May 29, 2015, at 4:19 AM, Asbjørn Nilsen Riseth <
> riseth at maths.ox.ac.uk> wrote:
> >
> > Barry,
> >
> > I changed the code, but it only makes a difference at the order of 1e-10
> - so that's not the cause. I've attached (if that's appropriate?) the patch
> in case anyone is interested.
> >
> > Investigating the function values, I see that the first Newton step goes
> towards the expected solution for my function values. Then it shoots back
> close to the initial conditions.
>
>    When does it "shoot back close to the initial conditions"? At the
> second Newton step? If so is the residual norm still smaller at the second
> step?
>
> > At the time the solver hits tolerance for the inactive set; the function
> value is 100-1000 at some of the active set indices.
> > Reducing the timestep by an order of magnitude shows the same behavior
> for the first two timesteps.
> >
> > Maybe VI is not the right approach. The company I work with seem to just
> be projecting negative values.
>
>    The VI solver is essentially just a "more sophisticated" version of
> "projecting negative values" so should not work worse then an ad hoc method
> and should generally work better (sometimes much better).
>
>    Is your code something simple you could email me to play with or is it
> a big application that would be hard for me to experiment with?
>
>
>
>   Barry
>
> >
> > I'll investigate further.
> >
> > Ozzy
> >
> >
> > On Thu, 28 May 2015 at 20:26 Barry Smith <bsmith at mcs.anl.gov> wrote:
> >
> >   Ozzy,
> >
> >      I cannot say why it is implemented as >=  (could be in error). Just
> try changing the PETSc code (just run make gnumake in the PETSc directory
> after you change the source to update the library) and see how it affects
> your code run.
> >
> >    Barry
> >
> > > On May 28, 2015, at 3:15 AM, Asbjørn Nilsen Riseth <
> riseth at maths.ox.ac.uk> wrote:
> > >
> > > Dear PETSc developers,
> > >
> > > Is the active set in NewtonRSLS defined differently from the
> reference* you give in the documentation on purpose?
> > > The reference defines the active set as:
> > > x_i = 0 and F_i > 0,
> > > whilst the PETSc code defines it as x_i = 0 and F_i >= 0 (vi.c: 356) :
> > > !((PetscRealPart(x[i]) > PetscRealPart(xl[i]) + 1.e-8 ||
> (PetscRealPart(f[i]) < 0.0)
> > > So PETSc freezes the variables if f[i] == 0.
> > >
> > > I've been using the Newton RSLS method to ensure positivity in a
> subsurface flow problem I'm working on. My solution stays almost constant
> for two timesteps (seemingly independent of the size of the timestep),
> before it goes towards the expected solution.
> > > From my initial conditions, certain variables are frozen because x_i =
> 0 and f[i] = 0, and I was wondering if that could be the cause of my issue.
> > >
> > >
> > > *:
> > > - T. S. Munson, and S. Benson. Flexible Complementarity Solvers for
> Large-Scale Applications, Optimization Methods and Software, 21 (2006).
> > >
> > >
> > > Regards,
> > > Ozzy
> >
> > <0001-Define-active-and-inactive-sets-correctly.patch>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20150530/cdbe4c75/attachment-0001.html>


More information about the petsc-users mailing list