Commits

BarryFSmith  committed 11a7c22

fixed TSView_XX to display typename consistently for each ODE type

  • Participants
  • Parent commits 99aac67
  • Branches barry/newhtml

Comments (0)

Files changed (22)

File include/petscsys.h

 
 PETSC_EXTERN PetscErrorCode PetscMemoryShowUsage(PetscViewer,const char[]);
 PETSC_EXTERN PetscErrorCode PetscObjectPrintClassNamePrefixType(PetscObject,PetscViewer);
+PETSC_EXTERN PetscErrorCode PetscObjectPrintSubType(PetscObject,PetscViewer,const char*);
 PETSC_EXTERN PetscErrorCode PetscObjectView(PetscObject,PetscViewer);
 #define PetscObjectQueryFunction(obj,name,fptr) PetscObjectQueryFunction_Private((obj),(name),(PetscVoidFunction*)(fptr))
 PETSC_EXTERN PetscErrorCode PetscObjectQueryFunction_Private(PetscObject,const char[],void (**)(void));

File include/petscts.h

 #define TSARKIMEXARS443 "ars443"
 #define TSARKIMEX4      "4"
 #define TSARKIMEX5      "5"
+
 PETSC_EXTERN PetscErrorCode TSARKIMEXGetType(TS ts,TSARKIMEXType*);
 PETSC_EXTERN PetscErrorCode TSARKIMEXSetType(TS ts,TSARKIMEXType);
 PETSC_EXTERN PetscErrorCode TSARKIMEXSetFullyImplicit(TS,PetscBool);

File src/ksp/ksp/impls/bcgsl/bcgsl.c

   ierr = PetscObjectTypeCompare((PetscObject)viewer, PETSCVIEWERASCII, &isascii);CHKERRQ(ierr);
 
   if (isascii) {
-    ierr = PetscViewerASCIIPrintf(viewer, "  BCGSL: Ell = %D\n", bcgsl->ell);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer, "  BCGSL: Delta = %lg\n", bcgsl->delta);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer, "  BCGSL: [[KSPBCGSLSetEll]]Ell = %D\n", bcgsl->ell);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer, "  BCGSL: [[KSPBCGSLSetXRes]]Delta = %lg\n", bcgsl->delta);CHKERRQ(ierr);
   }
   PetscFunctionReturn(0);
 }
   PetscBool      flga = PETSC_FALSE, flg;
 
   PetscFunctionBegin;
-  /* PetscOptionsBegin/End are called in KSPSetFromOptions. They
-     don't need to be called here.
-  */
   ierr = PetscOptionsHead("KSP BiCGStab(L) Options");CHKERRQ(ierr);
 
   /* Set number of search directions */

File src/ksp/ksp/impls/cg/cg.c

   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  CG or CGNE: variant %s\n",KSPCGTypes[cg->type]);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  CG or CGNE: [[KSPCGSetType]]variant %s\n",KSPCGTypes[cg->type]);CHKERRQ(ierr);
   }
 #endif
   PetscFunctionReturn(0);

File src/ksp/ksp/impls/cheby/cheby.c

   if (iascii) {
     ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: eigenvalue estimates:  min = %g, max = %g\n",(double)cheb->emin,(double)cheb->emax);CHKERRQ(ierr);
     if (cheb->kspest) {
-      ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: estimated using:  [%g %g; %g %g]\n",(double)cheb->tform[0],(double)cheb->tform[1],(double)cheb->tform[2],(double)cheb->tform[3]);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: [[KSPChebyshevSetEstimateEigenvalues]]estimated using:  [%g %g; %g %g]\n",(double)cheb->tform[0],(double)cheb->tform[1],(double)cheb->tform[2],(double)cheb->tform[3]);CHKERRQ(ierr);
       if (cheb->hybrid) { /* display info about hybrid options being used */
         ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: hybrid is used, eststeps %D, chebysteps %D, purification %D\n",cheb->eststeps,cheb->chebysteps,cheb->purification);CHKERRQ(ierr);
       }
       if (cheb->random) {
-        ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: estimating eigenvalues using random right hand side\n");CHKERRQ(ierr);
+        ierr = PetscViewerASCIIPrintf(viewer,"  Chebyshev: [[KSPChebyshevEstEigSetRandom]]estimating eigenvalues using random right hand side\n");CHKERRQ(ierr);
         ierr = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr);
         ierr = PetscRandomView(cheb->random,viewer);CHKERRQ(ierr);
         ierr = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr);

File src/ksp/ksp/impls/gcr/gcr.c

   PetscFunctionBegin;
   PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  GCR: restart = %D \n", ctx->restart);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  GCR: [[KSPGCRSetRestart]]restart = %D \n", ctx->restart);CHKERRQ(ierr);
     ierr = PetscViewerASCIIPrintf(viewer,"  GCR: restarts performed = %D \n", ctx->n_restarts);CHKERRQ(ierr);
   }
   PetscFunctionReturn(0);

File src/ksp/ksp/impls/gmres/agmres/agmres.c

   /* Data for the Newton basis GMRES */
   ierr = PetscCalloc4(max_k,&agmres->Rshift,max_k,&agmres->Ishift,hes,&agmres->Rloc,((N+1)*4),&agmres->wbufptr);CHKERRQ(ierr);
   ierr = PetscMalloc7((N+1),&agmres->Scale,(N+1),&agmres->sgn,(N+1),&agmres->tloc,(N+1),&agmres->temp,(N+1),&agmres->tau,lwork,&agmres->work,(N+1),&agmres->nrs);CHKERRQ(ierr);
