xref: /petsc/src/ksp/ksp/impls/cheby/chebyshevimpl.h (revision 4d179fb46f278960ac3f14025f9cb6eb7a8aa015)
1 /*
2     Private data structure for Chebyshev Iteration
3 */
4 
5 #pragma once
6 
7 #include <petsc/private/kspimpl.h>
8 
9 typedef struct {
10   PetscReal  emin, emax;                   /* store user provided estimates of extreme eigenvalues or computed with kspest and transformed with tform[] */
11   PetscReal  emin_computed, emax_computed; /* eigenvalues as computed by kspest, if computed */
12   PetscReal  emin_provided, emax_provided; /* provided by PCGAMG; discarded unless preconditioned by Jacobi */
13   PetscReal *betas;                        /* store beta coefficients for 4th-kind Chebyshev smoother */
14   PetscInt   num_betas_alloc;
15 
16   KSP              kspest;   /* KSP used to estimate eigenvalues */
17   PetscReal        tform[4]; /* transform from Krylov estimates to Chebyshev bounds */
18   PetscInt         eststeps; /* number of kspest steps in KSP used to estimate eigenvalues */
19   PetscBool        usenoisy; /* use noisy right-hand side vector to estimate eigenvalues */
20   KSPChebyshevKind chebykind;
21   /* For tracking when to update the eigenvalue estimates */
22   PetscObjectId    amatid, pmatid;
23   PetscObjectState amatstate, pmatstate;
24 } KSP_Chebyshev;
25 
26 /* given the polynomial order, return tabulated beta coefficients for use in opt. 4th-kind Chebyshev smoother */
27 PETSC_INTERN PetscErrorCode KSPChebyshevGetBetas_Private(KSP);
28