Public Member Functions | Protected Attributes | Private Attributes | List of all members
oomph::Preconditioner Class Referenceabstract

Preconditioner base class. Gives an interface to call all other preconditioners through and stores the matrix and communicator pointers. All preconditioners should be derived from this class. More...

#include <preconditioner.h>

+ Inheritance diagram for oomph::Preconditioner:

Public Member Functions

 Preconditioner ()
 Constructor. More...
 
 Preconditioner (const Preconditioner &)=delete
 Broken copy constructor. More...
 
void operator= (const Preconditioner &)=delete
 Broken assignment operator. More...
 
virtual ~Preconditioner ()
 Destructor (empty) More...
 
virtual void preconditioner_solve (const DoubleVector &r, DoubleVector &z)=0
 Apply the preconditioner. Pure virtual generic interface function. This method should apply the preconditioner operator to the vector r and return the vector z. More...
 
virtual void preconditioner_solve_transpose (const DoubleVector &r, DoubleVector &z)
 Apply the preconditioner. Pure virtual generic interface function. This method should apply the preconditioner operator to the vector r and return the vector z. (broken virtual) More...
 
void setup (DoubleMatrixBase *matrix_pt)
 Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditioner specific setup() function. More...
 
void setup (const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
 Compatability layer for old preconditioners where problem pointers were needed. The problem pointer is only used to get a communicator pointer. More...
 
void enable_silent_preconditioner_setup ()
 Set up the block preconditioner quietly! More...
 
void disable_silent_preconditioner_setup ()
 Be verbose in the block preconditioner setup. More...
 
virtual void setup ()=0
 Setup the preconditioner. Pure virtual generic interface function. More...
 
virtual void clean_up_memory ()
 Clean up memory (empty). Generic interface function. More...
 
virtual DoubleMatrixBasematrix_pt () const
 Get function for matrix pointer. More...
 
virtual void set_matrix_pt (DoubleMatrixBase *matrix_pt)
 Set the matrix pointer. More...
 
virtual const OomphCommunicatorcomm_pt () const
 Get function for comm pointer. More...
 
virtual void set_comm_pt (const OomphCommunicator *const comm_pt)
 Set the communicator pointer. More...
 
double setup_time () const
 Returns the time to setup the preconditioner. More...
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse)
 Virtual interface function for making a preconditioner a subsidiary of a block preconditioner. By default nothing is needed, but if this preconditioner is also a block preconditioner then things need to happen. There's an assumption here that the block preconditioner will be in CR form but since that assumption is hard coded all over BlockPreconditioner we're safe. More...
 
virtual void turn_into_subsidiary_block_preconditioner (BlockPreconditioner< CRDoubleMatrix > *master_block_prec_pt, const Vector< unsigned > &doftype_in_master_preconditioner_coarse, const Vector< Vector< unsigned > > &doftype_coarsen_map_coarse)
 Virtual interface function for making a preconditioner a subsidiary of a block preconditioner. By default nothing is needed, but if this preconditioner is also a block preconditioner then things need to happen. Version for coarsening dof-types. More...
 
- Public Member Functions inherited from oomph::DistributableLinearAlgebraObject
 DistributableLinearAlgebraObject ()
 Default constructor - create a distribution. More...
 
 DistributableLinearAlgebraObject (const DistributableLinearAlgebraObject &matrix)=delete
 Broken copy constructor. More...
 
void operator= (const DistributableLinearAlgebraObject &)=delete
 Broken assignment operator. More...
 
virtual ~DistributableLinearAlgebraObject ()
 Destructor. More...
 
LinearAlgebraDistributiondistribution_pt () const
 access to the LinearAlgebraDistribution More...
 
unsigned nrow () const
 access function to the number of global rows. More...
 
unsigned nrow_local () const
 access function for the num of local rows on this processor. More...
 
unsigned nrow_local (const unsigned &p) const
 access function for the num of local rows on this processor. More...
 
unsigned first_row () const
 access function for the first row on this processor More...
 
unsigned first_row (const unsigned &p) const
 access function for the first row on this processor More...
 
