We have this (a huge enum) in MOOSE already.

Here's what we're currently using:

enum MooseNonlinearConvergenceReason
{
  MOOSE_NONLINEAR_ITERATING      = 0,
  MOOSE_CONVERGED_FNORM_ABS      = 2,
  MOOSE_CONVERGED_FNORM_RELATIVE = 3,
  MOOSE_CONVERGED_SNORM_RELATIVE = 4,
  MOOSE_DIVERGED_FUNCTION_COUNT  = -2,
  MOOSE_DIVERGED_FNORM_NAN       = -4,
  MOOSE_DIVERGED_LINE_SEARCH     = -6
};

// The idea with these enums is to abstract the reasons for
// convergence/divergence, i.e. they could be used with linear algebra
// packages other than PETSc.  They were directly inspired by PETSc,
// though.  This enum could also be combined with the
// MooseNonlinearConvergenceReason enum but there might be some
// confusion (?)
enum MooseLinearConvergenceReason
{
  MOOSE_LINEAR_ITERATING                =  0,
  // MOOSE_CONVERGED_RTOL_NORMAL        =  1,
  // MOOSE_CONVERGED_ATOL_NORMAL        =  9,
  MOOSE_CONVERGED_RTOL                  =  2,
  MOOSE_CONVERGED_ATOL                  =  3,
  MOOSE_CONVERGED_ITS                   =  4
  // MOOSE_CONVERGED_CG_NEG_CURVE       =  5,
  // MOOSE_CONVERGED_CG_CONSTRAINED     =  6,
  // MOOSE_CONVERGED_STEP_LENGTH        =  7,
  // MOOSE_CONVERGED_HAPPY_BREAKDOWN    =  8,
  // MOOSE_DIVERGED_NULL                = -2,
  // MOOSE_DIVERGED_ITS                 = -3,
  // MOOSE_DIVERGED_DTOL                = -4,
  // MOOSE_DIVERGED_BREAKDOWN           = -5,
  // MOOSE_DIVERGED_BREAKDOWN_BICG      = -6,
  // MOOSE_DIVERGED_NONSYMMETRIC        = -7,
  // MOOSE_DIVERGED_INDEFINITE_PC       = -8,
  // MOOSE_DIVERGED_NANORINF            = -9,
  // MOOSE_DIVERGED_INDEFINITE_MAT      = -10
};


You can see that we're not really using all of those linear ones yet.

Feel free to swipe these and build on them for the official set in
libMesh...

Derek



On Wed, Feb 12, 2014 at 9:10 AM, Dana Christen <dana.chris...@akselos.com>wrote:

> Hehe ok sounds good! I'll probably start with some PETSc-specific fix for
> the time being. I'll get back to you when I have a generic patch.
>
> Cheers,
> Dana
>
>
> On Wed, Feb 12, 2014 at 5:05 PM, Roy Stogner <royst...@ices.utexas.edu>wrote:
>
>>
>> On Wed, 12 Feb 2014, Dana Christen wrote:
>>
>>  I need a way to retrieve the "convergence reason" flag provided by the
>>> PETSc iterative solvers from libMesh. Currently, the only way to access
>>> this information is to print it with 
>>> PetscLinearSolver::print_converged_reason(),
>>> which is not very convenient. I've been thinking about extending
>>> the libMesh interface to provide this information: an enum and a getter
>>> in LinearSolver typically.
>>>
>>> It would be good to have a list of convergence flags that make sense for
>>> all the solvers available in libMesh.
>>>
>>> Would such an interface make sense in libMesh?
>>>
>>
>> It's on my own to-do list, but buried so far down that I don't expect
>> to ever get to it myself.  I'd love to see a patch.
>> ---
>> Roy
>>
>
>
>
> ------------------------------------------------------------------------------
> Android apps run on BlackBerry 10
> Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
> Now with support for Jelly Bean, Bluetooth, Mapview and more.
> Get your Android app in front of a whole new audience.  Start now.
>
> http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
> _______________________________________________
> Libmesh-devel mailing list
> Libmesh-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel
>
>
------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to