On Thu, Sep 15, 2016 at 1:29 PM, Roy Stogner <[email protected]>
wrote:

>
> On Thu, 15 Sep 2016, Sahai, Amal wrote:
>
> > I thought of directly accessing the ksp/pc object via ksp() or pc()
> > and setting the correct options right before I solve the linear
> > system. But my fear is would the Petsclinearsolver reformat the ksp
> > / pc object when it executes solve.
>
> There's no complete reformatting, but the few things that we have a
> libMesh level interface for get set during the solve:
> KSPSetTolerances(), KSPSetReusePreconditioner().
>
> > So, I guess my next question would be where should I set these
> > options, does doing them before a call to solve is made makes sense?
>
> In theory, any time after the solver object is created and before the
> solve should be safe.
>
> In practice, double check and if anything doesn't "stick" then please
> file a bug report.
>


FYI, I use SolverConfiguration objects to do this kind of thing. See
systems_of_equations_ex6, for example. The idea is that you attach a
subclass of a SolverConfiguration to a solver, and then the solver will
call the overloaded configure_solver() method at the appropriate time for
you.

David
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to