Date: 2013-07-02T14:46:29+00:00

Actual source code: petsc-pcimpl.h
petsc-3.4.2 2013-07-02

      2: #ifndef _PCIMPL_H
      3: #define _PCIMPL_H

      5: #include <petscksp.h>
      6: #include <petscpc.h>
      7: #include <petsc-private/petscimpl.h>

      9: typedef struct _PCOps *PCOps;
     10: struct _PCOps {
     11:   PetscErrorCode (*setup)(PC);
     12:   PetscErrorCode (*apply)(PC,Vec,Vec);
     13:   PetscErrorCode (*applyrichardson)(PC,Vec,Vec,Vec,PetscReal,PetscReal,PetscReal,PetscInt,PetscBool ,PetscInt*,PCRichardsonConvergedReason*);
     14:   PetscErrorCode (*applyBA)(PC,PCSide,Vec,Vec,Vec);
     15:   PetscErrorCode (*applytranspose)(PC,Vec,Vec);
     16:   PetscErrorCode (*applyBAtranspose)(PC,PetscInt,Vec,Vec,Vec);
     17:   PetscErrorCode (*setfromoptions)(PC);
     18:   PetscErrorCode (*presolve)(PC,KSP,Vec,Vec);
     19:   PetscErrorCode (*postsolve)(PC,KSP,Vec,Vec);
     20:   PetscErrorCode (*getfactoredmatrix)(PC,Mat*);
     21:   PetscErrorCode (*applysymmetricleft)(PC,Vec,Vec);
     22:   PetscErrorCode (*applysymmetricright)(PC,Vec,Vec);
     23:   PetscErrorCode (*setuponblocks)(PC);
     24:   PetscErrorCode (*destroy)(PC);
     25:   PetscErrorCode (*view)(PC,PetscViewer);
     26:   PetscErrorCode (*reset)(PC);
     27:   PetscErrorCode (*load)(PC,PetscViewer);
     28: };

     30: /*
     31:    Preconditioner context
     32: */
     33: struct _p_PC {
     34:   PETSCHEADER(struct _PCOps);
     35:   DM             dm;
     36:   PetscInt       setupcalled;
     37:   PetscInt       setfromoptionscalled;
     38:   MatStructure   flag;
     39:   Mat            mat,pmat;
     40:   Vec            diagonalscaleright,diagonalscaleleft; /* used for time integration scaling */
     41:   PetscBool      diagonalscale;
     42:   PetscBool      nonzero_guess; /* used by PCKSP, PCREDUNDANT and PCHMPI */
     43:   PetscBool      useAmat; /* used by several PC that including applying the operator inside the preconditioner */
     44:   PetscErrorCode (*modifysubmatrices)(PC,PetscInt,const IS[],const IS[],Mat[],void*); /* user provided routine */
     45:   void           *modifysubmatricesP; /* context for user routine */
     46:   void           *data;
     47:   PetscInt       presolvedone;  /* has PCPreSolve() already been run */
     48:   void           *user;             /* optional user-defined context */
     49: };

     51: PETSC_EXTERN PetscLogEvent PC_SetUp, PC_SetUpOnBlocks, PC_Apply, PC_ApplyCoarse, PC_ApplyMultiple, PC_ApplySymmetricLeft;
     52: PETSC_EXTERN PetscLogEvent PC_ApplySymmetricRight, PC_ModifySubMatrices, PC_ApplyOnBlocks, PC_ApplyTransposeOnBlocks, PC_ApplyOnMproc;

     54: #endif