bool distributed () const
 distribution is serial or distributed More...
 
bool distribution_built () const
 if the communicator_pt is null then the distribution is not setup then false is returned, otherwise return true More...
 
void build_distribution (const LinearAlgebraDistribution *const dist_pt)
 setup the distribution of this distributable linear algebra object More...
 
void build_distribution (const LinearAlgebraDistribution &dist)
 setup the distribution of this distributable linear algebra object More...
 

Protected Attributes

bool Silent_preconditioner_setup
 Boolean to indicate whether or not the build should be done silently. More...
 
std::ostream * Stream_pt
 Pointer to the output stream – defaults to std::cout. More...
 

Private Attributes

DoubleMatrixBaseMatrix_pt
 Storage for a pointer to the matrix. More...
 
const OomphCommunicatorComm_pt
 Storage for a pointer to the communicator. Null if the preconditioner should not be distributed. More...
 
double Setup_time
 The time it takes to set up this preconditioner. More...
 

Additional Inherited Members

- Protected Member Functions inherited from oomph::DistributableLinearAlgebraObject
void clear_distribution ()
 clear the distribution of this distributable linear algebra object More...
 

Detailed Description

Preconditioner base class. Gives an interface to call all other preconditioners through and stores the matrix and communicator pointers. All preconditioners should be derived from this class.

Definition at line 53 of file preconditioner.h.

Constructor & Destructor Documentation

◆ Preconditioner() [1/2]

oomph::Preconditioner::Preconditioner ( )
inline

Constructor.

Definition at line 57 of file preconditioner.h.

◆ Preconditioner() [2/2]

oomph::Preconditioner::Preconditioner ( const Preconditioner )
delete

Broken copy constructor.

◆ ~Preconditioner()

virtual oomph::Preconditioner::~Preconditioner ( )
inlinevirtual

Destructor (empty)

Definition at line 71 of file preconditioner.h.

Member Function Documentation

◆ clean_up_memory()

virtual void oomph::Preconditioner::clean_up_memory ( )
inlinevirtual

Clean up memory (empty). Generic interface function.

Reimplemented in oomph::BiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, oomph::InexactSubBiharmonicPreconditioner, oomph::GeneralPurposeBlockPreconditioner< MATRIX >, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::MGPreconditioner< DIM >, oomph::HyprePreconditioner, oomph::NewMumpsPreconditioner, oomph::SuperLUPreconditioner, oomph::TrilinosPreconditionerBase, oomph::PseudoElasticFSIPreconditioner, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, oomph::LagrangeEnforcedFlowPreconditioner, oomph::NavierStokesSchurComplementPreconditioner, oomph::HelmholtzGMRESMG< MATRIX >, oomph::HelmholtzMGPreconditioner< DIM >, oomph::PressureBasedSolidLSCPreconditioner, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, and oomph::GMRESBlockPreconditioner.

Definition at line 147 of file preconditioner.h.

Referenced by oomph::TrilinosAztecOOSolver::clean_up_memory(), and oomph::PseudoElasticFSIPreconditioner::clean_up_memory().

◆ comm_pt()

virtual const OomphCommunicator * oomph::Preconditioner::comm_pt ( ) const
inlinevirtual

◆ disable_silent_preconditioner_setup()

void oomph::Preconditioner::disable_silent_preconditioner_setup ( )
inline

Be verbose in the block preconditioner setup.

Definition at line 135 of file preconditioner.h.

References Silent_preconditioner_setup.

◆ enable_silent_preconditioner_setup()

void oomph::Preconditioner::enable_silent_preconditioner_setup ( )
inline

Set up the block preconditioner quietly!

Definition at line 127 of file preconditioner.h.

References Silent_preconditioner_setup.

◆ matrix_pt()

virtual DoubleMatrixBase * oomph::Preconditioner::matrix_pt ( ) const
inlinevirtual

◆ operator=()

void oomph::Preconditioner::operator= ( const Preconditioner )
delete

Broken assignment operator.

◆ preconditioner_solve()

