Actual source code: gmres2.c

  1: /*$Id: gmres2.c,v 1.35 2001/08/06 21:16:44 bsmith Exp $*/
 2:  #include src/ksp/ksp/impls/gmres/gmresp.h

  6: /*@C
  7:    KSPGMRESSetOrthogonalization - Sets the orthogonalization routine used by GMRES and FGMRES.

  9:    Collective on KSP

 11:    Input Parameters:
 12: +  ksp - iterative context obtained from KSPCreate
 13: -  fcn - orthogonalization function

 15:    Calling Sequence of function:
 16: $   errorcode = int fcn(KSP ksp,int it);
 17: $   it is one minus the number of GMRES iterations since last restart;
 18: $    i.e. the size of Krylov space minus one

 20:    Notes:
 21:    Two orthogonalization routines are predefined, including

 23:    KSPGMRESModifiedGramSchmidtOrthogonalization()

 25:    KSPGMRESClassicalGramSchmidtOrthogonalization() - Default. Use KSPGMRESSetCGSRefinementType() to determine if 
 26:      iterative refinement is used to increase stability. 


 29:    Options Database Keys:

 31: +  -ksp_gmres_unmodifiedgramschmidt - Activates KSPGMRESClassicalGramSchmidtOrthogonalization() (default)
 32: -  -ksp_gmres_modifiedgramschmidt - Activates KSPGMRESModifiedGramSchmidtOrthogonalization()

 34:    Level: intermediate

 36: .keywords: KSP, GMRES, set, orthogonalization, Gram-Schmidt, iterative refinement

 38: .seealso: KSPGMRESSetRestart(), KSPGMRESSetPreAllocateVectors(), KSPGMRESSetCGSRefinementType()
 39: @*/
 40: int KSPGMRESSetOrthogonalization(KSP ksp,int (*fcn)(KSP,int))
 41: {
 42:   int ierr,(*f)(KSP,int (*)(KSP,int));

 46:   PetscObjectQueryFunction((PetscObject)ksp,"KSPGMRESSetOrthogonalization_C",(void (**)(void))&f);
 47:   if (f) {
 48:     (*f)(ksp,fcn);
 49:   }
 50:   return(0);
 51: }