Chaste
Release::2018.1
|
#include <PCBlockDiagonal.hpp>
Classes | |
struct | PCBlockDiagonalContext |
Public Member Functions | |
PCBlockDiagonal (KSP &rKspObject) | |
Public Attributes | |
PCBlockDiagonalContext | mPCContext |
PC | mPetscPCObject |
Private Member Functions | |
void | PCBlockDiagonalCreate (KSP &rKspObject) |
void | PCBlockDiagonalSetUp () |
This class defines a PETSc-compliant purpouse-build preconditioner.
Let A be a matrix arising in the FEM discretisation of the bidomain equations with the following block structure:
A = (A11 B') (B A22)
By creating an instance of this class, one will define the following preconditioner:
inv(M) = inv( (A11 0) = (inv(A11) 0) (0 A22) ) (0 inv(A22))
The inverses are approximate with one cycle of AMG.
Note: This class requires PETSc to be build including HYPRE library. If it's not available, it will show the following warning: Chaste warning: in file linalg/src/PCLDUFactorisation.cpp at line ???: PETSc HYPRE preconditioning library is not installed and will approximate the inverse of the subblocks with PETSc's default preconditioner (bjacobi at the time of writing this).
Definition at line 85 of file PCBlockDiagonal.hpp.
PCBlockDiagonal::PCBlockDiagonal | ( | KSP & | rKspObject | ) |
Constructor.
rKspObject | KSP object where we want to install the block diagonal preconditioner. |
Definition at line 47 of file PCBlockDiagonal.cpp.
References mPCContext, PCBlockDiagonalCreate(), and PCBlockDiagonalSetUp().
|
private |
Creates all the state data required by the preconditioner.
rKspObject | KSP object where we want to install the block diagonal preconditioner. |
Definition at line 89 of file PCBlockDiagonal.cpp.
References PCBlockDiagonal::PCBlockDiagonalContext::A11_matrix_subblock, PCBlockDiagonal::PCBlockDiagonalContext::A11_scatter_ctx, PCBlockDiagonal::PCBlockDiagonalContext::A22_matrix_subblock, PCBlockDiagonal::PCBlockDiagonalContext::A22_scatter_ctx, PetscTools::CreateVec(), PetscTools::Destroy(), mPCContext, mPetscPCObject, PETSC_DESTROY_PARAM, PetscVecTools::SetupInterleavedVectorScatterGather(), TERMINATE, PCBlockDiagonal::PCBlockDiagonalContext::x1_subvector, PCBlockDiagonal::PCBlockDiagonalContext::x2_subvector, PCBlockDiagonal::PCBlockDiagonalContext::y1_subvector, and PCBlockDiagonal::PCBlockDiagonalContext::y2_subvector.
Referenced by PCBlockDiagonal().
|
private |
Setups preconditioner.
Definition at line 198 of file PCBlockDiagonal.cpp.
References PCBlockDiagonal::PCBlockDiagonalContext::A11_matrix_subblock, PCBlockDiagonal::PCBlockDiagonalContext::A22_matrix_subblock, mPCContext, PCBlockDiagonal::PCBlockDiagonalContext::PC_amg_A11, PCBlockDiagonal::PCBlockDiagonalContext::PC_amg_A22, and PetscTools::SetOption().
Referenced by PCBlockDiagonal().
PCBlockDiagonalContext PCBlockDiagonal::mPCContext |
PC context, this will be passed to PCBlockDiagonalApply when PETSc returns control to our preconditioner subroutine. See PCShellSetContext().
Definition at line 112 of file PCBlockDiagonal.hpp.
Referenced by PCBlockDiagonal(), PCBlockDiagonalCreate(), and PCBlockDiagonalSetUp().
PC PCBlockDiagonal::mPetscPCObject |
Generic PETSc preconditioner object
Definition at line 113 of file PCBlockDiagonal.hpp.
Referenced by PCBlockDiagonalCreate().