Convergence flags in linear solvers #204

merged 1 commit into from Feb 21, 2014


None yet
3 participants

danac commented Feb 14, 2014

This implements a getter in the linear solver classes (LinearSolver::get_converged_reason()) which returns a flag indicating the convergence status of the solver.

The flags are inspired by PETSc's, and gathered in an enum which aims at being generic in the future, defined in include/enums/enum_convergence_flags.h

The LinearSolver::print_converged_reason() method is updated to make use of this new enum in conjunction with Utility::enum_to_string().

PETSc is the only backend for which the getter is currently implemented (in the other solvers libmesh_not_implemented() is called).


dknez commented Feb 15, 2014

This looks good to me. It'll be nice to be able to check linear solver convergence programmatically (having to use -ksp_converged_reason and read through stdout isn't very convenient...)

Dana, one comment: I suggest you move print_converged_reason() up to LinearSolver as well.


danac commented Feb 17, 2014

I moved print_converged_reason() to the base class and squashed/rebased the branch.


friedmud commented Feb 18, 2014

Were you planning on doing the same for the Nonlienar solver? If we're going to do one - we should do both so they are consistent...

Other than that - this is looking good.


dknez commented Feb 18, 2014

There's already an enum in DiffSolver for the nonlinear case, so I don't think Dana wanted to mess with that.

Perhaps it'd best if one of the FEMSystem experts refactors the code for the nonlinear case (e.g. move the DiffSolver enum into enum_convergence_flags.h)? I'd suggest we merge this pull request first and then deal with the nonlinear case.


dknez commented Feb 20, 2014

I'll go ahead and merge this now, unless there are any objections? (I agree about updating the nonlinear flags, but I think that can be done in a separate PR, since it'll involve changing some existing DiffSolver code)

dknez added a commit that referenced this pull request Feb 21, 2014

Merge pull request #204 from danac/convergence_flags
Convergence flags in linear solvers

@dknez dknez merged commit 44f346e into libMesh:master Feb 21, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment