PCTwoLevelsBlockDiagonal Class Reference

#include <PCTwoLevelsBlockDiagonal.hpp>

Collaboration diagram for PCTwoLevelsBlockDiagonal:
Collaboration graph
[legend]

List of all members.

Classes

struct  PCTwoLevelsBlockDiagonalContext

Public Member Functions

 PCTwoLevelsBlockDiagonal (KSP &rKspObject, std::vector< PetscInt > &rBathNodes)
 ~PCTwoLevelsBlockDiagonal ()

Public Attributes

PCTwoLevelsBlockDiagonalContext mPCContext
PC mPetscPCObject

Private Member Functions

void PCTwoLevelsBlockDiagonalCreate (KSP &rKspObject, std::vector< PetscInt > &rBathNodes)
void PCTwoLevelsBlockDiagonalSetUp ()

Detailed Description

Todo:
: #1082 update this description

This class defines a PETSc-compliant purpose-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 throw the following error:

[0]PETSC ERROR: --------------------- Error Message ------------------------------------ [0]PETSC ERROR: Unknown type. Check for miss-spelling or missing external package needed for type! [0]PETSC ERROR: Unable to find requested PC type hypre!

and will approximate the inverse of the subblocks with PETSc's default preconditioner (bjacobi at the time of writing this).

Definition at line 79 of file PCTwoLevelsBlockDiagonal.hpp.


Constructor & Destructor Documentation

PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonal ( KSP &  rKspObject,
std::vector< PetscInt > &  rBathNodes 
)

Constructor.

Parameters:
rKspObject KSP object where we want to install the block diagonal preconditioner.
rBathNodes a list of nodes defining the bath

Definition at line 34 of file PCTwoLevelsBlockDiagonal.cpp.

References PCTwoLevelsBlockDiagonalCreate(), and PCTwoLevelsBlockDiagonalSetUp().

PCTwoLevelsBlockDiagonal::~PCTwoLevelsBlockDiagonal (  ) 

Member Function Documentation

void PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalCreate ( KSP &  rKspObject,
std::vector< PetscInt > &  rBathNodes 
) [private]

Creates all the state data required by the preconditioner.

Parameters:
rKspObject KSP object where we want to install the block diagonal preconditioner.
rBathNodes a list of nodes defining the bath

Todo:
: #1082 won't work in parallel
Todo:
: #1082 won't work in parallel
Todo:
: #1082 assert size(x1) = size(x21) + size(x22)
Todo:
: #1082 legacy, no need to use the references
Todo:
: #1082 OK in parallel. Use as an example for the other two blocks

Definition at line 64 of file PCTwoLevelsBlockDiagonal.cpp.

References PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A11_matrix_subblock, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A11_scatter_ctx, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A22_B1_matrix_subblock, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A22_B1_scatter_ctx, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A22_B2_matrix_subblock, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::A22_B2_scatter_ctx, PetscTools::CreateVec(), PetscTools::IsSequential(), mPCContext, mPetscPCObject, TERMINATE, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::x1_subvector, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::x21_subvector, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::x22_subvector, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::y1_subvector, PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::y21_subvector, and PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalContext::y22_subvector.

Referenced by PCTwoLevelsBlockDiagonal().

void PCTwoLevelsBlockDiagonal::PCTwoLevelsBlockDiagonalSetUp (  )  [private]

Member Data Documentation

PC context, this will be passed to PCTwoLevelsBlockDiagonalApply when PETSc returns control to our preconditioner subroutine. See PCShellSetContext().

Definition at line 105 of file PCTwoLevelsBlockDiagonal.hpp.

Referenced by PCTwoLevelsBlockDiagonalCreate(), PCTwoLevelsBlockDiagonalSetUp(), and ~PCTwoLevelsBlockDiagonal().

Generic PETSc preconditioner object

Definition at line 106 of file PCTwoLevelsBlockDiagonal.hpp.

Referenced by PCTwoLevelsBlockDiagonalCreate().


The documentation for this class was generated from the following files:
Generated on Thu Dec 22 13:07:12 2011 for Chaste by  doxygen 1.6.3