-  ierr = PetscMemzero(agmres->Scale, (N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
-  ierr = PetscMemzero(agmres->sgn, (N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
-  ierr = PetscMemzero(agmres->tloc, (N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
-  ierr = PetscMemzero(agmres->temp, (N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->Scale,(N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->sgn,(N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->tloc,(N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->temp,(N+1)*sizeof(PetscScalar));CHKERRQ(ierr);
 
   /* Allocate space for the vectors in the orthogonalized basis*/
-  ierr = VecGetLocalSize(agmres->vecs[0], &nloc);CHKERRQ(ierr);
-  ierr = PetscMalloc1(nloc*(N+1), &agmres->Qloc);CHKERRQ(ierr);
+  ierr = VecGetLocalSize(agmres->vecs[0],&nloc);CHKERRQ(ierr);
+  ierr = PetscMalloc1(nloc*(N+1),&agmres->Qloc);CHKERRQ(ierr);
 
   /* Init the ring of processors for the roddec orthogonalization */
   ierr = KSPAGMRESRoddecInitNeighboor(ksp);CHKERRQ(ierr);
   if (agmres->neig < 1) PetscFunctionReturn(0);
 
   /* Allocate space for the deflation */
-  ierr = PetscMalloc1(N, &agmres->select);CHKERRQ(ierr);
-  ierr = VecDuplicateVecs(VEC_V(0), N, &agmres->TmpU);CHKERRQ(ierr);
-  ierr = PetscMalloc2(N*N, &agmres->MatEigL, N*N, &agmres->MatEigR);CHKERRQ(ierr);
-  /*  ierr = PetscMalloc6(N*N, &agmres->Q, N*N, &agmres->Z, N, &agmres->wr, N, &agmres->wi, N, &agmres->beta, N, &agmres->modul);CHKERRQ(ierr); */
-  ierr = PetscMalloc3(N*N, &agmres->Q, N*N, &agmres->Z, N, &agmres->beta);CHKERRQ(ierr);
+  ierr = PetscMalloc1(N,&agmres->select);CHKERRQ(ierr);
+  ierr = VecDuplicateVecs(VEC_V(0),N,&agmres->TmpU);CHKERRQ(ierr);
+  ierr = PetscMalloc2(N*N,&agmres->MatEigL,N*N,&agmres->MatEigR);CHKERRQ(ierr);
+  /*  ierr = PetscMalloc6(N*N,&agmres->Q,N*N,&agmres->Z,N,&agmres->wr,N,&agmres->wi,N,&agmres->beta,N,&agmres->modul);CHKERRQ(ierr); */
+  ierr = PetscMalloc3(N*N,&agmres->Q,N*N,&agmres->Z,N,&agmres->beta);CHKERRQ(ierr);
   ierr = PetscMalloc2((N+1),&agmres->perm,(2*neig*N),&agmres->iwork);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
  */
 #undef __FUNCT__
 #define __FUNCT__ "KSPBuildSolution_AGMRES"
-PetscErrorCode KSPBuildSolution_AGMRES(KSP ksp,Vec ptr, Vec *result)
+PetscErrorCode KSPBuildSolution_AGMRES(KSP ksp,Vec ptr,Vec *result)
 {
   KSP_AGMRES     *agmres = (KSP_AGMRES*)ksp->data;
   PetscErrorCode ierr;
     }
     ptr = agmres->sol_temp;
   } else {
-    ierr = VecCopy(ksp->vec_sol, ptr);CHKERRQ(ierr);
+    ierr = VecCopy(ksp->vec_sol,ptr);CHKERRQ(ierr);
   }
   if (result) *result = ptr;
   PetscFunctionReturn(0);
   PetscErrorCode ierr;
   KSP_AGMRES     *agmres = (KSP_AGMRES*)(ksp->data);
   KSP            kspgmres;
-  Mat            Amat, Pmat;
+  Mat            Amat,Pmat;
   MatStructure   flag;
   PetscInt       max_k = agmres->max_k;
   PC             pc;
   PetscInt       m;
-  PetscScalar    *Rshift, *Ishift;
+  PetscScalar    *Rshift,*Ishift;
   PetscBool      flg;
 
   PetscFunctionBegin;
   /* Perform one cycle of classical GMRES (with the Arnoldi process) to get the Hessenberg matrix
    We assume here that the ksp is AGMRES and that the operators for the
    linear system have been set in this ksp */
-  ierr = KSPCreate(PetscObjectComm((PetscObject)ksp), &kspgmres);CHKERRQ(ierr);
+  ierr = KSPCreate(PetscObjectComm((PetscObject)ksp),&kspgmres);CHKERRQ(ierr);
   if (!ksp->pc) { ierr = KSPGetPC(ksp,&ksp->pc);CHKERRQ(ierr); }
-  ierr = PCGetOperators(ksp->pc, &Amat, &Pmat, &flag);CHKERRQ(ierr);
-  ierr = KSPSetOperators(kspgmres, Amat, Pmat, flag);CHKERRQ(ierr);
+  ierr = PCGetOperators(ksp->pc,&Amat,&Pmat,&flag);CHKERRQ(ierr);
+  ierr = KSPSetOperators(kspgmres,Amat,Pmat,flag);CHKERRQ(ierr);
   ierr = KSPSetFromOptions(kspgmres);CHKERRQ(ierr);
-  ierr = PetscOptionsHasName(NULL, "-ksp_view", &flg);CHKERRQ(ierr);
+  ierr = PetscOptionsHasName(NULL,"-ksp_view",&flg);CHKERRQ(ierr);
   if (flag) { ierr = PetscOptionsClearValue("-ksp_view");CHKERRQ(ierr); }
-  ierr = KSPSetType(kspgmres, KSPGMRES);CHKERRQ(ierr);
-  ierr = KSPGMRESSetRestart(kspgmres, max_k);CHKERRQ(ierr);
-  ierr = KSPGetPC(ksp, &pc);CHKERRQ(ierr);
-  ierr = KSPSetPC(kspgmres, pc);CHKERRQ(ierr);
+  ierr = KSPSetType(kspgmres,KSPGMRES);CHKERRQ(ierr);
+  ierr = KSPGMRESSetRestart(kspgmres,max_k);CHKERRQ(ierr);
+  ierr = KSPGetPC(ksp,&pc);CHKERRQ(ierr);
+  ierr = KSPSetPC(kspgmres,pc);CHKERRQ(ierr);
   /* Copy common options */
   kspgmres->pc_side = ksp->pc_side;
   /* Setup KSP context */
-  ierr = KSPSetComputeEigenvalues(kspgmres, PETSC_TRUE);CHKERRQ(ierr);
+  ierr = KSPSetComputeEigenvalues(kspgmres,PETSC_TRUE);CHKERRQ(ierr);
   ierr = KSPSetUp(kspgmres);CHKERRQ(ierr);
 
   kspgmres->max_it = max_k; /* Restrict the maximum number of iterations to one cycle of GMRES */
   kspgmres->rtol   = ksp->rtol;
 
-  ierr = KSPSolve(kspgmres, ksp->vec_rhs, ksp->vec_sol);CHKERRQ(ierr);
+  ierr = KSPSolve(kspgmres,ksp->vec_rhs,ksp->vec_sol);CHKERRQ(ierr);
 
   ksp->guess_zero = PETSC_FALSE;
   ksp->rnorm      = kspgmres->rnorm;
     ksp->reason = KSP_CONVERGED_RTOL;
     PetscFunctionReturn(0);
   } else ksp->reason = KSP_CONVERGED_ITERATING;
-  /* Now, compute the Shifts values */
+  /* Now,compute the Shifts values */
   ierr = PetscMalloc2(max_k,&Rshift,max_k,&Ishift);CHKERRQ(ierr);
-  ierr = KSPComputeEigenvalues(kspgmres, max_k, Rshift, Ishift, &m);CHKERRQ(ierr);
-  if (m < max_k) SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_PLIB, "Unable to compute the Shifts for the Newton basis");
+  ierr = KSPComputeEigenvalues(kspgmres,max_k,Rshift,Ishift,&m);CHKERRQ(ierr);
+  if (m < max_k) SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_PLIB,"Unable to compute the Shifts for the Newton basis");
   else {
-    ierr = KSPAGMRESLejaOrdering(Rshift, Ishift, agmres->Rshift, agmres->Ishift, max_k);CHKERRQ(ierr);
+    ierr = KSPAGMRESLejaOrdering(Rshift,Ishift,agmres->Rshift,agmres->Ishift,max_k);CHKERRQ(ierr);
 
     agmres->HasShifts = PETSC_TRUE;
   }
   /* Restore KSP view options */
-  if (flg) { ierr = PetscOptionsSetValue("-ksp_view", "");CHKERRQ(ierr); }
+  if (flg) { ierr = PetscOptionsSetValue("-ksp_view","");CHKERRQ(ierr); }
   PetscFunctionReturn(0);
 }
 
 /* This function computes the shift values (Ritz values) needed to generate stable basis vectors
  * One cycle of DGMRES is performed to find the eigenvalues. The same data structures are used since AGMRES extends DGMRES
- * Note that when the basis is  to be augmented, then this function computes the harmonic Ritz vectors from this first cycle.
+ * Note that when the basis is  to be augmented,then this function computes the harmonic Ritz vectors from this first cycle.
  * Input :
- *  - The operators (matrix, preconditioners and right hand side) are  normally required.
+ *  - The operators (matrix,preconditioners and right hand side) are  normally required.
  *  - max_k : the size of the (non augmented) basis.
- *  - neig: The number of eigenvectors to augment, if deflation is needed
+ *  - neig: The number of eigenvectors to augment,if deflation is needed
  * Output :
  *  - The shifts as complex pair of arrays in wr and wi (size max_k).
  *  - The harmonic Ritz vectors (agmres->U) if deflation is needed.
   /* Perform one cycle of dgmres to find the eigenvalues and compute the first approximations of the eigenvectors */
 
   PetscFunctionBegin;
-  ierr = PetscLogEventBegin(KSP_AGMRESComputeShifts, ksp, 0,0,0);CHKERRQ(ierr);
+  ierr = PetscLogEventBegin(KSP_AGMRESComputeShifts,ksp,0,0,0);CHKERRQ(ierr);
   /* Send the size of the augmented basis to DGMRES */
   ksp->max_it             = max_k; /* set this to have DGMRES performing only one cycle */
   ksp->ops->buildsolution = KSPBuildSolution_DGMRES;
   ierr                    = KSPSolve_DGMRES(ksp);
   ksp->guess_zero         = PETSC_FALSE;
   if (ksp->reason == KSP_CONVERGED_RTOL) {
-    ierr = PetscLogEventEnd(KSP_AGMRESComputeShifts, ksp, 0,0,0);CHKERRQ(ierr);
+    ierr = PetscLogEventEnd(KSP_AGMRESComputeShifts,ksp,0,0,0);CHKERRQ(ierr);
     PetscFunctionReturn(0);
   } else ksp->reason = KSP_CONVERGED_ITERATING;
 
   if ((agmres->r == 0) && (agmres->neig > 0)) {  /* Compute the eigenvalues for the shifts and the eigenvectors (to augment the Newton basis) */
     agmres->HasSchur = PETSC_FALSE;
-    ierr             = KSPDGMRESComputeDeflationData_DGMRES (ksp, &Neig);CHKERRQ (ierr);
+    ierr             = KSPDGMRESComputeDeflationData_DGMRES (ksp,&Neig);CHKERRQ (ierr);
     Neig             = max_k;
-  } else { /* From DGMRES, compute only the eigenvalues needed as Shifts for the Newton Basis */
-    ierr =  KSPDGMRESComputeSchurForm_DGMRES(ksp, &Neig);CHKERRQ(ierr);
+  } else { /* From DGMRES,compute only the eigenvalues needed as Shifts for the Newton Basis */
+    ierr =  KSPDGMRESComputeSchurForm_DGMRES(ksp,&Neig);CHKERRQ(ierr);
   }
 
-  /* It may happen that the Ritz values from one cycle of GMRES are not accurate enough to provide a good stability. In this case, another cycle of GMRES is performed.  The two sets of values thus generated are sorted and the most accurate are kept as shifts */
+  /* It may happen that the Ritz values from one cycle of GMRES are not accurate enough to provide a good stability. In this case,another cycle of GMRES is performed.  The two sets of values thus generated are sorted and the most accurate are kept as shifts */
   PetscBool flg;
-  ierr = PetscOptionsHasName(NULL, "-ksp_agmres_ImproveShifts", &flg);CHKERRQ(ierr);
+  ierr = PetscOptionsHasName(NULL,"-ksp_agmres_ImproveShifts",&flg);CHKERRQ(ierr);
   if (!flg) {
-    ierr = KSPAGMRESLejaOrdering(agmres->wr, agmres->wi, agmres->Rshift, agmres->Ishift, max_k);CHKERRQ(ierr);
+    ierr = KSPAGMRESLejaOrdering(agmres->wr,agmres->wi,agmres->Rshift,agmres->Ishift,max_k);CHKERRQ(ierr);
   } else { /* Perform another cycle of DGMRES to find another set of eigenvalues */
     PetscInt    i;
-    PetscScalar *wr, *wi,*Rshift, *Ishift;
-    ierr = PetscMalloc4(2*max_k, &wr, 2*max_k, &wi, 2*max_k, &Rshift, 2*max_k, &Ishift);CHKERRQ(ierr);
+    PetscScalar *wr,*wi,*Rshift,*Ishift;
+    ierr = PetscMalloc4(2*max_k,&wr,2*max_k,&wi,2*max_k,&Rshift,2*max_k,&Ishift);CHKERRQ(ierr);
     for (i = 0; i < max_k; i++) {
       wr[i] = agmres->wr[i];
       wi[i] = agmres->wi[i];
     if (agmres->neig > 0) { /* Compute the eigenvalues for the shifts) and the eigenvectors (to augment the Newton basis */
       agmres->HasSchur = PETSC_FALSE;
 
-      ierr = KSPDGMRESComputeDeflationData_DGMRES(ksp, &Neig);CHKERRQ(ierr);
+      ierr = KSPDGMRESComputeDeflationData_DGMRES(ksp,&Neig);CHKERRQ(ierr);
       Neig = max_k;
-    } else { /* From DGMRES, compute only the eigenvalues needed as Shifts for the Newton Basis */
-      ierr =  KSPDGMRESComputeSchurForm_DGMRES(ksp, &Neig);CHKERRQ(ierr);
+    } else { /* From DGMRES,compute only the eigenvalues needed as Shifts for the Newton Basis */
+      ierr =  KSPDGMRESComputeSchurForm_DGMRES(ksp,&Neig);CHKERRQ(ierr);
     }
     for (i = 0; i < max_k; i++) {
       wr[max_k+i] = agmres->wr[i];
       wi[max_k+i] = agmres->wi[i];
     }
-    ierr = KSPAGMRESLejaOrdering(wr, wi, Rshift, Ishift, 2*max_k);CHKERRQ(ierr);
+    ierr = KSPAGMRESLejaOrdering(wr,wi,Rshift,Ishift,2*max_k);CHKERRQ(ierr);
     for (i = 0; i< max_k; i++) {
       agmres->Rshift[i] = Rshift[i];
       agmres->Ishift[i] = Ishift[i];
 
   agmres->HasShifts = PETSC_TRUE;
   ksp->max_it       = max_it;
-  ierr              = PetscLogEventEnd(KSP_AGMRESComputeShifts, ksp, 0,0,0);CHKERRQ(ierr);
+  ierr              = PetscLogEventEnd(KSP_AGMRESComputeShifts,ksp,0,0,0);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
   PetscInt       j       = 1;
 
   PetscFunctionBegin;
-  ierr     = PetscLogEventBegin(KSP_AGMRESBuildBasis, ksp, 0,0,0);CHKERRQ(ierr);
+  ierr     = PetscLogEventBegin(KSP_AGMRESBuildBasis,ksp,0,0,0);CHKERRQ(ierr);
   Scale[0] = 1.0;
   while (j <= max_k) {
     if (Ishift[j-1] == 0) {
       if ((ksp->pc_side == PC_LEFT) && agmres->r && agmres->DeflPrecond) {
         /* Apply the precond-matrix operators */
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_TMP, VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_TMP,VEC_TMP_MATOP);CHKERRQ(ierr);
         /* Then apply deflation as a preconditioner */
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_TMP, VEC_V(j));CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_TMP,VEC_V(j));CHKERRQ(ierr);
       } else if ((ksp->pc_side == PC_RIGHT) && agmres->r && agmres->DeflPrecond) {
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_V(j-1), VEC_TMP);CHKERRQ(ierr);
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_TMP, VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_V(j-1),VEC_TMP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_TMP,VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       } else {
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       }
-      ierr = VecAXPY(VEC_V(j), -Rshift[j-1], VEC_V(j-1));CHKERRQ(ierr);
+      ierr = VecAXPY(VEC_V(j),-Rshift[j-1],VEC_V(j-1));CHKERRQ(ierr);
 #if defined(KSP_AGMRES_NONORM)
       Scale[j] = 1.0;
 #else
-      ierr     = VecScale(VEC_V(j), Scale[j-1]);CHKERRQ(ierr); /* This step can be postponed until all vectors are built */
-      ierr     = VecNorm(VEC_V(j), NORM_2, &(Scale[j]));CHKERRQ(ierr);
+      ierr     = VecScale(VEC_V(j),Scale[j-1]);CHKERRQ(ierr); /* This step can be postponed until all vectors are built */
+      ierr     = VecNorm(VEC_V(j),NORM_2,&(Scale[j]));CHKERRQ(ierr);
       Scale[j] = 1.0/Scale[j];
 #endif
 
     } else {
       if ((ksp->pc_side == PC_LEFT) && agmres->r && agmres->DeflPrecond) {
         /* Apply the precond-matrix operators */
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_TMP, VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_TMP,VEC_TMP_MATOP);CHKERRQ(ierr);
         /* Then apply deflation as a preconditioner */
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_TMP, VEC_V(j));CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_TMP,VEC_V(j));CHKERRQ(ierr);
       } else if ((ksp->pc_side == PC_RIGHT) && agmres->r && agmres->DeflPrecond) {
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_V(j-1), VEC_TMP);CHKERRQ(ierr);
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_TMP, VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_V(j-1),VEC_TMP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_TMP,VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       } else {
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       }
-      ierr = VecAXPY(VEC_V(j), -Rshift[j-1], VEC_V(j-1));CHKERRQ(ierr);
+      ierr = VecAXPY(VEC_V(j),-Rshift[j-1],VEC_V(j-1));CHKERRQ(ierr);
 #if defined(KSP_AGMRES_NONORM)
       Scale[j] = 1.0;
 #else
-      ierr     = VecScale(VEC_V(j), Scale[j-1]);CHKERRQ(ierr);
-      ierr     = VecNorm(VEC_V(j), NORM_2, &(Scale[j]));CHKERRQ(ierr);
+      ierr     = VecScale(VEC_V(j),Scale[j-1]);CHKERRQ(ierr);
+      ierr     = VecNorm(VEC_V(j),NORM_2,&(Scale[j]));CHKERRQ(ierr);
       Scale[j] = 1.0/Scale[j];
 #endif
       agmres->matvecs += 1;
       j++;
       if ((ksp->pc_side == PC_LEFT) && agmres->r && agmres->DeflPrecond) {
         /* Apply the precond-matrix operators */
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_TMP, VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_TMP,VEC_TMP_MATOP);CHKERRQ(ierr);
         /* Then apply deflation as a preconditioner */
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_TMP, VEC_V(j));CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_TMP,VEC_V(j));CHKERRQ(ierr);
       } else if ((ksp->pc_side == PC_RIGHT) && agmres->r && agmres->DeflPrecond) {
-        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_V(j-1), VEC_TMP);CHKERRQ(ierr);
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_TMP, VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_V(j-1),VEC_TMP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_TMP,VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       } else {
-        ierr = KSP_PCApplyBAorAB(ksp, VEC_V(j-1), VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+        ierr = KSP_PCApplyBAorAB(ksp,VEC_V(j-1),VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
       }
-      ierr = VecAXPY(VEC_V(j), -Rshift[j-2], VEC_V(j-1));CHKERRQ(ierr);
-      ierr = VecAXPY(VEC_V(j), Scale[j-2]*Ishift[j-2]*Ishift[j-2], VEC_V(j-2));CHKERRQ(ierr);
+      ierr = VecAXPY(VEC_V(j),-Rshift[j-2],VEC_V(j-1));CHKERRQ(ierr);
+      ierr = VecAXPY(VEC_V(j),Scale[j-2]*Ishift[j-2]*Ishift[j-2],VEC_V(j-2));CHKERRQ(ierr);
 #if defined(KSP_AGMRES_NONORM)
       Scale[j] = 1.0;
 #else
-      ierr     = VecNorm(VEC_V(j), NORM_2, &(Scale[j]));CHKERRQ(ierr);
+      ierr     = VecNorm(VEC_V(j),NORM_2,&(Scale[j]));CHKERRQ(ierr);
       Scale[j] = 1.0/Scale[j];
 #endif
       agmres->matvecs += 1;
   }
   /* Augment the subspace with the eigenvectors*/
   while (j <= KspSize) {
-    ierr = KSP_PCApplyBAorAB(ksp, agmres->U[j - max_k - 1], VEC_V(j), VEC_TMP_MATOP);CHKERRQ(ierr);
+    ierr = KSP_PCApplyBAorAB(ksp,agmres->U[j - max_k - 1],VEC_V(j),VEC_TMP_MATOP);CHKERRQ(ierr);
 #if defined(KSP_AGMRES_NONORM)
     Scale[j] = 1.0;
 #else
-    ierr     = VecScale(VEC_V(j), Scale[j-1]);CHKERRQ(ierr);
-    ierr     = VecNorm(VEC_V(j), NORM_2, &(Scale[j]));CHKERRQ(ierr);
+    ierr     = VecScale(VEC_V(j),Scale[j-1]);CHKERRQ(ierr);
+    ierr     = VecNorm(VEC_V(j),NORM_2,&(Scale[j]));CHKERRQ(ierr);
     Scale[j] = 1.0/Scale[j];
 #endif
     agmres->matvecs += 1;
     j++;
   }
-  ierr = PetscLogEventEnd(KSP_AGMRESBuildBasis, ksp, 0,0,0);CHKERRQ(ierr);
+  ierr = PetscLogEventEnd(KSP_AGMRESBuildBasis,ksp,0,0,0);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
  * Outputs :
  * - H = agmres->hh_origin : The Hessenberg matrix.
  *
- * NOTE: Note that the computed Hessenberg matrix is not mathematically equivalent to that in the real Arnoldi process (in KSP GMRES). If it is needed, it can be explicitly  formed as H <-- H * RLoc^-1.
+ * NOTE: Note that the computed Hessenberg matrix is not mathematically equivalent to that in the real Arnoldi process (in KSP GMRES). If it is needed,it can be explicitly  formed as H <-- H * RLoc^-1.
  *
  */
 #undef __FUNCT__
   PetscScalar    *Ishift = agmres->Ishift;
   PetscScalar    *Scale  = agmres->Scale;
   PetscErrorCode ierr;
-  PetscInt       i       = 0, j = 0;
+  PetscInt       i       = 0,j = 0;
   PetscInt       max_k   = agmres->max_k;
   PetscInt       KspSize = KSPSIZE;
   PetscInt       N       = MAXKSPSIZE+1;
 
   PetscFunctionBegin;
-  ierr = PetscMemzero(agmres->hh_origin, (N+1)*N*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->hh_origin,(N+1)*N*sizeof(PetscScalar));CHKERRQ(ierr);
   while (j < max_k) {
     /* Real shifts */
     if (Ishift[j] == 0) {
       j++;
     } else if (Ishift[j] > 0) {
       for (i = 0; i <= j; i++) {
-        *H(i,j) = *RLOC(i,j+1)/Scale[j] +  Rshift[j] * *RLOC(i, j);
+        *H(i,j) = *RLOC(i,j+1)/Scale[j] +  Rshift[j] * *RLOC(i,j);
       }
-      *H(j+1,j) = *RLOC(j+1, j+1)/Scale[j];
+      *H(j+1,j) = *RLOC(j+1,j+1)/Scale[j];
       j++;
       for (i = 0; i <= j; i++) {
         *H(i,j) = (*RLOC(i,j+1) + Rshift[j-1] * *RLOC(i,j) - Scale[j-1] * Ishift[j-1]*Ishift[j-1]* *RLOC(i,j-1));
       *H(j,j) = (*RLOC(j,j+1) + Rshift[j-1] * *RLOC(j,j));
       *H(j+1,j) = *RLOC(j+1,j+1);
       j++;
-    } else SETERRQ(PetscObjectComm((PetscObject)ksp), PETSC_ERR_ORDER, "BAD ORDERING OF THE SHIFTS VALUES IN THE NEWTON BASIS");
+    } else SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_ORDER,"BAD ORDERING OF THE SHIFTS VALUES IN THE NEWTON BASIS");
   }
   for (j = max_k; j< KspSize; j++) { /* take into account the norm of the augmented vectors */
-    for (i = 0; i <= j+1; i++) *H(i,j) = *RLOC(i, j+1)/Scale[j];
+    for (i = 0; i <= j+1; i++) *H(i,j) = *RLOC(i,j+1)/Scale[j];
   }
   PetscFunctionReturn(0);
 }
   KSP_AGMRES     *agmres = (KSP_AGMRES*)ksp->data;
   PetscErrorCode ierr;
   PetscInt       max_k = agmres->max_k;       /* Size of the non-augmented Krylov basis */
