IFEM  90A354
Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
PETScSchurPC Class Reference

Class implementing a Schur-complement preconditioner for 2-block systems. More...

#include <PETScSchurPC.h>

Collaboration diagram for PETScSchurPC:
Collaboration graph
[legend]

Public Member Functions

 PETScSchurPC (PC &pc_init, const std::vector< Mat > &blocks, const LinSolParams::BlockParams &params, const ProcessAdm &adm)
 The constructor sets up the preconditioner. More...
 
 ~PETScSchurPC ()
 The destructor frees the PETSc structures.
 

Static Public Member Functions

static PetscErrorCode Apply_Schur (Mat A, Vec x, Vec y)
 PETSc compatible function applying the Schur complement matrix. More...
 
static PetscErrorCode Apply_Outer (PC pc, Vec x, Vec y)
 PETSc compatible function applying the Schur complement preconditioner. More...
 
static PetscErrorCode Destroy (PC pc)
 Destroy a Schur preconditioner. More...
 

Protected Attributes

KSP inner_ksp
 The KSP for the approximation of inner matrix inverse.
 
KSP outer_ksp
 The KSP for the approximated Schur complement.
 
Mat outer_mat
 Matrix shell describing the Schur complement.
 
Vec tmp
 Temporary vector.
 
const std::vector< Mat > * m_blocks
 Matrix blocks in system.
 

Detailed Description

Class implementing a Schur-complement preconditioner for 2-block systems.

Constructor & Destructor Documentation

◆ PETScSchurPC()

PETScSchurPC::PETScSchurPC ( PC &  pc_init,
const std::vector< Mat > &  blocks,
const LinSolParams::BlockParams params,
const ProcessAdm adm 
)

The constructor sets up the preconditioner.

Parameters
pc_initThe PETSc PC to set up
blocksThe matrix blocks
paramsLinear solver parameters
admProcesses administrator

References Apply_Outer(), Apply_Schur(), Destroy(), SettingMap::getDoubleValue(), SettingMap::getIntValue(), SettingMap::getStringValue(), inner_ksp, outer_ksp, outer_mat, and tmp.

Member Function Documentation

◆ Apply_Outer()

PetscErrorCode PETScSchurPC::Apply_Outer ( PC  pc,
Vec  x,
Vec  y 
)
static

PETSc compatible function applying the Schur complement preconditioner.

Parameters
pcShell preconditioner to apply
xVector to apply preconditioner to
yResult of preconditioner evaluation

References outer_ksp.

Referenced by PETScSchurPC().

◆ Apply_Schur()

PetscErrorCode PETScSchurPC::Apply_Schur ( Mat  A,
Vec  x,
Vec  y 
)
static

PETSc compatible function applying the Schur complement matrix.

Parameters
AShell matrix to apply
xVector to apply matrix to
yResult of matrix-vector product

References inner_ksp, m_blocks, and tmp.

Referenced by PETScSchurPC().

◆ Destroy()

PetscErrorCode PETScSchurPC::Destroy ( PC  pc)
static

Destroy a Schur preconditioner.

Parameters
pcPreconditioner to destroy

Referenced by PETScSchurPC().


The documentation for this class was generated from the following files: