Thanks all,<div><br></div><div>Btw, does Tao's Hessian evaluation routines also "cheat" the way the Jacobian routines do? Or is it fine to supply the Hessian only once (assume it is independent of the solution)?</div><div><br></div><div>Thanks,</div><div>Justin<br><br>On Monday, June 27, 2016, Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
There is the same issue with ODE integrators for linear problems. The solvers tromp on the Jacobian.<br>
<br>
We should actually add an error indicator in these TAO/TS solvers, if the "Jacobian" state value is not increased in the next time step/iteration this means the person did not supply the new Jacobian (in other words the Jacobian is still whatever it was tromped to) so the solver should error out and tell the user their mistake.<br>
<br>
<br>
Barry<br>
<br>
<br>
<br>
> On Jun 27, 2016, at 1:41 PM, Munson, Todd <<a href="javascript:;" onclick="_e(event, 'cvml', 'tmunson@mcs.anl.gov')">tmunson@mcs.anl.gov</a>> wrote:<br>
><br>
><br>
> Hi Justin,<br>
><br>
> I will have to look regarding the TAO semismooth solvers. The TAO<br>
> solvers probably "cheated" and modified the Jacobian matrix rather<br>
> than extracting submatrices and shifting the diagonal or using a<br>
> matrix-free version.<br>
><br>
> Note: the TAO interior-point and semismooth methods start from an element<br>
> of the generalized Jacobian matrix for a semismooth reformulation of<br>
> the VI problem. This generalization Jacobian is a diagonal<br>
> perturbation to a scale version of the Jacobian you input.<br>
> If we cheat and modify the matrix, then it needs to be<br>
> filled back in during a Jacobian evaluation.<br>
><br>
> At some point, the plan was to move all the VI methods into PETSc proper,<br>
> but we may have stopped with the active-set (ASLS) method because that<br>
> tends to have the best performance for PDE-related problems.<br>
><br>
> Todd.<br>
><br>
>> On Jun 27, 2016, at 12:37 PM, Justin Chang <<a href="javascript:;" onclick="_e(event, 'cvml', 'jychang48@gmail.com')">jychang48@gmail.com</a>> wrote:<br>
>><br>
>> So I figured it out. I had to explicitly form the Tao Gradient/Constraints and Jacobian. I couldn't just "pre-process" the gradient Vec and Jacobian Mat through SNESComputeXXX. Attached is the updated file and makefile.<br>
>><br>
>> My question now is, why exactly is this the case? This preprocessing strategy seemed to work for bounded constrained optimization solvers (e.g., TRON/BLMVM) but apparently not with the MCP ones. The system is linear so my original reasoning was that the Jacobian shouldn't change, thus it just needs to be assembled once. I recall faintly from a previous discussion that the SNESVI solvers will vary the Mat and Vec sizes depending on the regions that need to be "constrained" or something?<br>
>><br>
>> Thanks,<br>
>> Justin<br>
>><br>
>> On Sun, Jun 26, 2016 at 5:03 AM, Barry Smith <<a href="javascript:;" onclick="_e(event, 'cvml', 'bsmith@mcs.anl.gov')">bsmith@mcs.anl.gov</a>> wrote:<br>
>><br>
>> I wish I could answer this but I am weak on these algorithms. Hopefully Todd has a good understanding of their application and strengths and weaknesses.<br>
>><br>
>> Barry<br>
>><br>
>>> On Jun 25, 2016, at 3:31 PM, Justin Chang <<a href="javascript:;" onclick="_e(event, 'cvml', 'jychang48@gmail.com')">jychang48@gmail.com</a>> wrote:<br>
>>><br>
>>> Hi all,<br>
>>><br>
>>> So I modified SNES ex9.c so that one has the option to use TAO's complementarity solvers for this problem. Attached is the file.<br>
>>><br>
>>> I expect the TAO solvers to behave the same as the SNESVI ones, but I am having the same issues as before - SSILS and SSFLS do not work whatsoever but for some reason ASILS and ASFLS work. Although the latter two produce the same results as the SNES VI counterparts, they converge much slower, and something tells me I am not doing something correctly. Based on what I have seen from the two TAO complementarity examples, I would also expect the AS and SS solvers to be roughly the same.<br>
>>><br>
>>> BTW, in the modified code, I made some "shortcuts." Instead of explicitly forming the Tao versions of the Gradient and Jacobian, I first assemble the residual r and Jacobian J through the SNESComputeXXX functions. Then I pass them into the TaoSetConstraints and TaoSetJacobian routines. Because this is a linear system, I have:<br>
>>><br>
>>> f = r - J*u^0<br>
>>> gradient g = J*u - f = J*(u + *u^0) + r<br>
>>><br>
>>> were u^0 is the initial vector. I am not sure if this "shortcut" has anything to do with the issue at hand. Attached is the makefile which has instructions on how to run the problem.<br>
>>><br>
>>> Any ideas what is going on??<br>
>>><br>
>>> Thanks!<br>
>>> Justin<br>
>>><br>
>>> On Wed, Jun 22, 2016 at 9:42 PM, Ed Bueler <<a href="javascript:;" onclick="_e(event, 'cvml', 'elbueler@alaska.edu')">elbueler@alaska.edu</a>> wrote:<br>
>>> Justin --<br>
>>><br>
>>> Yeah, good point. SNESVISetVariableBounds() works fine, at least in ex9.c (see attached patch). The reason for the other choice, which I found in my 5 year old email, was some bug in petsc3.2.<br>
>>><br>
>>> Ed<br>
>>><br>
>>> Date: Wed, 22 Jun 2016 08:42:33 +0100<br>
>>> From: Justin Chang <<a href="javascript:;" onclick="_e(event, 'cvml', 'jychang48@gmail.com')">jychang48@gmail.com</a>><br>
>>> To: petsc-users <<a href="javascript:;" onclick="_e(event, 'cvml', 'petsc-users@mcs.anl.gov')">petsc-users@mcs.anl.gov</a>><br>
>>> Subject: [petsc-users] SetVariableBounds vs ComputeVariableBounds<br>
>>><br>
>>> Hi all,<br>
>>><br>
>>> I am looking at the SNES tutorials ex9.c and ex58.c and am wondering why<br>
>>> SNESVISetComputeVariableBounds() is called instead of just<br>
>>> SNESVISetVariableBounds(). When would it be appropriate to use only using<br>
>>> the latter?<br>
>>><br>
>>> Thanks,<br>
>>> Justin<br>
>>><br>
>>> <ex9_TAO.c><makefile><br>
>><br>
>><br>
>> <ex9_TAO.c><makefile><br>
><br>
<br>
</blockquote></div>