-  PetscInt       i, j;
+  PetscInt       i,j;
   PetscInt       r = agmres->r;           /* current number of augmented eigenvectors */
   PetscBLASInt   KspSize;
   PetscBLASInt   lC;
   PetscBLASInt   N;
   PetscBLASInt   ldH = N + 1;
   PetscBLASInt   lwork;
-  PetscBLASInt   info, nrhs = 1;
+  PetscBLASInt   info,nrhs = 1;
 
   PetscFunctionBegin;
   ierr = PetscBLASIntCast(KSPSIZE,&KspSize);CHKERRQ(ierr);
 #if defined(PETSC_MISSING_LAPACK_GEQRF)
   SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_SUP,"GEQRF - Lapack routine is unavailable.");
 #else
-  PetscStackCallBLAS("LAPACKgeqrf",LAPACKgeqrf_(&lC, &KspSize, agmres->hh_origin, &ldH, agmres->tau, agmres->work, &lwork, &info));
-  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp), PETSC_ERR_LIB,"Error in LAPACK routine XGEQRF INFO=%d", info);
+  PetscStackCallBLAS("LAPACKgeqrf",LAPACKgeqrf_(&lC,&KspSize,agmres->hh_origin,&ldH,agmres->tau,agmres->work,&lwork,&info));
+  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp),PETSC_ERR_LIB,"Error in LAPACK routine XGEQRF INFO=%d",info);
 #endif
   /* Update the right hand side of the least square problem */
-  ierr = PetscMemzero(agmres->nrs, N*sizeof(PetscScalar));CHKERRQ(ierr);
+  ierr = PetscMemzero(agmres->nrs,N*sizeof(PetscScalar));CHKERRQ(ierr);
 
   agmres->nrs[0] = ksp->rnorm;
 #if defined(PETSC_MISSING_LAPACK_ORMQR)
   SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_SUP,"GEQRF - Lapack routine is unavailable.");
 #else
-  PetscStackCallBLAS("LAPACKormqr",LAPACKormqr_("L", "T", &lC, &nrhs, &KspSize, agmres->hh_origin, &ldH, agmres->tau, agmres->nrs, &N, agmres->work, &lwork, &info));
-  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp), PETSC_ERR_LIB,"Error in LAPACK routine XORMQR INFO=%d",info);
+  PetscStackCallBLAS("LAPACKormqr",LAPACKormqr_("L","T",&lC,&nrhs,&KspSize,agmres->hh_origin,&ldH,agmres->tau,agmres->nrs,&N,agmres->work,&lwork,&info));
+  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp),PETSC_ERR_LIB,"Error in LAPACK routine XORMQR INFO=%d",info);
 #endif
   ksp->rnorm = PetscAbsScalar(agmres->nrs[KspSize]);
   /* solve the least-square problem */
 #if defined(PETSC_MISSING_LAPACK_TRTRS)
   SETERRQ(PetscObjectComm((PetscObject)ksp),PETSC_ERR_SUP,"TRTRS - Lapack routine is unavailable.");
 #else
-  PetscStackCallBLAS("LAPACKtrtrs",LAPACKtrtrs_("U", "N", "N", &KspSize, &nrhs, agmres->hh_origin, &ldH, agmres->nrs, &N, &info));
-  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp), PETSC_ERR_LIB,"Error in LAPACK routine XTRTRS INFO=%d",info);
+  PetscStackCallBLAS("LAPACKtrtrs",LAPACKtrtrs_("U","N","N",&KspSize,&nrhs,agmres->hh_origin,&ldH,agmres->nrs,&N,&info));
+  if (info) SETERRQ1(PetscObjectComm((PetscObject)ksp),PETSC_ERR_LIB,"Error in LAPACK routine XTRTRS INFO=%d",info);
 #endif
   /* Accumulate the correction to the solution of the preconditioned problem in VEC_TMP */
   ierr = VecZeroEntries(VEC_TMP);CHKERRQ(ierr);
