Actual source code: gmpre.c

      1: #define PETSCKSP_DLL

     3:  #include src/ksp/ksp/impls/gmres/gmresp.h

      7: /*@
      8:     KSPGMRESSetPreAllocateVectors - Causes GMRES and FGMRES to preallocate all its
      9:     needed work vectors at initial setup rather than the default, which
     10:     is to allocate them in chunks when needed.

     12:     Collective on KSP

     14:     Input Parameter:
     15: .   ksp   - iterative context obtained from KSPCreate

     17:     Options Database Key:
     18: .   -ksp_gmres_preallocate - Activates KSPGmresSetPreAllocateVectors()

     20:     Level: intermediate

     22: .keywords: GMRES, preallocate, vectors

     24: .seealso: KSPGMRESSetRestart(), KSPGMRESSetOrthogonalization()
     25: @*/
     26: PetscErrorCode PETSCKSP_DLLEXPORT KSPGMRESSetPreAllocateVectors(KSP ksp)
     27: {
     28:   PetscErrorCode ierr,(*f)(KSP);

     31:   PetscObjectQueryFunction((PetscObject)ksp,"KSPGMRESSetPreAllocateVectors_C",(void (**)(void))&f);
     32:   if (f) {
     33:     (*f)(ksp);
     34:   }
     35:   return(0);
     36: }