I've done something similar to this. You'll need to catch the error the
solver throws (ConvergenceFailure, I think, double check), then reset the
solution to your cached, good solution. This can be done by grabbing the
solution vector from the system. Don't forget to close() the solution
vector once you're done reseting.

HTH,

Paul


On Tue, Jan 14, 2014 at 7:03 PM, Dafang Wang <dafang.w...@jhu.edu> wrote:

> Hi folks,
>
> Does anyone know how to set the initial guess solution of a nonlinear
> system from a known vector? My code is in the following manner:
>
> NonlinearImplicitSystem system.
> Vector v1 = system.current_solution();  //Step1
> system.solve();
> if the nonlinear solve diverges
>    Reset system.current_solution by using v1;  //Step 2
> end
>
> I am not sure how to implement steps #1 and #2.
>
> My situation is: if the nonlinear solve fails to converge, the partial
> solution will be a bad starting point for me to solve the system again,
> because the system is unstable. As such, I would like to book keep the last
> good solution before doing a solve and, if the solve fails, I will be able
> to reset the system.
>
> Any suggestions will be greatly appreciated.
>
> Cheers,
> 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/
>
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> Libmesh-users mailing list
> Libmesh-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to