-  ierr = VecMAXPY(VEC_TMP, max_k, agmres->nrs, &VEC_V(0));CHKERRQ(ierr);
-  if (!agmres->DeflPrecond) { ierr = VecMAXPY(VEC_TMP, r, &agmres->nrs[max_k], agmres->U);CHKERRQ(ierr); }
+  ierr = VecMAXPY(VEC_TMP,max_k,agmres->nrs,&VEC_V(0));CHKERRQ(ierr);
+  if (!agmres->DeflPrecond) { ierr = VecMAXPY(VEC_TMP,r,&agmres->nrs[max_k],agmres->U);CHKERRQ(ierr); }
 
   if ((ksp->pc_side == PC_RIGHT) && agmres->r && agmres->DeflPrecond) {
-    ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_TMP, VEC_TMP_MATOP);CHKERRQ(ierr);
-    ierr = VecCopy(VEC_TMP_MATOP, VEC_TMP);CHKERRQ(ierr);
+    ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_TMP,VEC_TMP_MATOP);CHKERRQ(ierr);
+    ierr = VecCopy(VEC_TMP_MATOP,VEC_TMP);CHKERRQ(ierr);
   }
-  ierr = KSPUnwindPreconditioner(ksp, VEC_TMP, VEC_TMP_MATOP);CHKERRQ(ierr);
+  ierr = KSPUnwindPreconditioner(ksp,VEC_TMP,VEC_TMP_MATOP);CHKERRQ(ierr);
   /* add the solution to the previous one */
-  ierr = VecAXPY(ksp->vec_sol, 1.0, VEC_TMP);CHKERRQ(ierr);
+  ierr = VecAXPY(ksp->vec_sol,1.0,VEC_TMP);CHKERRQ(ierr);
   PetscFunctionReturn(0);
 }
 
 /*
- * Run  one cycle of the Newton-basis gmres, possibly augmented with eigenvectors.
+ * Run  one cycle of the Newton-basis gmres,possibly augmented with eigenvectors.
  *
  * Return residual history if requested.
  * Input :
  * - itcount : number of inner iterations
  *  - res : the new residual norm
  .
- NOTE: Unlike GMRES where the residual norm is available at each (inner) iteration,  here it is available at the end of the cycle.
+ NOTE: Unlike GMRES where the residual norm is available at each (inner) iteration, here it is available at the end of the cycle.
  */
 #undef __FUNCT__
 #define __FUNCT__ "KSPAGMRESCycle"
   /* Build the Krylov basis with Newton polynomials */
   ierr = KSPAGMRESBuildBasis(ksp);CHKERRQ(ierr);
   /* QR Factorize the basis with RODDEC */
-  ierr = KSPAGMRESRoddec(ksp, KspSize+1);CHKERRQ(ierr);
+  ierr = KSPAGMRESRoddec(ksp,KspSize+1);CHKERRQ(ierr);
 
   /* Recover a (partial) Hessenberg matrix for the Arnoldi-like relation */
   ierr = KSPAGMRESBuildHessenberg(ksp);CHKERRQ(ierr);
   /* Solve the least square problem and unwind the preconditioner */
-  ierr = KSPAGMRESBuildSoln(ksp, KspSize);CHKERRQ(ierr);
+  ierr = KSPAGMRESBuildSoln(ksp,KspSize);CHKERRQ(ierr);
 
   res        = ksp->rnorm;
   ksp->its  += KspSize;
   PetscInt       its;
   KSP_AGMRES     *agmres    = (KSP_AGMRES*)ksp->data;
   PetscBool      guess_zero = ksp->guess_zero;
-  PetscReal      res_old, res;
+  PetscReal      res_old,res;
   PetscInt       test;
 
   PetscFunctionBegin;
   if (!agmres->HasShifts) { /* Compute Shifts for the Newton basis */
     ierr = KSPComputeShifts_DGMRES(ksp);CHKERRQ(ierr);
   }
-  /* NOTE: At this step, the initial guess is not equal to zero since one cycle of the classical GMRES is performed to compute the shifts */
+  /* NOTE: At this step,the initial guess is not equal to zero since one cycle of the classical GMRES is performed to compute the shifts */
   ierr = (*ksp->converged)(ksp,0,ksp->rnorm,&ksp->reason,ksp->cnvP);CHKERRQ(ierr);
   while (!ksp->reason) {
     ierr = KSPInitialResidual(ksp,ksp->vec_sol,VEC_TMP,VEC_TMP_MATOP,VEC_V(0),ksp->vec_rhs);CHKERRQ(ierr);
     if ((ksp->pc_side == PC_LEFT) && agmres->r && agmres->DeflPrecond) {
-      ierr = KSPDGMRESApplyDeflation_DGMRES(ksp, VEC_V(0), VEC_TMP);CHKERRQ(ierr);
-      ierr = VecCopy(VEC_TMP, VEC_V(0));CHKERRQ(ierr);
+      ierr = KSPDGMRESApplyDeflation_DGMRES(ksp,VEC_V(0),VEC_TMP);CHKERRQ(ierr);
+      ierr = VecCopy(VEC_TMP,VEC_V(0));CHKERRQ(ierr);
 
       agmres->matvecs += 1;
     }
     /* compute the eigenvectors to augment the subspace : use an adaptive strategy */
     res = ksp->rnorm;
     if (!ksp->reason && agmres->neig > 0) {
-      test = agmres->max_k * log(ksp->rtol/res) / log(res/res_old); /* estimate the remaining number of steps */
+      test = agmres->max_k * PetscLogReal(ksp->rtol/res) / PetscLogReal(res/res_old); /* estimate the remaining number of steps */
       if ((test > agmres->smv*(ksp->max_it-ksp->its)) || agmres->force) {
         if (!agmres->force && ((test > agmres->bgv*(ksp->max_it-ksp->its)) && ((agmres->r + 1) < agmres->max_neig))) {
           agmres->neig += 1; /* Augment the number of eigenvalues to deflate if the convergence is too slow */
   PetscErrorCode ierr;
   PetscBool      iascii,isstring;
 #if defined(KSP_AGMRES_NONORM)
-  const char *Nstr = "SCALING FACTORS : NO";
+  const char     *Nstr = "SCALING FACTORS : NO";
 #else
-  const char *Nstr = "SCALING FACTORS : YES";
+  const char     *Nstr = "SCALING FACTORS : YES";
 #endif
 
   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERSTRING,&isstring);CHKERRQ(ierr);
 
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer, " AGMRES : restart=%d using %s\n", agmres->max_k, cstr);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer, " AGMRES : %s\n", Nstr);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer, " AGMRES: Number of matvecs : %D\n", agmres->matvecs);CHKERRQ(ierr);
-    if (agmres->force) PetscViewerASCIIPrintf (viewer, " AGMRES: Adaptive strategy is used: FALSE\n");
-    else PetscViewerASCIIPrintf(viewer, " AGMRES: Adaptive strategy is used: TRUE\n");
+    ierr = PetscViewerASCIIPrintf(viewer," AGMRES : [[KSPGMRESSetRestart]]restart=%d using %s\n",agmres->max_k,cstr);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer," AGMRES : %s\n",Nstr);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer," AGMRES: Number of matvecs : %D\n",agmres->matvecs);CHKERRQ(ierr);
+    if (agmres->force) PetscViewerASCIIPrintf (viewer," AGMRES: [[KSPDGMRESForce]]Adaptive strategy is used: FALSE\n");
+    else PetscViewerASCIIPrintf(viewer," AGMRES: [[KSPDGMRESForce]]Adaptive strategy is used: TRUE\n");
     if (agmres->DeflPrecond) {
-      ierr=PetscViewerASCIIPrintf(viewer, " AGMRES: STRATEGY OF DEFLATION: PRECONDITIONER \n");CHKERRQ(ierr);
-      ierr=PetscViewerASCIIPrintf(viewer, "  AGMRES: Frequency of extracted eigenvalues = %D\n", agmres->neig);CHKERRQ(ierr);
-      ierr=PetscViewerASCIIPrintf(viewer, "  AGMRES: Total number of extracted eigenvalues = %D\n", agmres->r);CHKERRQ(ierr);
-      ierr=PetscViewerASCIIPrintf(viewer, "  AGMRES: Maximum number of eigenvalues set to be extracted = %D\n", agmres->max_neig);CHKERRQ(ierr);
+      ierr=PetscViewerASCIIPrintf(viewer," AGMRES: STRATEGY OF DEFLATION: PRECONDITIONER \n");CHKERRQ(ierr);
+      ierr=PetscViewerASCIIPrintf(viewer,"  AGMRES: [[KSPDGMRESSetEigen]]Frequency of extracted eigenvalues = %D\n",agmres->neig);CHKERRQ(ierr);
+      ierr=PetscViewerASCIIPrintf(viewer,"  AGMRES: Total number of extracted eigenvalues = %D\n",agmres->r);CHKERRQ(ierr);
+      ierr=PetscViewerASCIIPrintf(viewer,"  AGMRES: [[KSPDGMRESSetMaxEigen]]Maximum number of eigenvalues set to be extracted = %D\n",agmres->max_neig);CHKERRQ(ierr);
     } else {
-      if (agmres->ritz) sprintf(ritzvec, "Ritz vectors");
-      else sprintf(ritzvec, "Harmonic Ritz vectors");
-      ierr = PetscViewerASCIIPrintf(viewer, " AGMRES: STRATEGY OF DEFLATION: AUGMENT\n");CHKERRQ(ierr);
-      ierr = PetscViewerASCIIPrintf(viewer," AGMRES: augmented vectors  %d at frequency %d with %s\n", agmres->r, agmres->neig, ritzvec);CHKERRQ(ierr);
+      if (agmres->ritz) sprintf(ritzvec,"Ritz vectors");
+      else sprintf(ritzvec,"Harmonic Ritz vectors");
+      ierr = PetscViewerASCIIPrintf(viewer," AGMRES: STRATEGY OF DEFLATION: AUGMENT\n");CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer," AGMRES: augmented vectors  %d at [[KSPDGMRESSetEigen]]frequency %d with [[KSPDGMRESHarmonic]]%s\n",agmres->r,agmres->neig,ritzvec);CHKERRQ(ierr);
     }
-    ierr=PetscViewerASCIIPrintf(viewer, " AGMRES: Minimum relaxation parameter for the adaptive strategy(smv)  = %g\n", agmres->smv);
-    ierr=PetscViewerASCIIPrintf(viewer, " AGMRES: Maximum relaxation parameter for the adaptive strategy(bgv)  = %g\n", agmres->bgv);
+    ierr=PetscViewerASCIIPrintf(viewer," AGMRES: [[KSPDGMRESSetRatio]]Minimum relaxation parameter for the adaptive strategy(smv)  = %g\n",agmres->smv);
+    ierr=PetscViewerASCIIPrintf(viewer," AGMRES: [[KSPGMRESSetMaxRatio]]Maximum relaxation parameter for the adaptive strategy(bgv)  = %g\n",agmres->bgv);
   } else if (isstring) {
     ierr = PetscViewerStringSPrintf(viewer,"%s restart %D",cstr,agmres->max_k);CHKERRQ(ierr);
   }
   PetscErrorCode ierr;
   PetscInt       neig;
   KSP_AGMRES     *agmres = (KSP_AGMRES*)ksp->data;
