> I definitely agree with letting the application code access the > convergence/divergence reason, but not so much with making it an > opaque PETSc-specific int. A new enum_convergence.h would fix all > three of those problems at once, if you wanted to go to the trouble. > You wouldn't need to bother actually implementing the Trilinos/Laspack > codepaths (except to the extent that the base solver class would want > to return an "UNKNOWN" or throw a libmesh_not_implemented() by > default); I just don't want to make it impossible for someone else to > write those implementations later.
I certainly agree with the enum / making it non-PETSc-specific argument. The reasons why I didn't go there include: - There is a convergence flag in the base class for nonlinear solvers already, and it's set only by the PETSc solver, i.e. for users of other solvers it is misleading (hence I thought, why not introduce yet another misleading variable, haha! No, not really... :-) ) - 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 and the same thing is implemented for the PETSc nonlinear solver as well (including the postponement of _snes destruction), or it is replaced by a new common convergence enum methodology. - The enums are readily defined in petscksp.h and pescsnes.h. Why redefine them? - 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. Cf. http://www.ib.cnea.gov.ar/~ipc/ptpde/petsc-dir/docs/manualpages/SNES/SNESConvergedReason.html http://www.ib.cnea.gov.ar/~ipc/ptpde/petsc-dir/docs/manualpages/KSP/KSPConvergedReason.html As a libMesh main developer, which approach would you prefer? Roman ------------------------------------------------------------------------------ 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