xref: /petsc/src/ksp/ksp/impls/gmres/gmpre.c (revision ee1cef2c4f92b4b45b8aa3ceac59cb944062fab9)
1 #define PETSCKSP_DLL
2 
3 #include "../src/ksp/ksp/impls/gmres/gmresp.h"       /*I  "petscksp.h"  I*/
4 
5 #undef __FUNCT__
6 #define __FUNCT__ "KSPGMRESSetPreAllocateVectors"
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.
11 
12     Collective on KSP
13 
14     Input Parameter:
15 .   ksp   - iterative context obtained from KSPCreate
16 
17     Options Database Key:
18 .   -ksp_gmres_preallocate - Activates KSPGmresSetPreAllocateVectors()
19 
20     Level: intermediate
21 
22 .keywords: GMRES, preallocate, vectors
23 
24 .seealso: KSPGMRESSetRestart(), KSPGMRESSetOrthogonalization()
25 @*/
26 PetscErrorCode PETSCKSP_DLLEXPORT KSPGMRESSetPreAllocateVectors(KSP ksp)
27 {
28   PetscErrorCode ierr,(*f)(KSP);
29 
30   PetscFunctionBegin;
31   ierr = PetscObjectQueryFunction((PetscObject)ksp,"KSPGMRESSetPreAllocateVectors_C",(void (**)(void))&f);CHKERRQ(ierr);
32   if (f) {
33     ierr = (*f)(ksp);CHKERRQ(ierr);
34   }
35   PetscFunctionReturn(0);
36 }
37 
38