-  PetscBool      flg, Set;
+  PetscBool      flg,Set;
 
   PetscFunctionBegin;
   ierr = KSPSetFromOptions_DGMRES(ksp);  /* Set common options from DGMRES and GMRES */
   ierr = PetscOptionsHead("KSP AGMRES Options");CHKERRQ(ierr);
-  ierr = PetscOptionsInt("-ksp_agmres_eigen", "Number of eigenvalues to deflate", "KSPDGMRESSetEigen", agmres->neig, &neig, &flg);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-ksp_agmres_eigen","Number of eigenvalues to deflate","KSPDGMRESSetEigen",agmres->neig,&neig,&flg);CHKERRQ(ierr);
   if (flg) {
-    ierr      = KSPDGMRESSetEigen_DGMRES(ksp, neig);CHKERRQ(ierr);
+    ierr      = KSPDGMRESSetEigen_DGMRES(ksp,neig);CHKERRQ(ierr);
     agmres->r = 0;
   } else agmres->neig = 0;
-  ierr = PetscOptionsInt("-ksp_agmres_maxeigen", "Maximum number of eigenvalues to deflate", "KSPDGMRESSetMaxEigen", agmres->max_neig, &neig, &flg);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-ksp_agmres_maxeigen","Maximum number of eigenvalues to deflate","KSPDGMRESSetMaxEigen",agmres->max_neig,&neig,&flg);CHKERRQ(ierr);
   if (flg) agmres->max_neig = neig+EIG_OFFSET;
   else agmres->max_neig = agmres->neig+EIG_OFFSET;
-  ierr                = PetscOptionsBool("-ksp_agmres_DeflPrecond", "Determine if the deflation should be applied as a preconditioner -- similar to KSP DGMRES", "KSPGMRESDeflPrecond", PETSC_FALSE, &Set, &flg);
+  ierr                = PetscOptionsBool("-ksp_agmres_DeflPrecond","Determine if the deflation should be applied as a preconditioner -- similar to KSP DGMRES","KSPGMRESDeflPrecond",PETSC_FALSE,&Set,&flg);
   agmres->DeflPrecond = flg;
-  ierr                = PetscOptionsBool("-ksp_agmres_ritz", "Compute the Ritz vectors instead of the Harmonic Ritz vectors ", "KSPGMRESHarmonic", PETSC_FALSE, &Set, &flg);
+  ierr                = PetscOptionsBool("-ksp_agmres_ritz","Compute the Ritz vectors instead of the Harmonic Ritz vectors ","KSPDGMRESHarmonic",PETSC_FALSE,&Set,&flg);
   agmres->ritz        = flg;
-  ierr                = PetscOptionsReal("-ksp_agmres_MinRatio", "Relaxation parameter in the adaptive strategy; smallest multiple of the remaining number of steps allowed", "KSPGMRESSetMinRatio", 1, &(agmres->smv), &flg);
+  ierr                = PetscOptionsReal("-ksp_agmres_MinRatio","Relaxation parameter in the adaptive strategy; smallest multiple of the remaining number of steps allowed","KSPGMRESSetMinRatio",1,&(agmres->smv),&flg);
   CHKERRQ(ierr);
-  ierr = PetscOptionsReal("-ksp_agmres_MaxRatio", "Relaxation parameter in the adaptive strategy; Largest multiple of the remaining number of steps allowed", "KSPGMRESSetMaxRatio", 1, &(agmres->bgv), &flg);
+  ierr = PetscOptionsReal("-ksp_agmres_MaxRatio","Relaxation parameter in the adaptive strategy; Largest multiple of the remaining number of steps allowed","KSPGMRESSetMaxRatio",1,&(agmres->bgv),&flg);
   CHKERRQ(ierr);
   ierr = PetscOptionsTail();CHKERRQ(ierr);
   PetscFunctionReturn(0);
  KSPAGMRES - Newton basis GMRES implementation with adaptive augmented eigenvectors
 
 The techniques used are best described in [1]. The contribution of this work is that it combines many of the previous work to reduce the amount of MPI messages and improve the robustness of the global approach by using deflation techniques. It has been successfully applied to a class of real and industrial problems. Please see [1] for numerical experiments and [2] for a description of these problems.
-There are  many ongoing work that aim at avoiding (or minimizing) the communication in Krylov subspace methods. This code can be used as an experimental framework to combine several techniques in the particular case of GMRES. For instance, the computation of the shifts can be improved with techniques described in [3]. The orthogonalization technique can be replaced by TSQR [4]. The generation of the basis can be done using s-steps approaches[5].
+There are  many ongoing work that aim at avoiding (or minimizing) the communication in Krylov subspace methods. This code can be used as an experimental framework to combine several techniques in the particular case of GMRES. For instance,the computation of the shifts can be improved with techniques described in [3]. The orthogonalization technique can be replaced by TSQR [4]. The generation of the basis can be done using s-steps approaches[5].
 
 
  Options Database Keys:
- +   -ksp_gmres_restart <restart> -  the number of Krylov directions
- .   -ksp_gmres_krylov_monitor - plot the Krylov space generated
+ +   See KSPGMRES Options
+ .   See KSPDGMRES for additional options
  .   -ksp_agmres_eigen <neig> - Number of eigenvalues to deflate (Number of vectors to augment)
  .   -ksp_agmres_maxeigen <max_neig> - Maximum number of eigenvalues to deflate
  .   -ksp_agmres_MinRatio <1> - Relaxation parameter in the adaptive strategy; smallest multiple of the remaining number of steps allowed
  .   -ksp_agmres_MaxRatio <1> - Relaxation parameter in the adaptive strategy; Largest multiple of the remaining number of steps allowed
- .   --ksp_agmres_DeflPrecond  Apply deflation as a preconditioner, this is similar to DGMRES but it rather builds a Newton basis.  This is an experimental option.
- .   -ksp_dgmres_force <0, 1> - Force the deflation at each restart.
- .   - There are many experimental parameters. Run with -help option to see the whole list
+ .   -ksp_agmres_DeflPrecond  Apply deflation as a preconditioner,this is similar to DGMRES but it rather builds a Newton basis.  This is an experimental option.
+ .   -ksp_dgmres_force <0,1> - Force the deflation at each restart.
+ -   - There are many experimental parameters. Run with -help option to see the whole list
 
  Level: beginner
 
- Notes : Left and right preconditioning are supported, but not symmetric preconditioning. Complex arithmetic is not supported
+ Notes : Left and right preconditioning are supported,but not symmetric preconditioning. Complex arithmetic is not supported
 
  Developer Notes: This object is subclassed off of KSPDGMRES
 
   ierr = PetscObjectComposeFunction((PetscObject) ksp,"KSPGMRESSetHapTol_C",KSPGMRESSetHapTol_GMRES);CHKERRQ(ierr);
   ierr = PetscObjectComposeFunction((PetscObject) ksp,"KSPGMRESSetCGSRefinementType_C",KSPGMRESSetCGSRefinementType_GMRES);CHKERRQ(ierr);
   /* -- New functions defined in DGMRES -- */
-  ierr=PetscObjectComposeFunction((PetscObject) ksp, "KSPDGMRESSetEigen_C",KSPDGMRESSetEigen_DGMRES);CHKERRQ(ierr);
-  ierr=PetscObjectComposeFunction((PetscObject) ksp, "KSPDGMRESComputeSchurForm_C",KSPDGMRESComputeSchurForm_DGMRES);CHKERRQ(ierr);
-  ierr=PetscObjectComposeFunction((PetscObject) ksp, "KSPDGMRESComputeDeflationData_C",KSPDGMRESComputeDeflationData_DGMRES);CHKERRQ(ierr);
-  ierr=PetscObjectComposeFunction((PetscObject) ksp, "KSPDGMRESApplyDeflation_C",KSPDGMRESApplyDeflation_DGMRES);CHKERRQ(ierr);
+  ierr=PetscObjectComposeFunction((PetscObject) ksp,"KSPDGMRESSetEigen_C",KSPDGMRESSetEigen_DGMRES);CHKERRQ(ierr);
+  ierr=PetscObjectComposeFunction((PetscObject) ksp,"KSPDGMRESComputeSchurForm_C",KSPDGMRESComputeSchurForm_DGMRES);CHKERRQ(ierr);
+  ierr=PetscObjectComposeFunction((PetscObject) ksp,"KSPDGMRESComputeDeflationData_C",KSPDGMRESComputeDeflationData_DGMRES);CHKERRQ(ierr);
+  ierr=PetscObjectComposeFunction((PetscObject) ksp,"KSPDGMRESApplyDeflation_C",KSPDGMRESApplyDeflation_DGMRES);CHKERRQ(ierr);
 
   PetscInt KSP_CLASSID = 1;
-  ierr = PetscLogEventRegister("AGMRESComputeDefl", KSP_CLASSID, &KSP_AGMRESComputeDeflationData);CHKERRQ(ierr);
-  ierr = PetscLogEventRegister("AGMRESBuildBasis", KSP_CLASSID, &KSP_AGMRESBuildBasis);CHKERRQ(ierr);
-  ierr = PetscLogEventRegister("AGMRESCompShifts", KSP_CLASSID, &KSP_AGMRESComputeShifts);CHKERRQ(ierr);
-  ierr = PetscLogEventRegister("AGMRESOrthog", KSP_CLASSID, &KSP_AGMRESRoddec);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("AGMRESComputeDefl",KSP_CLASSID,&KSP_AGMRESComputeDeflationData);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("AGMRESBuildBasis",KSP_CLASSID,&KSP_AGMRESBuildBasis);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("AGMRESCompShifts",KSP_CLASSID,&KSP_AGMRESComputeShifts);CHKERRQ(ierr);
+  ierr = PetscLogEventRegister("AGMRESOrthog",KSP_CLASSID,&KSP_AGMRESRoddec);CHKERRQ(ierr);
 
   agmres->haptol         = 1.0e-30;
   agmres->q_preallocate  = 0;

File src/ksp/ksp/impls/gmres/dgmres/dgmres.c

   ierr = KSPView_GMRES(ksp,viewer);CHKERRQ(ierr);
   ierr = PetscObjectTypeCompare((PetscObject) viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    if (dgmres->force) PetscViewerASCIIPrintf(viewer, "   DGMRES: Adaptive strategy is used: FALSE\n");
-    else PetscViewerASCIIPrintf(viewer, "   DGMRES: Adaptive strategy is used: TRUE\n");
+    if (dgmres->force) PetscViewerASCIIPrintf(viewer, "   DGMRES: [[KSPDGMRESForce]]Adaptive strategy is used: FALSE\n");
+    else PetscViewerASCIIPrintf(viewer, "   DGMRES: [[KSPDGMRESForce]]Adaptive strategy is used: TRUE\n");
     ierr = PetscOptionsHasName(NULL, "-ksp_dgmres_harmonic_ritz", &isharmonic);CHKERRQ(ierr);
     if (isharmonic) {
-      ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: Frequency of extracted eigenvalues = %D using Harmonic Ritz values \n", dgmres->neig);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: [[KSPDGMRESSetEigen]]Frequency of extracted eigenvalues = %D using [[KSPDGMRESHarmonic]]Harmonic Ritz values \n", dgmres->neig);CHKERRQ(ierr);
     } else {
-      ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: Frequency of extracted eigenvalues = %D using Ritz values \n", dgmres->neig);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: [[KSPDGMRESSetEigen]]Frequency of extracted eigenvalues = %D using [[KSPDGMRESHarmonic]]Ritz values \n", dgmres->neig);CHKERRQ(ierr);
     }
     ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: Total number of extracted eigenvalues = %D\n", dgmres->r);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: Maximum number of eigenvalues set to be extracted = %D\n", dgmres->max_neig);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: relaxation parameter for the adaptive strategy(smv)  = %g\n", dgmres->smv);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: [[KSPDGMRESSetMaxEigen]]Maximum number of eigenvalues set to be extracted = %D\n", dgmres->max_neig);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: [[KSPDGMRESSetRatio]]relaxation parameter for the adaptive strategy(smv)  = %g\n", dgmres->smv);CHKERRQ(ierr);
     ierr = PetscViewerASCIIPrintf(viewer, "  DGMRES: Number of matvecs : %D\n", dgmres->matvecs);CHKERRQ(ierr);
   }
   PetscFunctionReturn(0);
                  stagnation occurs.
 
    Options Database Keys:
