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>
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 DoubleMatrixBase * | matrix_pt () const |
Get function for matrix pointer. More... | |
virtual void | set_matrix_pt (DoubleMatrixBase *matrix_pt) |
Set the matrix pointer. More... | |
virtual const OomphCommunicator * | comm_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... | |
LinearAlgebraDistribution * | distribution_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 | |
DoubleMatrixBase * | Matrix_pt |
Storage for a pointer to the matrix. More... | |
const OomphCommunicator * | Comm_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... | |
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.
|
inline |
Constructor.
Definition at line 57 of file preconditioner.h.
|
delete |
Broken copy constructor.
|
inlinevirtual |
Destructor (empty)
Definition at line 71 of file preconditioner.h.
|
inlinevirtual |
Clean up memory (empty). Generic interface function.
Reimplemented in oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::PressureBasedSolidLSCPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::HelmholtzGMRESMG< MATRIX >, oomph::NavierStokesSchurComplementPreconditioner, oomph::LagrangeEnforcedFlowPreconditioner, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticFSIPreconditioner, oomph::TrilinosPreconditionerBase, oomph::SuperLUPreconditioner, oomph::NewMumpsPreconditioner, oomph::HyprePreconditioner, oomph::MGPreconditioner< DIM >, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::GeneralPurposeBlockPreconditioner< MATRIX >, oomph::InexactSubBiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, and oomph::BiharmonicPreconditioner.
Definition at line 147 of file preconditioner.h.
Referenced by oomph::TrilinosAztecOOSolver::clean_up_memory(), and oomph::PseudoElasticFSIPreconditioner::clean_up_memory().
|
inlinevirtual |
Get function for comm pointer.
Definition at line 171 of file preconditioner.h.
References Comm_pt.
Referenced by oomph::NavierStokesSchurComplementPreconditioner::assemble_inv_press_and_veloc_mass_matrix_diagonal(), oomph::PressureBasedSolidLSCPreconditioner::assemble_mass_matrix_diagonal(), oomph::NavierStokesSchurComplementPreconditioner::get_pressure_advection_diffusion_matrix(), oomph::BlockPreconditioner< MATRIX >::internal_dof_number(), set_comm_pt(), oomph::ILUZeroPreconditioner< CCDoubleMatrix >::setup(), oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >::setup(), oomph::IdentityPreconditioner::setup(), oomph::PseudoElasticPreconditionerOld::setup(), and oomph::NavierStokesSchurComplementPreconditioner::setup().
|
inline |
Be verbose in the block preconditioner setup.
Definition at line 135 of file preconditioner.h.
References Silent_preconditioner_setup.
|
inline |
Set up the block preconditioner quietly!
Definition at line 127 of file preconditioner.h.
References Silent_preconditioner_setup.
|
inlinevirtual |
Get function for matrix pointer.
Reimplemented in oomph::BlockPreconditioner< MATRIX >, and oomph::BlockPreconditioner< CRDoubleMatrix >.
Definition at line 150 of file preconditioner.h.
References Matrix_pt.
Referenced by oomph::BlockPreconditioner< MATRIX >::matrix_pt(), set_matrix_pt(), oomph::MatrixBasedDiagPreconditioner::setup(), oomph::ILUZeroPreconditioner< CCDoubleMatrix >::setup(), oomph::ILUZeroPreconditioner< CRDoubleMatrix >::setup(), oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >::setup(), oomph::HyprePreconditioner::setup(), oomph::NewMumpsPreconditioner::setup(), oomph::IdentityPreconditioner::setup(), oomph::SuperLUPreconditioner::setup(), oomph::TrilinosPreconditionerBase::setup(), and setup().
|
delete |
Broken assignment operator.
|
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::MGPreconditioner< DIM >, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::PressureBasedSolidLSCPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::HelmholtzGMRESMG< MATRIX >, oomph::NavierStokesSchurComplementPreconditioner, oomph::LagrangeEnforcedFlowPreconditioner, oomph::PseudoElasticPreconditionerScalingHelperOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticFSIPreconditioner, oomph::SimpleFSIPreconditioner< MATRIX >, oomph::FSIPreconditioner, oomph::TrilinosPreconditionerBase, oomph::SuperLUPreconditioner, oomph::IdentityPreconditioner, oomph::NewMumpsPreconditioner, oomph::HyprePreconditioner, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::ILUZeroPreconditioner< CRDoubleMatrix >, oomph::ILUZeroPreconditioner< CCDoubleMatrix >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::MatrixBasedDiagPreconditioner, oomph::DummyBlockPreconditioner< MATRIX >, oomph::ExactBlockPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::InexactSubBiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, and oomph::BiharmonicPreconditioner.
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().
|
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::SuperLUPreconditioner, and oomph::IdentityPreconditioner.
Definition at line 82 of file preconditioner.h.
|
inlinevirtual |
Set the communicator pointer.
Definition at line 193 of file preconditioner.h.
References comm_pt(), and Comm_pt.
Referenced by oomph::PseudoElasticPreconditionerScalingHelperOld::PseudoElasticPreconditionerScalingHelperOld(), setup(), oomph::HelmholtzGMRESMG< MATRIX >::solve(), and oomph::HelmholtzFGMRESMG< MATRIX >::solve().
|
inlinevirtual |
Set the matrix pointer.
Definition at line 165 of file preconditioner.h.
References matrix_pt(), and Matrix_pt.
Referenced by oomph::PseudoElasticPreconditionerScalingHelperOld::PseudoElasticPreconditionerScalingHelperOld(), oomph::BlockPreconditioner< MATRIX >::set_master_matrix_pt(), setup(), oomph::HelmholtzGMRESMG< MATRIX >::solve(), oomph::HelmholtzFGMRESMG< MATRIX >::solve(), and oomph::TrilinosAztecOOSolver::solver_setup().
|
pure virtual |
Setup the preconditioner. Pure virtual generic interface function.
Implemented in oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::NavierStokesSchurComplementPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::NavierStokesSchurComplementPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::NavierStokesSchurComplementPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::GMRESBlockPreconditioner, oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner, oomph::BandedBlockTriangularPreconditioner< MATRIX >, oomph::ExactDGPBlockPreconditioner< MATRIX >, oomph::PressureBasedSolidExactPreconditioner< MATRIX >, oomph::PressureBasedSolidLSCPreconditioner, oomph::HelmholtzMGPreconditioner< DIM >, oomph::HelmholtzGMRESMG< MATRIX >, oomph::NavierStokesExactPreconditioner< MATRIX >, oomph::NavierStokesSchurComplementPreconditioner, oomph::LagrangeEnforcedFlowPreconditioner, oomph::PseudoElasticPreconditionerScalingHelperOld, oomph::PseudoElasticPreconditionerSubsidiaryBlockPreconditionerOld, oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld, oomph::PseudoElasticPreconditionerOld, oomph::PseudoElasticPreconditioner, oomph::PseudoElasticFSIPreconditioner, oomph::SimpleFSIPreconditioner< MATRIX >, oomph::FSIPreconditioner, oomph::TrilinosPreconditionerBase, oomph::SuperLUPreconditioner, oomph::IdentityPreconditioner, oomph::NewMumpsPreconditioner, oomph::HyprePreconditioner, oomph::MGPreconditioner< DIM >, oomph::InnerIterationPreconditioner< SOLVER, PRECONDITIONER >, oomph::ILUZeroPreconditioner< CRDoubleMatrix >, oomph::ILUZeroPreconditioner< CCDoubleMatrix >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::MatrixBasedDiagPreconditioner, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::MatrixBasedLumpedPreconditioner< MATRIX >, oomph::MatrixBasedLumpedPreconditioner< oomph::CRDoubleMatrix >, oomph::DummyBlockPreconditioner< MATRIX >, oomph::ExactBlockPreconditioner< MATRIX >, oomph::BlockTriangularPreconditioner< MATRIX >, oomph::BlockDiagonalPreconditioner< MATRIX >, oomph::InexactSubBiharmonicPreconditioner, oomph::ExactSubBiharmonicPreconditioner, and oomph::BiharmonicPreconditioner.
Referenced by setup().
|
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().
|
inline |
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditioner specific setup() function.
Definition at line 94 of file preconditioner.h.
References oomph::LinearAlgebraDistribution::communicator_pt(), oomph::DistributableLinearAlgebraObject::distribution_pt(), matrix_pt(), set_comm_pt(), set_matrix_pt(), setup(), Setup_time, and oomph::TimingHelpers::timer().
Referenced by oomph::BiharmonicPreconditioner::setup(), oomph::ExactSubBiharmonicPreconditioner::setup(), oomph::InexactSubBiharmonicPreconditioner::setup(), oomph::FSIPreconditioner::setup(), oomph::PseudoElasticFSIPreconditioner::setup(), oomph::PseudoElasticPreconditionerSubsidiaryPreconditionerOld::setup(), oomph::LagrangeEnforcedFlowPreconditioner::setup(), oomph::NavierStokesSchurComplementPreconditioner::setup(), oomph::PressureBasedSolidLSCPreconditioner::setup(), oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::setup(), oomph::AugmentedProblemGMRES::solve_helper(), and oomph::TrilinosAztecOOSolver::solver_setup().
|
inline |
Returns the time to setup the preconditioner.
Definition at line 199 of file preconditioner.h.
References Setup_time.
Referenced by oomph::FSIPreconditioner::setup().
|
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.
|
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.
|
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().
|
private |
Storage for a pointer to the matrix.
Definition at line 236 of file preconditioner.h.
Referenced by matrix_pt(), and set_matrix_pt().
|
private |
The time it takes to set up this preconditioner.
Definition at line 243 of file preconditioner.h.
Referenced by setup(), and setup_time().
|
protected |
Boolean to indicate whether or not the build should be done silently.
Definition at line 229 of file preconditioner.h.
Referenced by disable_silent_preconditioner_setup(), enable_silent_preconditioner_setup(), oomph::SpaceTimeNavierStokesSubsidiaryPreconditioner::setup(), and oomph::GMRESBlockPreconditioner::setup().
|
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().