Actual source code: richardsonimpl.h
1: /*
2: Private data structure for Richardson Iteration
3: */
5: #pragma once
7: #include <petsc/private/kspimpl.h>
9: typedef struct {
10: PetscReal scale; /* scaling on preconditioner */
11: PetscBool selfscale; /* determine optimimal scaling each iteration to minimize 2-norm of resulting residual */
12: Mat R, Z; /* work blocks of vectors of KSPMatSolve_Richardson(), cached between calls, R also holds the product with the operator */
13: Vec w; /* work vector of the PCApplyRichardson() fallback of KSPMatSolve_Richardson(), cached between calls */
14: PetscBool transpose; /* direction the product cached in R was set up with */
15: PetscObjectId id; /* identity of the operator the product cached in R was set up with */
16: PetscObjectState state; /* nonzero state of that operator, only a change of nonzero pattern invalidates the symbolic phase, new values do not */
17: } KSP_Richardson;