-   GMRES Options (inherited):
-+   -ksp_gmres_restart <restart> - the number of Krylov directions to orthogonalize against
-.   -ksp_gmres_haptol <tol> - sets the tolerance for "happy ending" (exact convergence)
-.   -ksp_gmres_preallocate - preallocate all the Krylov search directions initially (otherwise groups of
-                             vectors are allocated as needed)
-.   -ksp_gmres_classicalgramschmidt - use classical (unmodified) Gram-Schmidt to orthogonalize against the Krylov space (fast) (the default)
-.   -ksp_gmres_modifiedgramschmidt - use modified Gram-Schmidt in the orthogonalization (more stable, but slower)
-.   -ksp_gmres_cgs_refinement_type <never,ifneeded,always> - determine if iterative refinement is used to increase the
-                                   stability of the classical Gram-Schmidt  orthogonalization.
--   -ksp_gmres_krylov_monitor - plot the Krylov space generated
-
-   DGMRES Options Database Keys:
-+   -ksp_dgmres_eigen <neig> - number of smallest eigenvalues to extract at each restart
++   See KSPGMRES Options
+.   -ksp_dgmres_eigen <neig> - number of smallest eigenvalues to extract at each restart
 .   -ksp_dgmres_max_eigen <max_neig> - maximum number of eigenvalues that can be extracted during the iterative
                                        process
 .   -ksp_dgmres_force - use the deflation at each restart; switch off the adaptive strategy.

File src/ksp/ksp/impls/gmres/lgmres/lgmres.c

 
 #undef __FUNCT__
 #define __FUNCT__ "KSPLGMRESSetAugDim"
+/*@
+    KSPLGMRESSetAugDim - Sets number of error approximations to augment the Krylov space
+
+   Logically collective on KSP
+
+   Input Parameters:
++    ksp - the Krylov solver
+-    dim - the number of vectors (2 is the default)
+
+   Options Database:
+.   -ksp_lgmres_aug_dim <dim> 
+
+@*/
 PetscErrorCode  KSPLGMRESSetAugDim(KSP ksp, PetscInt dim)
 {
   PetscErrorCode ierr;
 
 #undef __FUNCT__
 #define __FUNCT__ "KSPLGMRESSetConstant"
+/*@
+    KSPLGMRESSetConstant - Approximate space size is kept constant
+
+   Logically collective on KSP
+
+   Input Parameters:
+.    ksp - the Krylov solver
+
+   Options Database:
+.   -ksp_lgmres_constant
+
+   Developer Note: I have no idea what this means
+@*/
 PetscErrorCode  KSPLGMRESSetConstant(KSP ksp)
 {
   PetscErrorCode ierr;
 
 /*
 
-    KSPLGMRESCycle - Run lgmres, possibly with restart.  Return residual
-                  history if requested.
+    KSPLGMRESCycle - Run lgmres
 
     input parameters:
 .        lgmres  - structure containing parameters and work areas
                   are defined.  If null, ignored.  If null, ignored.
 .        converged - 0 if not converged
 
-
     Notes:
     On entry, the value in vector VEC_VV(0) should be
     the initial residual.
 
-
  */
 #undef __FUNCT__
 #define __FUNCT__ "KSPLGMRESCycle"
   PetscInt       max_it = ksp->max_it;  /* max # of overall iterations for the method */
 
   /* LGMRES_MOD - new variables*/
-  PetscInt    aug_dim = lgmres->aug_dim;
-  PetscInt    spot    = 0;
-  PetscInt    order   = 0;
-  PetscInt    it_arnoldi;                /* number of arnoldi steps to take */
-  PetscInt    it_total;                  /* total number of its to take (=approx space size)*/
-  PetscInt    ii, jj;
-  PetscReal   tmp_norm;
-  PetscScalar inv_tmp_norm;
-  PetscScalar *avec;
+  PetscInt       aug_dim = lgmres->aug_dim;
+  PetscInt       spot    = 0;
+  PetscInt       order   = 0;
+  PetscInt       it_arnoldi;                /* number of arnoldi steps to take */
+  PetscInt       it_total;                  /* total number of its to take (=approx space size)*/
+  PetscInt       ii, jj;
+  PetscReal      tmp_norm;
+  PetscScalar    inv_tmp_norm;
+  PetscScalar    *avec;
 
   PetscFunctionBegin;
-  /* Number of pseudo iterations since last restart is the number
-     of prestart directions */
+  /* Number of pseudo iterations since last restart is the number  of prestart directions */
   loc_it = 0;
 
   /* LGMRES_MOD: determine number of arnoldi steps to take */
   if (!res) {
     if (itcount) *itcount = 0;
     ksp->reason = KSP_CONVERGED_ATOL;
-
     ierr = PetscInfo(ksp,"Converged due to zero residual norm on entry\n");CHKERRQ(ierr);
     PetscFunctionReturn(0);
   }
 
   /* scale VEC_VV (the initial residual) */
-  tmp = 1.0/res_norm; ierr = VecScale(VEC_VV(0),tmp);CHKERRQ(ierr);
+  tmp = 1.0/res_norm; 
+  ierr = VecScale(VEC_VV(0),tmp);CHKERRQ(ierr);
 
   ksp->rnorm = res;
 
-
   /* note: (lgmres->it) is always set one less than (loc_it) It is used in
      KSPBUILDSolution_LGMRES, where it is passed to KSPLGMRESBuildSoln.
      Note that when KSPLGMRESBuildSoln is called from this function,
 
 
   /* MAIN ITERATION LOOP BEGINNING*/
-
-
   /* keep iterating until we have converged OR generated the max number
      of directions OR reached the max number of iterations for the method */
   ierr = (*ksp->converged)(ksp,ksp->its,res,&ksp->reason,ksp->cnvP);CHKERRQ(ierr);
     /* see if more space is needed for work vectors */
     if (lgmres->vv_allocated <= loc_it + VEC_OFFSET + 1) {
       ierr = KSPLGMRESGetNewVectors(ksp,loc_it+1);CHKERRQ(ierr);
-      /* (loc_it+1) is passed in as number of the first vector that should
-          be allocated */
+      /* (loc_it+1) is passed in as number of the first vector that should   be allocated */
     }
 
     /*LGMRES_MOD: decide whether this is an arnoldi step or an aug step */
     *HH(loc_it+1,loc_it)  = tt;
     *HES(loc_it+1,loc_it) = tt;
 
-
     /* check for the happy breakdown */
     hapbnd = PetscAbsScalar(tt / *GRS(loc_it)); /* GRS(loc_it) contains the res_norm from the last iteration  */
     if (hapbnd > lgmres->haptol) hapbnd = lgmres->haptol;
 
   ierr = KSPLGMRESBuildSoln(GRS(0),ksp->vec_sol,ksp->vec_sol,ksp,loc_it-1);CHKERRQ(ierr);
 
-
   /* LGMRES_MOD collect aug vector and A*augvector for future restarts -
      only if we will be restarting (i.e. this cycle performed it_total
      iterations)  */
       }
     }
 
-
-
     ierr = VecCopy(AUG_TEMP, AUGVEC(spot));CHKERRQ(ierr);
     /*need to normalize */
     ierr = VecNorm(AUGVEC(spot), NORM_2, &tmp_norm);CHKERRQ(ierr);
     /*now add the A*aug vector to A_AUGVEC(spot)  - this is independ. of preconditioning type*/
     /* want V*H*y - y is in GRS, V is in VEC_VV and H is in HES */
 
-
     /* first do H+*y */
     avec = lgmres->hwork;
     ierr = PetscMemzero(avec,(it_total+1)*sizeof(*avec));CHKERRQ(ierr);
       }
     }
 
-    /*now multiply result by V+ */
+    /* multiply result by V+ */
     ierr = VecSet(VEC_TEMP,0.0);CHKERRQ(ierr);
     ierr = VecMAXPY(VEC_TEMP, it_total+1, avec, &VEC_VV(0));CHKERRQ(ierr); /*answer is in VEC_TEMP*/
 
   PetscFunctionReturn(0);
 }
 
-/*
-
-   KSPDestroy_LGMRES - Frees all memory space used by the Krylov method.
-
-*/
 #undef __FUNCT__
 #define __FUNCT__ "KSPDestroy_LGMRES"
 PetscErrorCode KSPDestroy_LGMRES(KSP ksp)
 }
 
 /*
-    KSPLGMRESBuildSoln - create the solution from the starting vector and the
-                      current iterates.
+    KSPLGMRESBuildSoln - create the solution from the starting vector and the  current iterates.
 
     Input parameters:
         nrs - work area of size it + 1.
   PetscInt       ii,k,j;
   KSP_LGMRES     *lgmres = (KSP_LGMRES*)(ksp->data);
   /*LGMRES_MOD */
-  PetscInt it_arnoldi, it_aug;
-  PetscInt jj, spot = 0;
+  PetscInt       it_arnoldi, it_aug;
+  PetscInt       jj, spot = 0;
 
   PetscFunctionBegin;
   /* Solve for solution vector that minimizes the residual */
   /* now it_arnoldi indicates the number of matvecs that took place */
   lgmres->matvecs += it_arnoldi;
 
-
   /* solve the upper triangular system - GRS is the right side and HH is
      the upper triangular matrix  - put soln in nrs */
   if (*HH(it,it) == 0.0) SETERRQ2(PETSC_COMM_SELF,PETSC_ERR_CONV_FAILED,"HH(it,it) is identically zero; it = %D GRS(it) = %g",it,(double)PetscAbsScalar(*GRS(it)));
     ierr = VecMAXPY(VEC_TEMP,it_arnoldi,nrs,&VEC_VV(0));CHKERRQ(ierr);
     /*now add augmented portions - add contribution of aug vectors one at a time*/
 
-
     for (ii=0; ii<it_aug; ii++) {
       for (jj=0; jj<lgmres->aug_dim; jj++) {
         if (lgmres->aug_order[jj] == (ii+1)) {
     lgmres->vecs[it+VEC_OFFSET+k] = lgmres->user_work[nwork][k];
   }
 
-
   /* LGMRES_MOD - for now we are preallocating the augmentation vectors */
 
-
   /* increment the number of work vector chunks */
   lgmres->nwork_alloc++;
   PetscFunctionReturn(0);
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
     /*LGMRES_MOD */
-    ierr = PetscViewerASCIIPrintf(viewer,"  LGMRES: aug. dimension=%D\n",lgmres->aug_dim);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  LGMRES: [[KSPLGMRESSetAugDim]]Number of error approximations to augment the Krylov space=%D\n",lgmres->aug_dim);CHKERRQ(ierr);
     if (lgmres->approx_constant) {
-      ierr = PetscViewerASCIIPrintf(viewer,"  LGMRES: approx. space size was kept constant.\n");CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer,"  LGMRES: [[KSPGMRESSetConstant]]approximate space size was kept constant.\n");CHKERRQ(ierr);
     }
     ierr = PetscViewerASCIIPrintf(viewer,"  LGMRES: number of matvecs=%D\n",lgmres->matvecs);CHKERRQ(ierr);
   }
   PetscFunctionBegin;
   ierr = KSPSetFromOptions_GMRES(ksp);CHKERRQ(ierr);
   ierr = PetscOptionsHead("KSP LGMRES Options");CHKERRQ(ierr);
