> That would be excellent. Let me know when you have something and we'll check> 
> it all in together with the original patch.

I added the documentation to petsc_solver.h at the appropriate
location for SolverBase and the patch for the same is below. I only
provided a basic pointer to the options available and the
documentation, user manuals at the PETSc site provide enough details
to help any user wanting to experiment. The ideas also extend to all
of the PETScWrapper classes and perhaps moving this documentation to
somewhere common would avoid duplication of the same information
regarding command line options. If you feel the documentation is
inadequate or if you want some more information on something specific,
do let me know.

Index: petsc_solver.h
===================================================================
--- petsc_solver.h      (revision 24832)
+++ petsc_solver.h      (working copy)
@@ -69,6 +69,18 @@
  * is the appropriate argument for the sequential case (which is why it is the
  * default argument), so this error only shows up in parallel mode.
  *
+ * Optionally, the user can create a solver derived from the SolverBase class
+ * and can set the default arguments necessary to solve the linear
system of equations
+ * with SolverControl. These default options can be overridden by
specifying command line
+ * arguments of the form -ksp_*. For example,
-ksp_monitor_true_residual prints out true
+ * residual norm (unpreconditioned) at each iteration and -ksp_view
provides information
+ * about the linear solver and the preconditioner used in the current
context. The type
+ * of the solver can also be changed during runtime by specifying
-ksp_type {richardson,
+ * cg, gmres, fgmres, ..} to dynamically test the optimal solver
along with a suitable
+ * preconditioner set using -pc_type {jacobi, bjacobi, ilu, lu, ..}.
There are several
+ * other command line options available to modify the behavior of the
PETSc linear solver
+ * and can be obtained from the documentation and manual pages at
http://www.mcs.anl.gov/petsc.
+ *
  * @ingroup PETScWrappers
  * @author Wolfgang Bangerth, 2004
  */


I also have another suggestion regarding the SolverBase class. It
might be useful to add a set_prefix(std::string&) method to
SolverBase. This would allow the user to name their linear solvers
with say set_prefix("poisson_") which in turn would call
KSPAppendOptionsPrefix on the KSP object. Then, all command line
arguments will be of the form -poisson_ksp_* and any general option
provided by the user as -ksp_* will not be propagated to this specific
solver. This would be useful when you perform some nested solves where
you could use FGMRes on the outer loop and perform GMRes solves
inside, with different options provided for each solver from command
line.

Vijay

On Thu, Dec 15, 2011 at 7:25 AM, Wolfgang Bangerth
<[email protected]> wrote:
>
>> This is what I was going for. Yes and that's the PETSc philosophy.
>> Coming from mostly a PETSc background, I found it incomprehensible to
>> see the command line options ignored until I saw the code. But I
>> figured the deal.II philosophy is different in this sense but
>> nevertheless a little confusing. All the Mat, Vec, PC options are
>> being set from command line while the KSP options are being ignored.
>
>
> I didn't even realize that you can do that when using deal.II. It certainly
> wasn't a design goal when writing the PETSc wrappers but if it works much
> the better.
>
>
>
>> I can definitely send you something to clarify these aspects so that
>> you can add them to the documentation.
>
>
> That would be excellent. Let me know when you have something and we'll check
> it all in together with the original patch.
>
> Best
>  W.
>
>
> ------------------------------------------------------------------------
> Wolfgang Bangerth               email:            [email protected]
>                                www: http://www.math.tamu.edu/~bangerth/
>
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to