virtual void oomph::Preconditioner::preconditioner_solve ( const DoubleVector r,
DoubleVector z 
)
pure virtual

Apply the preconditioner. Pure virtual generic interface function. This method should apply the preconditioner operator to the vector r and return the vector z.

Implemented in oomph::BiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, oomph::InexactSubBiharmonicPreconditioner, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::ExactBlockPreconditioner< MATRIX >, oomph::DummyBlockPreconditioner< MATRIX >, oomph::MatrixBasedDiagPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::ILUZeroPreconditioner< CCDoubleMatrix >, oomph::ILUZeroPreconditioner< CRDoubleMatrix >, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::HyprePreconditioner, oomph::NewMumpsPreconditioner, oomph::IdentityPreconditioner, oomph::SuperLUPreconditioner, oomph::TrilinosPreconditionerBase, oomph::FSIPreconditioner, oomph::SimpleFSIPreconditioner< MATRIX >, oomph::PseudoElasticFSIPreconditioner, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerScalingHelperOld, oomph::LagrangeEnforcedFlowPreconditioner, oomph::NavierStokesSchurComplementPreconditioner, oomph::HelmholtzGMRESMG< MATRIX >, oomph::HelmholtzMGPreconditioner< DIM >, oomph::PressureBasedSolidLSCPreconditioner, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, and oomph::MGPreconditioner< DIM >.

Referenced by oomph::AugmentedProblemGMRES::apply_schur_complement_preconditioner(), oomph::OomphLibPreconditionerEpetraOperator::ApplyInverse(), oomph::PseudoElasticPreconditioner::elastic_preconditioner_solve(), oomph::PseudoElasticPreconditionerOld::elastic_preconditioner_solve(), oomph::BiharmonicPreconditioner::preconditioner_solve(), oomph::ExactSubBiharmonicPreconditioner::preconditioner_solve(), oomph::InexactSubBiharmonicPreconditioner::preconditioner_solve(), oomph::FSIPreconditioner::preconditioner_solve(), oomph::PseudoElasticFSIPreconditioner::preconditioner_solve(), oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld::preconditioner_solve(), oomph::LagrangeEnforcedFlowPreconditioner::preconditioner_solve(), oomph::NavierStokesSchurComplementPreconditioner::preconditioner_solve(), oomph::PressureBasedSolidLSCPreconditioner::preconditioner_solve(), oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::preconditioner_solve(), oomph::AugmentedProblemGMRES::solve_helper(), oomph::GMRES< MATRIX >::update(), and oomph::HelmholtzGMRESMG< MATRIX >::update().

◆ preconditioner_solve_transpose()

virtual void oomph::Preconditioner::preconditioner_solve_transpose ( const DoubleVector r,
DoubleVector z 
)
inlinevirtual

Apply the preconditioner. Pure virtual generic interface function. This method should apply the preconditioner operator to the vector r and return the vector z. (broken virtual)

Reimplemented in oomph::IdentityPreconditioner, and oomph::SuperLUPreconditioner.

Definition at line 82 of file preconditioner.h.

◆ set_comm_pt()

virtual void oomph::Preconditioner::set_comm_pt ( const OomphCommunicator *const  comm_pt)
inlinevirtual

◆ set_matrix_pt()

virtual void oomph::Preconditioner::set_matrix_pt ( DoubleMatrixBase matrix_pt)
inlinevirtual

◆ setup() [1/3]

virtual void oomph::Preconditioner::setup ( )
pure virtual

Setup the preconditioner. Pure virtual generic interface function.