-  ierr = PetscOptionsBool("-ksp_lgmres_constant","Use constant approx. space size","KSPGMRESSetConstant",flg,&flg,NULL);CHKERRQ(ierr);
+  ierr = PetscOptionsBool("-ksp_lgmres_constant","Use constant approximate space size","KSPGMRESSetConstant",flg,&flg,NULL);CHKERRQ(ierr);
   if (flg) lgmres->approx_constant = 1;
-  ierr = PetscOptionsInt("-ksp_lgmres_augment","Number of error approximations to augment the Krylov space with","KSPLGMRESSetAugDim",lgmres->aug_dim,&aug,&flg);CHKERRQ(ierr);
+  ierr = PetscOptionsInt("-ksp_lgmres_aug_dim","Number of error approximations to augment the Krylov space","KSPLGMRESSetAugDim",lgmres->aug_dim,&aug,&flg);CHKERRQ(ierr);
   if (flg) { ierr = KSPLGMRESSetAugDim(ksp,aug);CHKERRQ(ierr); }
   ierr = PetscOptionsTail();CHKERRQ(ierr);
   PetscFunctionReturn(0);
                 the error from previous restart cycles.
 
   Options Database Keys:
-+   -ksp_gmres_restart <restart> - total approximation space size (Krylov directions + error approximations)
-.   -ksp_gmres_haptol <tol> - sets the tolerance for "happy ending" (exact convergence)
-.   -ksp_gmres_preallocate - preallocate all the Krylov search directions initially (otherwise groups of
-                            vectors are allocated as needed)
-.   -ksp_gmres_classicalgramschmidt - use classical (unmodified) Gram-Schmidt to orthogonalize against the Krylov space (fast) (the default)
-.   -ksp_gmres_modifiedgramschmidt - use modified Gram-Schmidt in the orthogonalization (more stable, but slower)
-.   -ksp_gmres_cgs_refinement_type <never,ifneeded,always> - determine if iterative refinement is used to increase the
-                                  stability of the classical Gram-Schmidt  orthogonalization.
-.   -ksp_gmres_krylov_monitor - plot the Krylov space generated
++   See KSPGMRES for additional options
 .   -ksp_lgmres_augment <k> - number of error approximations to augment the Krylov space with
 -   -ksp_lgmres_constant - use a constant approx. space size (only affects restart cycles < num. error approx.(k), i.e. the first k restarts)
 

File src/ksp/ksp/impls/lcd/lcd.c

   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  LCD: restart=%d\n",lcd->restart);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  LCD: happy breakdown tolerance %g\n",lcd->haptol);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  LCD: [[KSPLCDSetRestart]]restart=%d\n",lcd->restart);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  LCD: [[KSPLCDSetHapTol]]happy breakdown tolerance %g\n",lcd->haptol);CHKERRQ(ierr);
   }
   PetscFunctionReturn(0);
 }
 
    Options Database Keys:
 +   -ksp_lcd_restart - number of vectors conjudate
--   -ksp_lcd_haptol - tolerance for exact convergence (happing ending)
+-   -ksp_lcd_haptol - tolerance for exact convergence (happy ending)
 
    Level: beginner
 

File src/ksp/ksp/impls/lsqr/lsqr.c

 
   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)ksp->pc,PCNONE,&nopreconditioner);CHKERRQ(ierr);
-  /*  nopreconditioner =PETSC_FALSE; */
 
   lsqr->nwork_m = 2;
   if (lsqr->vwork_m) {
   PetscFunctionReturn(0);
 }
 
-
 #undef __FUNCT__
 #define __FUNCT__ "KSPDestroy_LSQR"
 PetscErrorCode KSPDestroy_LSQR(KSP ksp)
   PetscFunctionBegin;
   ierr = PetscOptionsHead("KSP LSQR Options");CHKERRQ(ierr);
   ierr = PetscOptionsName("-ksp_lsqr_set_standard_error","Set Standard Error Estimates of Solution","KSPLSQRSetStandardErrorVec",&lsqr->se_flg);CHKERRQ(ierr);
-  ierr = PetscOptionsString("-ksp_lsqr_monitor","Monitor residual norm and norm of residual of normal equations","KSPMonitorSet","stdout",monfilename,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);
+  ierr = PetscOptionsString("-ksp_lsqr_monitor","Monitor residual norm and norm of residual of normal equations","KSPLSQRMonitor","stdout",monfilename,PETSC_MAX_PATH_LEN,&flg);CHKERRQ(ierr);
   if (flg) {
     ierr = PetscViewerASCIIOpen(PetscObjectComm((PetscObject)ksp),monfilename,&monviewer);CHKERRQ(ierr);
     ierr = KSPMonitorSet(ksp,KSPLSQRMonitorDefault,monviewer,(PetscErrorCode (*)(void**))PetscViewerDestroy);CHKERRQ(ierr);
       PetscReal rnorm;
       ierr = KSPLSQRGetStandardErrorVec(ksp,&lsqr->se);CHKERRQ(ierr);
       ierr = VecNorm(lsqr->se,NORM_2,&rnorm);CHKERRQ(ierr);
-      ierr = PetscViewerASCIIPrintf(viewer,"  Norm of Standard Error %g, Iterations %D\n",(double)rnorm,ksp->its);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPLSQRSetStandardErrorVec]]Norm of Standard Error %g, Iterations %D\n",(double)rnorm,ksp->its);CHKERRQ(ierr);
     }
   }
   PetscFunctionReturn(0);
   PetscFunctionReturn(0);
 }
 
