IFEM  90A354
PETScSchurPC.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #include "PETScMatrix.h"
15 #include <memory>
16 
17 
23 class PETScSchurPC {
24 public:
30  PETScSchurPC(PC& pc_init, const std::vector<Mat>& blocks,
31  const LinSolParams::BlockParams& params, const ProcessAdm& adm);
32 
34  ~PETScSchurPC();
35 
40  static PetscErrorCode Apply_Schur(Mat A, Vec x, Vec y);
41 
46  static PetscErrorCode Apply_Outer(PC pc, Vec x, Vec y);
47 
50  static PetscErrorCode Destroy(PC pc);
51 
52 protected:
53  KSP inner_ksp;
54  KSP outer_ksp;
55  Mat outer_mat;
56  Vec tmp;
57  const std::vector<Mat>* m_blocks;
58 };
Representation of the system matrix in PETSc format with interface to PETSc routines for assembling a...
Linear solver settings for a block of the linear system.
Definition: LinSolParams.h:80
Class implementing a Schur-complement preconditioner for 2-block systems.
Definition: PETScSchurPC.h:23
const std::vector< Mat > * m_blocks
Matrix blocks in system.
Definition: PETScSchurPC.h:57
KSP outer_ksp
The KSP for the approximated Schur complement.
Definition: PETScSchurPC.h:54
static PetscErrorCode Apply_Schur(Mat A, Vec x, Vec y)
PETSc compatible function applying the Schur complement matrix.
Definition: PETScSchurPC.C:97
PETScSchurPC(PC &pc_init, const std::vector< Mat > &blocks, const LinSolParams::BlockParams &params, const ProcessAdm &adm)
The constructor sets up the preconditioner.
Definition: PETScSchurPC.C:19
Vec tmp
Temporary vector.
Definition: PETScSchurPC.h:56
KSP inner_ksp
The KSP for the approximation of inner matrix inverse.
Definition: PETScSchurPC.h:53
Mat outer_mat
Matrix shell describing the Schur complement.
Definition: PETScSchurPC.h:55
static PetscErrorCode Apply_Outer(PC pc, Vec x, Vec y)
PETSc compatible function applying the Schur complement preconditioner.
Definition: PETScSchurPC.C:110
~PETScSchurPC()
The destructor frees the PETSc structures.
Definition: PETScSchurPC.C:88
static PetscErrorCode Destroy(PC pc)
Destroy a Schur preconditioner.
Definition: PETScSchurPC.C:121
Class for administration of MPI processes in IFEM library.
Definition: ProcessAdm.h:33