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) <
[email protected]> 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 <[email protected]> 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
> > [email protected]
> > 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to