<br><div>I just comment out the <span style="color:rgb(35, 31, 32)"><font style="font-size:14.5px"><font style="font-family:Nylas-Pro, Helvetica, "Lucidia Grande", sans-serif">SNESVISetVariableBounds</font></font></span> and <span style="color:rgb(35, 31, 32)"><font style="font-size:14.5px"><font style="font-family:Nylas-Pro, Helvetica, "Lucidia Grande", sans-serif">SNESLineSearchSetVIFunctions. trying to rerun the code, SNES successfully converged, with not active constraint.</font></font></span></div><div><span style="color:rgb(35, 31, 32)"><font style="font-size:14.5px"><font style="font-family:Nylas-Pro, Helvetica, "Lucidia Grande", sans-serif">Amir</font></font></span></div><div class="gmail_quote_attribution">On Aug 18 2018, at 8:48 pm, Matthew Knepley <knepley@gmail.com> wrote:</div><blockquote><br><div><div><div>First dolve the unconstrained problem to make sure that works.</div><div><br></div><div>   Matt</div></div><br><div><div><div>On Sat, Aug 18, 2018, 01:24 Amir <<a href="https://link.getmailspring.com/link/1534600291.local-99f6de16-0c60-v1.4.2-f587b7b7@getmailspring.com/0?redirect=mailto%3Amhbaghaei%40mail.sjtu.edu.cn&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="mailto:mhbaghaei@mail.sjtu.edu.cn">mhbaghaei@mail.sjtu.edu.cn</a>> wrote:</div></div><blockquote><div>I just tried. But it gives me same pattern. After One iteration, it diverges. I am now sure some thing is wrong with my setting.</div><br><div>On Aug 18 2018, at 12:59 pm, Justin Chang <<a href="https://link.getmailspring.com/link/1534600291.local-99f6de16-0c60-v1.4.2-f587b7b7@getmailspring.com/1?redirect=mailto%3Ajychang48%40gmail.com&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="mailto:jychang48@gmail.com">jychang48@gmail.com</a>> wrote:</div><blockquote><br><div><div><div>Have you tried <span style="color:rgb(49, 49, 49)">SNESVINEWTONRSLS? In my experience, I seem to have slightly better luck with that one instead of SNESVINEWTONSSLS</span></div></div><div><br><div><div><div>On Sat, Aug 18, 2018 at 12:56 AM Amir <<a href="https://link.getmailspring.com/link/1534600291.local-99f6de16-0c60-v1.4.2-f587b7b7@getmailspring.com/2?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1534569654.local-a0d70606-12e6-v1.4.2-f587b7b7%40getmailspring.com%2F0%3Fredirect%3Dmailto%253Amhbaghaei%2540mail.sjtu.edu.cn%26recipient%3DcGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/1534569654.local-a0d70606-12e6-v1.4.2-f587b7b7@getmailspring.com/0?redirect=mailto%3Amhbaghaei%40mail.sjtu.edu.cn&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D">mhbaghaei@mail.sjtu.edu.cn</a>> wrote:</div></div><blockquote><div>Hi</div><div>I need to apply constraint to primitive variables. I am troubling to set up SNESVI. After running the code, I feel SNES is not actually solving. After one iteration of SNES, I got DIVERGED_LINESEARCH, with NO changing in function norm.</div><div>I think the way I set VI maybe wrong. Sorry for my simple explanation.</div><div>Very thankful for your time.</div><div>Amir</div><div>SNESCreate(PETSC_COMM_WORLD,&snes);</div><div>SNESSetApplicationContext(snes,&user);</div><div>SNESSetDM(snes,<a href="https://link.getmailspring.com/link/1534600291.local-99f6de16-0c60-v1.4.2-f587b7b7@getmailspring.com/3?redirect=https%3A%2F%2Flink.getmailspring.com%2Flink%2F1534569654.local-a0d70606-12e6-v1.4.2-f587b7b7%40getmailspring.com%2F1%3Fredirect%3Dhttp%253A%252F%252Fuser.dm%26recipient%3DcGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%253D&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D" title="https://link.getmailspring.com/link/1534569654.local-a0d70606-12e6-v1.4.2-f587b7b7@getmailspring.com/1?redirect=http%3A%2F%2Fuser.dm&recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D">user.dm</a>);</div><div>SNESSetFunction(snes,NULL,FormFunction,&user);</div><div>FormInitialSolution(user.X,&user);</div><div>SNESSetSolution(snes,user.X);</div><div>SNESMonitorSet(snes,MySNESMonitor,&user,NULL);</div><div>SNESSetType(snes,SNESVINEWTONSSLS);</div><div>SNESSetNormSchedule(snes, SNES_NORM_ALWAYS);</div><div>SNESVISetVariableBounds(snes,user.XLOWER,user.XUPPER);</div><div>SNESGetLineSearch(snes,&linesearch);</div><div>SNESLineSearchSetType(linesearch,SNESLINESEARCHBT);</div><div>SNESLineSearchSetVIFunctions(linesearch, NULL, SNESNormFunction);</div><div>SNESSetFromOptions(snes);</div><div>SNESSolve(snes,NULL,user.X);</div><div><div><img alt="Open Tracking" width="0" height="0" style="border:0;width:0;height:0" src="https://link.getmailspring.com/open/1534566770.local-ad07529d-23c1-v1.4.2-f587b7b7@getmailspring.com?recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D"></div></div></blockquote></div></div></div></blockquote><div><img alt="Open Tracking" width="0" height="0" style="border:0;width:0;height:0" src="https://link.getmailspring.com/open/1534569654.local-a0d70606-12e6-v1.4.2-f587b7b7@getmailspring.com?recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D"></div></blockquote></div></div></blockquote><img class="mailspring-open" alt="Open Tracking" width="0" height="0" style="border:0; width:0; height:0;" src="https://link.getmailspring.com/open/1534600291.local-99f6de16-0c60-v1.4.2-f587b7b7@getmailspring.com?recipient=cGV0c2MtdXNlcnNAbWNzLmFubC5nb3Y%3D">