Date: 2025-03-29T05:58:26+00:00

Actual source code: bcgslimpl.h

      1: /*
      2:     Private data structure for BiCGStab(L) solver.
      3:     Allocation takes place before each solve.
      4: */
      5: #pragma once
      6: #include <petscsys.h>

      8: typedef struct {
      9:   PetscInt  ell;     /* Number of search directions. */
     10:   PetscReal delta;   /* Threshold for recomputing exact residual norm */
     11:   PetscBool bConvex; /* Compute Enhanced BiCGstab polynomial when set to PETSC_TRUE */
     12:   PetscBool pinv;    /* Use pseudoinverse to calculate polynomial correction when set
     13:                                   to PETSC_TRUE */

     15:   /* Workspace Vectors */
     16:   Vec  vB;
     17:   Vec  vRt;
     18:   Vec  vXr;
     19:   Vec  vTm;
     20:   Vec *vvR;
     21:   Vec *vvU;

     23:   /* Workspace Arrays */
     24:   PetscScalar *vY0c, *vYlc, *vYtc;
     25:   PetscScalar *mZa, *mZb;
     26:   PetscScalar *u, *v, *work;
     27:   PetscReal   *s, *realwork;
     28:   PetscBLASInt lwork;
     29: } KSP_BCGSL;

     31: /* predefined shorthands */
     32: #define VX   (ksp->vec_sol)
     33: #define VB   (bcgsl->vB)
     34: #define VRT  (bcgsl->vRt)
     35: #define VXR  (bcgsl->vXr)
     36: #define VTM  (bcgsl->vTm)
     37: #define VVR  (bcgsl->vvR)
     38: #define VVU  (bcgsl->vvU)
     39: #define AY0c (bcgsl->vY0c)
     40: #define AYtc (bcgsl->vYtc)
     41: #define AYlc (bcgsl->vYlc)
     42: #define MZa  (bcgsl->mZa)
     43: #define MZb  (bcgsl->mZb)