[petsc-users] SNES function domain error
Barry Smith
bsmith at mcs.anl.gov
Thu Dec 3 18:48:40 CST 2015
> On Dec 3, 2015, at 6:22 PM, Adrian Croucher <a.croucher at auckland.ac.nz> wrote:
>
> hi
>
> On 03/12/15 18:43, Barry Smith wrote:
>> I absolutely do NOT recommend doing variable switching with SNES. Our Newton solvers are not designed with variable switching in mind so you get these absurd limitations like needing SNESLINESEARCHBASIC
>>
>> It would be great if someone who understood variable switching would either 1) contribute a Newton that supports variable switching to PETSc or 2) enhance the current SNESSolve_NewtonLS to support variable switching (I don't know which is easier).
>
> I had resigned myself to not being able to use a line search, partly because the nonlinear solver in the TOUGH2 simulator (which we've used for many years to solve geothermal flow problems with phase changes and variable switching) doesn't use one either, and it generally works fine without one. Without the line search, SNES is doing much the same thing and doesn't seem to be upset by the variable switching either. It's only the error handling that's causing trouble.
>
> But also I couldn't really see how a line search could be made to work with variable switching. When you switch variables, you're effectively doing a discontinuous leap into another part of the solution space. How can searching along a line between the old phase conditions and the new ones be made to make sense? Are there literature examples where people have done it?
These are hard questions (at least to me) which is why I've never been able to implement a full featured Newton with variable switching.
Switching variables between function evaluations in a line search is completely nuts which is why I envision a "full featured" Newton with variable switching to be somewhat (or a lot) like active set (also called reduced space) Newton methods. Basically freeze the variables (not allow switching them) and build the Newton correction including a full line search in a subspace that wouldn't violate any "bounds" on the variables. Then after this Newton step you decide if certain variables should be switched, and then you do the next full featured Newton step. So instead of freely switching variables at each function evaluation you only switch them at each "Jacobian" evaluation.
There is some PETSc code SNESSolve_VINEWTONRSLS that solves nonlinear equations with bounds on some or all variables; but in this case there are not all the complications of variable switching, basically when variables are on the bound you just "turned off" the related equation. So it is possible that it is a very special case of what is needed for variable switching.
Actually if you could provide a simple case of where variable switching is using I'd like to try to develop some algorithms, so far when I ask people they give me a big messy things with many variables that I could never understand.
Barry
>
> Cheers, Adrian
>
> --
> Dr Adrian Croucher
> Senior Research Fellow
> Department of Engineering Science
> University of Auckland, New Zealand
> email: a.croucher at auckland.ac.nz
> tel: +64 (0)9 923 84611
>
More information about the petsc-users
mailing list