On Wed, 23 Feb 2011, Roman Vetter wrote:

> - The PETSc linear solver provides a print_converged_reason() member,
> which includes the KSPConvergedReason enums, but not all of them! It
> seems that _ksp is not destroyed right after the solve(), which allows
> that function to fetch the convergence reason from it. Either that
> method needs a serious overhaul

That method needs a serious overhaul.  I think John added it about 4
years ago, and it works but it's definitely not the ideal design.
Using PETSc's convergence reason strings would be a big improvement
over making up our own, looking at Jed's suggestion first.

> and the same thing is implemented for the PETSc nonlinear solver as
> well (including the postponement of _snes destruction),

How heavyweight are the SNES and KSP objects?  I don't see any
non-efficiency reasons against postponing the _snes destruction, and
I suspect any efficiency reasons are insignificant enough that "don't
automatically destroy the _snes, but give the user an option to do so
manually" would be a reasonable alternative.

> or it is replaced by a new common convergence enum methodology.

I'd prefer to see a common convergence enum methodology regardless;
otherwise there's no way to access convergence information from the
abstract base classes.

> - The enums are readily defined in petscksp.h and pescsnes.h. Why redefine 
> them?

Mostly so that codes will still compile when PETSc isn't installed.

> - Different solvers use overlapping enum value ranges. If they were to
> share a common enum, a remapping would have to be defined. I'm sure
> that's worth avoiding.

Different solvers use different convergence reporting methods; the
only options here are for everybody to write solver-specific code
(fine for users to choose, but I don't want libMesh to force that on
them) or for libMesh to have some common encapsulation (effectively a
remapping) of those values.

It does sound like the sort of problem more suited to a class than an
enum, though...  It would be nice to add more fine-grained
convergence/divergence types while still keeping old code forwards
compatible via "bool ConvergenceResult::converged()" type methods to
query the types' coarse characteristics.
---
Roy

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in 
Real-Time with Splunk. Collect, index and harness all the fast moving IT data 
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business 
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to