From: Derek G. <fri...@gm...> - 2014-12-11 05:23:13
|
Yep - that's exactly what SNESetFunctionDomainError() is for... so you're in luck! On Thu, Dec 11, 2014 at 12:07 AM, Dafang Wang <daf...@jh...> wrote: > Hi Derek, > > Thank you for your suggestions. I am doing a "normal" Newton solve with > SNES. Since my residual vector is prone to explosion, I want to keep > monitoring it and to interrupt SNES when the residual explodes. > > Cheers, > Dafang > > > On 12/10/2014 11:43 PM, Derek Gaston wrote: > > If you're using PETSc and doing a "normal" Newton solve then you can try > to use SNESSetFunctionDomainError() ( > http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/SNES/SNESSetFunctionDomainError.html > ) and then return... and hopefully PETSc will clean up for you. > > However, if you're doing JFNK and that residual evaluation is being done > for a finite differenced mat-vec then there are issues. See this thread: > http://lists.mcs.anl.gov/pipermail/petsc-users/2014-August/022597.html > > Derek > > On Wed, Dec 10, 2014 at 9:57 PM, Kirk, Benjamin (JSC-EG311) < > ben...@na...> wrote: > >> Not sure any of the examples show this, but you can use a usual C++ >> try/catch approach. Just be careful an error is thrown consistently across >> all processors, even if it is identified only on one (or a subset). >> >> >> >> > On Dec 10, 2014, at 8:30 PM, Dafang Wang <daf...@jh...> wrote: >> > >> > Hi, >> > >> > Is there a way to exit a nonlinear-system-solving process from the >> function >> > "residual_and_jacobian()" or "jacobian()" without terminating the >> program? For example, I >> > am dealing with code as follows: >> > >> > //Point A. >> > system.solve(); >> > >> > Then something bad happens in my "system.residual_and_jacobian()" >> function, and I want to >> > return to Point A and proceed. Does libmesh allow such an action? >> > >> > Any suggestions or comments will be appreciated. >> > >> > Thanks, >> > Dafang >> > -- >> > Dafang Wang, Ph.D. >> > Postdoctoral Fellow >> > Institute of Computational Medicine >> > Hackerman Hall, Room 218 >> > Johns Hopkins University, Baltimore, 21218 >> > http://lagniappe.icm.jhu.edu/~dwang/ >> > >> > >> ------------------------------------------------------------------------------ >> > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> > from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> > with Interactivity, Sharing, Native Excel Exports, App Integration & >> more >> > Get technology previously reserved for billion-dollar corporations, FREE >> > >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> > _______________________________________________ >> > Libmesh-users mailing list >> > Lib...@li... >> > https://lists.sourceforge.net/lists/listinfo/libmesh-users >> >> >> ------------------------------------------------------------------------------ >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >> from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> >> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk >> _______________________________________________ >> Libmesh-users mailing list >> Lib...@li... >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> > > > -- > Dafang Wang, Ph.D. > Postdoctoral Fellow > Institute of Computational Medicine > Hackerman Hall, Room 218 > Johns Hopkins University, Baltimore, 21218 > http://lagniappe.icm.jhu.edu/~dwang/ > |