-
-
 /*MC
      KSPLSQR - This implements LSQR
 
    Developer Notes: How is this related to the KSPCGNE implementation? One difference is that KSPCGNE applies
             the preconditioner transpose times the preconditioner,  so one does not need to pass A'*A as the third argument to KSPSetOperators().
 
-
    For least squares problems without a zero to A*x = b, there are additional convergence tests for the residual of the normal equations, A'*(b - Ax), see KSPLSQRDefaultConverged()
 
 .seealso:  KSPCreate(), KSPSetType(), KSPType (for list of available types), KSP, KSPLSQRDefaultConverged()

File src/ksp/ksp/impls/rich/rich.c

   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
     if (richardsonP->selfscale) {
-      ierr = PetscViewerASCIIPrintf(viewer,"  Richardson: using self-scale best computed damping factor\n");CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer,"  Richardson: [[KSPRichardsonSetSelfScale]]using self-scale best computed damping factor\n");CHKERRQ(ierr);
     } else {
-      ierr = PetscViewerASCIIPrintf(viewer,"  Richardson: damping factor=%g\n",(double)richardsonP->scale);CHKERRQ(ierr);
+      ierr = PetscViewerASCIIPrintf(viewer,"  Richardson: [[KSPRichardsonSetScale]]damping factor=%g\n",(double)richardsonP->scale);CHKERRQ(ierr);
     }
   }
   PetscFunctionReturn(0);
      KSPRICHARDSON - The preconditioned Richardson iterative method
 
    Options Database Keys:
-.   -ksp_richardson_scale - damping factor on the correction (defaults to 1.0)
+.   -ksp_richardson_scale <damp> - damping factor on the correction (defaults to 1.0)
 
    Level: beginner
 

File src/ksp/ksp/interface/itcreate.c

       ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetPCSide]]left preconditioning\n");CHKERRQ(ierr);
     }
     if (ksp->guess) {ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetUseFischerGuess]]using Fischers initial guess method %D with size %D\n",ksp->guess->method,ksp->guess->maxl);CHKERRQ(ierr);}
-    if (ksp->dscale) {ierr = PetscViewerASCIIPrintf(viewer,"  diagonally scaled system\n");CHKERRQ(ierr);}
+    if (ksp->dscale) {ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetDiagonalScale]]diagonally scaled system\n");CHKERRQ(ierr);}
     if (ksp->nullsp) {ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetNullSpace]]has attached null space\n");CHKERRQ(ierr);}
     if (!ksp->guess_zero) {ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetInitialGuessNonzero]]using nonzero initial guess\n");CHKERRQ(ierr);}
     ierr = PetscViewerASCIIPrintf(viewer,"  [[KSPSetNormType]]using %s norm type for convergence test\n",KSPNormTypes[ksp->normtype]);CHKERRQ(ierr);

File src/sys/objects/pname.c

   PetscFunctionReturn(0);
 }
 
-#include <../src/sys/classes/viewer/impls/ascii/asciiimpl.h>
+#undef __FUNCT__
+#define __FUNCT__ "PetscObjectPrintSubType"
+/*@C
+      PetscObjectPrintSubType - used in some XXXView__YYY() methods to display the subtype information
+
+   Input Parameters:
++     obj - the PETSc object
+-     viewer - ASCII viewer where the information is printed
+
+   Level: developer
+
+.seealso: PetscObjectSetName(), PetscObjectName()
+
+@*/
+PetscErrorCode PetscObjectPrintSubType(PetscObject obj,PetscViewer viewer,const char *subtype)
+{
+  PetscErrorCode ierr;
+  PetscBool      ishtml;
+  char           type[64],capsubtype[64];
+
+  PetscFunctionBegin;
+  ierr = PetscStrncpy(type,obj->type_name,sizeof(type));CHKERRQ(ierr);
+  ierr = PetscStrtoupper(type);CHKERRQ(ierr);
+  ierr = PetscStrncpy(capsubtype,subtype,sizeof(capsubtype));CHKERRQ(ierr);
+  ierr = PetscStrtoupper(capsubtype);CHKERRQ(ierr);
+
+  ierr = PetscViewerASCIIGetHTML(viewer,&ishtml);CHKERRQ(ierr);
+  if (ishtml) {
+    ierr = PetscViewerASCIIPrintf(viewer,"  %s: " PETSCMANUALPAGEBASEURL "%s%sType.html\"><span title=\"%s%sType\">type</span></a>: " PETSCMANUALPAGEBASEURL "%s%s%s.html\"><span title=\"%s%s%s\">%s</span></a>\n",type,obj->class_name,type,obj->class_name,type,obj->class_name,type,capsubtype,obj->class_name,type,capsubtype,subtype);CHKERRQ(ierr);
+  } else {
+    ierr = PetscViewerASCIIPrintf(viewer,"  %s: Type %s\n",type,subtype);CHKERRQ(ierr);
+  }
+  PetscFunctionReturn(0);
+}
+
+
 #undef __FUNCT__
 #define __FUNCT__ "PetscObjectPrintClassNamePrefixType"
 /*@C
   PetscErrorCode    ierr;
   MPI_Comm          comm;
   PetscMPIInt       size;
-  PetscViewer_ASCII *ascii = (PetscViewer_ASCII*)viewer->data;
-
+  PetscBool         ishtml;
 
   PetscFunctionBegin;
-  if (ascii->html) {
-    ierr = PetscViewerASCIIPrintf(viewer," " PETSCMANUALPAGEBASEURL "%s.html\"><span title=\"%s\">%s</span></a> Object:",obj->class_name,obj->class_name,obj->class_name);CHKERRQ(ierr);
+  ierr = PetscViewerASCIIGetHTML(viewer,&ishtml);CHKERRQ(ierr);
+  if (ishtml) {
+    ierr = PetscViewerASCIIPrintf(viewer,PETSCMANUALPAGEBASEURL "%s.html\"><span title=\"%s\">%s</span></a> Object:",obj->class_name,obj->class_name,obj->class_name);CHKERRQ(ierr);
   } else {
     ierr = PetscViewerASCIIPrintf(viewer,"%s Object:",obj->class_name);CHKERRQ(ierr);
   }
   ierr = MPI_Comm_size(comm,&size);CHKERRQ(ierr);
   ierr = PetscViewerASCIIPrintf(viewer," %d MPI processes\n",size);CHKERRQ(ierr);
   if (obj->type_name) {
-    if (ascii->html) {
+    if (ishtml) {
       char manpage[64];
       ierr = PetscStrcpy(manpage,obj->class_name);CHKERRQ(ierr);
       ierr = PetscStrcat(manpage,obj->type_name);CHKERRQ(ierr);

File src/ts/impls/arkimex/arkimex.c

   if (iascii) {
     TSARKIMEXType arktype;
     char          buf[512];
+
     ierr = TSARKIMEXGetType(ts,&arktype);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  ARK IMEX %s\n",arktype);CHKERRQ(ierr);
+    ierr = PetscObjectPrintSubType((PetscObject)ts,viewer,arktype);CHKERRQ(ierr);
     ierr = PetscFormatRealArray(buf,sizeof(buf),"% 8.6f",tab->s,tab->ct);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Stiff abscissa       ct = %s\n",buf);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ARKIMEX: Stiff abscissa       ct = %s\n",buf);CHKERRQ(ierr);
     ierr = PetscFormatRealArray(buf,sizeof(buf),"% 8.6f",tab->s,tab->c);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"Stiffly accurate: %s\n",tab->stiffly_accurate ? "yes" : "no");CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"Explicit first stage: %s\n",tab->explicit_first_stage ? "yes" : "no");CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"FSAL property: %s\n",tab->FSAL_implicit ? "yes" : "no");CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Nonstiff abscissa     c = %s\n",buf);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ARKIMEX: Stiffly accurate: %s\n",tab->stiffly_accurate ? "yes" : "no");CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ARKIMEX: Explicit first stage: %s\n",tab->explicit_first_stage ? "yes" : "no");CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ARKIMEX: FSAL property: %s\n",tab->FSAL_implicit ? "yes" : "no");CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ARKIMEX: Nonstiff abscissa     c = %s\n",buf);CHKERRQ(ierr);
   }
   ierr = TSGetAdapt(ts,&adapt);CHKERRQ(ierr);
   ierr = TSAdaptView(adapt,viewer);CHKERRQ(ierr);

File src/ts/impls/explicit/rk/rk.c

     TSRKType rktype;
     char     buf[512];
     ierr = TSRKGetType(ts,&rktype);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  RK %s\n",rktype);CHKERRQ(ierr);
+    ierr = PetscObjectPrintSubType((PetscObject)ts,viewer,rktype);CHKERRQ(ierr);
     ierr = PetscFormatRealArray(buf,sizeof(buf),"% 8.6f",tab->s,tab->c);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Abscissa     c = %s\n",buf);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"FSAL: %s\n",tab->FSAL ? "yes" : "no");CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  RK: Abscissa     c = %s\n",buf);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  RK: FSAL: %s\n",tab->FSAL ? "yes" : "no");CHKERRQ(ierr);
   }
   ierr = TSGetAdapt(ts,&adapt);CHKERRQ(ierr);
   ierr = TSAdaptView(adapt,viewer);CHKERRQ(ierr);

File src/ts/impls/implicit/alpha/alpha.c

   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  Alpha_m=%g, Alpha_f=%g, Gamma=%g\n",(double)th->Alpha_m,(double)th->Alpha_f,(double)th->Gamma);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ALPHA: [[TSAlphaSetRadius]]Alpha_m=%g, Alpha_f=%g, Gamma=%g\n",(double)th->Alpha_m,(double)th->Alpha_f,(double)th->Gamma);CHKERRQ(ierr);
   }
   ierr = SNESView(ts->snes,viewer);CHKERRQ(ierr);
   PetscFunctionReturn(0);

File src/ts/impls/implicit/gl/gl.c

   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    ierr    = PetscViewerASCIIPrintf(viewer,"  min order %D, max order %D, current order %D\n",gl->min_order,gl->max_order,gl->schemes[gl->current_scheme]->p);CHKERRQ(ierr);
-    ierr    = PetscViewerASCIIPrintf(viewer,"  Error estimation: %s\n",TSGLErrorDirections[gl->error_direction]);CHKERRQ(ierr);
-    ierr    = PetscViewerASCIIPrintf(viewer,"  Extrapolation: %s\n",gl->extrapolate ? "yes" : "no");CHKERRQ(ierr);
-    ierr    = PetscViewerASCIIPrintf(viewer,"  Acceptance test: %s\n",gl->accept_name[0] ? gl->accept_name : "(not yet set)");CHKERRQ(ierr);
+    ierr = PetscObjectPrintSubType((PetscObject)ts,viewer,gl->type_name[0] ? gl->type_name : "(not yet set)");CHKERRQ(ierr);
+    ierr    = PetscViewerASCIIPrintf(viewer,"  GL: [[TSGLSetMinOrder]]min order %D, [[TSGLSetMaxOrder]]max order %D, current order %D\n",gl->min_order,gl->max_order,gl->schemes[gl->current_scheme]->p);CHKERRQ(ierr);
+    ierr    = PetscViewerASCIIPrintf(viewer,"  GL: Error estimation: %s\n",TSGLErrorDirections[gl->error_direction]);CHKERRQ(ierr);
+    ierr    = PetscViewerASCIIPrintf(viewer,"  GL: [[TSGLSetExtrapolate]]Extrapolation: %s\n",gl->extrapolate ? "yes" : "no");CHKERRQ(ierr);
+    ierr    = PetscViewerASCIIPrintf(viewer,"  GL: [[TSGLSetAcceptType]]Acceptance test: %s\n",gl->accept_name[0] ? gl->accept_name : "(not yet set)");CHKERRQ(ierr);
     ierr    = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr);
     ierr    = TSGLAdaptView(gl->adapt,viewer);CHKERRQ(ierr);
     ierr    = PetscViewerASCIIPopTab(viewer);CHKERRQ(ierr);
-    ierr    = PetscViewerASCIIPrintf(viewer,"  type: %s\n",gl->type_name[0] ? gl->type_name : "(not yet set)");CHKERRQ(ierr);
-    ierr    = PetscViewerASCIIPrintf(viewer,"Schemes within family (%d):\n",gl->nschemes);CHKERRQ(ierr);
+    ierr    = PetscViewerASCIIPrintf(viewer,"  GL: Schemes within family (%d):\n",gl->nschemes);CHKERRQ(ierr);
     details = PETSC_FALSE;
     ierr    = PetscOptionsGetBool(((PetscObject)ts)->prefix,"-ts_gl_view_detailed",&details,NULL);CHKERRQ(ierr);
     ierr    = PetscViewerASCIIPushTab(viewer);CHKERRQ(ierr);

File src/ts/impls/implicit/theta/theta.c

   PetscFunctionBegin;
   ierr = PetscObjectTypeCompare((PetscObject)viewer,PETSCVIEWERASCII,&iascii);CHKERRQ(ierr);
   if (iascii) {
-    ierr = PetscViewerASCIIPrintf(viewer,"  Theta=%g\n",(double)th->Theta);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Extrapolation=%s\n",th->extrapolate ? "yes" : "no");CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  THETA: [[TSThetaSetTheta]]Theta=%g\n",(double)th->Theta);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  THETA: [[TSThetaSetExtrapolate]]Extrapolation=%s\n",th->extrapolate ? "yes" : "no");CHKERRQ(ierr);
   }
   ierr = SNESView(ts->snes,viewer);CHKERRQ(ierr);
   PetscFunctionReturn(0);

File src/ts/impls/rosw/rosw.c

     PetscReal  abscissa[512];
     char       buf[512];
     ierr = TSRosWGetType(ts,&rostype);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Rosenbrock-W %s\n",rostype);CHKERRQ(ierr);
+    ierr = PetscObjectPrintSubType((PetscObject)ts,viewer,rostype);CHKERRQ(ierr);
     ierr = PetscFormatRealArray(buf,sizeof(buf),"% 8.6f",tab->s,tab->ASum);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Abscissa of A       = %s\n",buf);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ROSW: Abscissa of A       = %s\n",buf);CHKERRQ(ierr);
     for (i=0; i<tab->s; i++) abscissa[i] = tab->ASum[i] + tab->Gamma[i];
     ierr = PetscFormatRealArray(buf,sizeof(buf),"% 8.6f",tab->s,abscissa);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  Abscissa of A+Gamma = %s\n",buf);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  ROSW: Abscissa of A+Gamma = %s\n",buf);CHKERRQ(ierr);
   }
   ierr = TSGetAdapt(ts,&adapt);CHKERRQ(ierr);
   ierr = TSAdaptView(adapt,viewer);CHKERRQ(ierr);

File src/ts/interface/ts.c

 #endif
   if (iascii) {
     ierr = PetscObjectPrintClassNamePrefixType((PetscObject)ts,viewer);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  maximum steps=%D\n",ts->max_steps);CHKERRQ(ierr);
-    ierr = PetscViewerASCIIPrintf(viewer,"  maximum time=%g\n",(double)ts->max_time);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  [[TSSetDuration]]maximum steps=%D\n",ts->max_steps);CHKERRQ(ierr);
+    ierr = PetscViewerASCIIPrintf(viewer,"  [[TSSetDuration]]maximum time=%g\n",(double)ts->max_time);CHKERRQ(ierr);
     if (ts->problem_type == TS_NONLINEAR) {
       ierr = PetscViewerASCIIPrintf(viewer,"  total number of nonlinear solver iterations=%D\n",ts->snes_its);CHKERRQ(ierr);
       ierr = PetscViewerASCIIPrintf(viewer,"  total number of nonlinear solve failures=%D\n",ts->num_snes_failures);CHKERRQ(ierr);
   ts->reject            = 0;
   ts->reason            = TS_CONVERGED_ITERATING;
 
-  ierr = TSViewFromOptions(ts,NULL,"-ts_view_pre");CHKERRQ(ierr);
-
   if (ts->ops->solve) {         /* This private interface is transitional and should be removed when all implementations are updated. */
     ierr = (*ts->ops->solve)(ts);CHKERRQ(ierr);
     ierr = VecCopy(ts->vec_sol,u);CHKERRQ(ierr);
     ts->solvetime = ts->ptime;
   } else {
+    PetscBool viewed = PETSC_FALSE;
     /* steps the requested number of timesteps. */
     if (ts->steps >= ts->max_steps)     ts->reason = TS_CONVERGED_ITS;
     else if (ts->ptime >= ts->max_time) ts->reason = TS_CONVERGED_TIME;
       ierr = TSMonitor(ts,ts->steps,ts->ptime,ts->vec_sol);CHKERRQ(ierr);
       ierr = TSStep(ts);CHKERRQ(ierr);
       ierr = TSPostStep(ts);CHKERRQ(ierr);
+      if (!viewed) {
+        viewed = PETSC_TRUE;
+        ierr   = TSViewFromOptions(ts,NULL,"-ts_view_pre");CHKERRQ(ierr);
+      }
     }
     if (ts->exact_final_time == TS_EXACTFINALTIME_INTERPOLATE && ts->ptime > ts->max_time) {
       ierr = TSInterpolate(ts,ts->max_time,u);CHKERRQ(ierr);