Implemented in oomph::BiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, oomph::InexactSubBiharmonicPreconditioner, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::ExactBlockPreconditioner< MATRIX >, oomph::DummyBlockPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedDiagPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::ILUZeroPreconditioner< CCDoubleMatrix >, oomph::ILUZeroPreconditioner< CRDoubleMatrix >, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::MGPreconditioner< DIM >, oomph::HyprePreconditioner, oomph::NewMumpsPreconditioner, oomph::IdentityPreconditioner, oomph::SuperLUPreconditioner, oomph::TrilinosPreconditionerBase, oomph::FSIPreconditioner, oomph::SimpleFSIPreconditioner< MATRIX >, oomph::PseudoElasticFSIPreconditioner, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, oomph::PseudoElasticPreconditionerScalingHelperOld, oomph::LagrangeEnforcedFlowPreconditioner, oomph::NavierStokesSchurComplementPreconditioner, oomph::NavierStokesExactPreconditioner< MATRIX >, oomph::HelmholtzGMRESMG< MATRIX >, oomph::HelmholtzMGPreconditioner< DIM >, oomph::PressureBasedSolidLSCPreconditioner, oomph::PressureBasedSolidExactPreconditioner< MATRIX >, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::NavierStokesSchurComplementPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, and oomph::GMRESBlockPreconditioner.

Referenced by setup().

◆ setup() [2/3]

void oomph::Preconditioner::setup ( const Problem problem_pt,
DoubleMatrixBase matrix_pt 
)
inline

Compatability layer for old preconditioners where problem pointers were needed. The problem pointer is only used to get a communicator pointer.

Definition at line 120 of file preconditioner.h.

References matrix_pt(), oomph::ObsoleteCode::obsolete(), and setup().

◆ setup() [3/3]

void oomph::Preconditioner::setup ( DoubleMatrixBase matrix_pt)
inline

◆ setup_time()

double oomph::Preconditioner::setup_time ( ) const
inline

Returns the time to setup the preconditioner.

Definition at line 199 of file preconditioner.h.

References Setup_time.

Referenced by oomph::FSIPreconditioner::setup().

◆ turn_into_subsidiary_block_preconditioner() [1/2]

virtual void oomph::Preconditioner::turn_into_subsidiary_block_preconditioner ( BlockPreconditioner< CRDoubleMatrix > *  master_block_prec_pt,
const Vector< unsigned > &  doftype_in_master_preconditioner_coarse 
)
inlinevirtual

Virtual interface function for making a preconditioner a subsidiary of a block preconditioner. By default nothing is needed, but if this preconditioner is also a block preconditioner then things need to happen. There's an assumption here that the block preconditioner will be in CR form but since that assumption is hard coded all over BlockPreconditioner we're safe.

Definition at line 210 of file preconditioner.h.

◆ turn_into_subsidiary_block_preconditioner() [2/2]

virtual void oomph::Preconditioner::turn_into_subsidiary_block_preconditioner ( BlockPreconditioner< CRDoubleMatrix > *  master_block_prec_pt,
const Vector< unsigned > &  doftype_in_master_preconditioner_coarse,
const Vector< Vector< unsigned > > &  doftype_coarsen_map_coarse 
)
inlinevirtual

Virtual interface function for making a preconditioner a subsidiary of a block preconditioner. By default nothing is needed, but if this preconditioner is also a block preconditioner then things need to happen. Version for coarsening dof-types.

Definition at line 220 of file preconditioner.h.

Member Data Documentation

◆ Comm_pt

const OomphCommunicator* oomph::Preconditioner::Comm_pt
private

Storage for a pointer to the communicator. Null if the preconditioner should not be distributed.

Definition at line 240 of file preconditioner.h.

Referenced by comm_pt(), and set_comm_pt().

◆ Matrix_pt

DoubleMatrixBase* oomph::Preconditioner::Matrix_pt
private

Storage for a pointer to the matrix.

Definition at line 236 of file preconditioner.h.

Referenced by matrix_pt(), and set_matrix_pt().

◆ Setup_time

double oomph::Preconditioner::Setup_time
private

The time it takes to set up this preconditioner.

Definition at line 243 of file preconditioner.h.

Referenced by setup(), and setup_time().

◆ Silent_preconditioner_setup

bool oomph::Preconditioner::Silent_preconditioner_setup
protected

◆ Stream_pt

std::ostream* oomph::Preconditioner::Stream_pt
protected

Pointer to the output stream – defaults to std::cout.

Definition at line 232 of file preconditioner.h.

Referenced by oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::setup(), and oomph::GMRESBlockPreconditioner::setup().


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