27 #ifndef OOMPH_PRECONDITION_HEADER
28 #define OOMPH_PRECONDITION_HEADER
33 #include <oomph-lib-config.h>
42 template<
typename MATRIX>
43 class BlockPreconditioner;
86 throw OomphLibError(
"This function hasn't been implemented yet!",
87 OOMPH_CURRENT_FUNCTION,
88 OOMPH_EXCEPTION_LOCATION);
102 if (dist_obj_pt != 0)
114 Setup_time = setup_time_finish - setup_time_start;
155 std::ostringstream error_msg;
156 error_msg <<
"Matrix pointer is null.";
158 error_msg.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
178 std::ostringstream error_msg;
179 error_msg <<
"Tried to access a null communicator pointer. This might "
181 <<
"trying to use it in a non-parallel case. Or it might "
183 <<
"set it properly.";
185 error_msg.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
274 if (dist_matrix_pt != 0)
297 std::ostringstream error_message_stream;
299 <<
"The r vector must have the same distribution as the "
301 <<
"(this is the same as the matrix passed to setup())";
303 OOMPH_CURRENT_FUNCTION,
304 OOMPH_EXCEPTION_LOCATION);
310 std::ostringstream error_message_stream;
312 <<
"The z vector distribution has been setup; it must have the "
313 <<
"same distribution as the r vector (and preconditioner).";
315 OOMPH_CURRENT_FUNCTION,
316 OOMPH_EXCEPTION_LOCATION);
Base class for any linear algebra object that is distributable. Just contains storage for the LinearA...
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
void build_distribution(const LinearAlgebraDistribution *const dist_pt)
setup the distribution of this distributable linear algebra object
Abstract base class for matrices of doubles – adds abstract interfaces for solving,...
virtual unsigned long nrow() const =0
Return the number of rows of the matrix.
A vector in the mathematical sense, initially developed for linear algebra type applications....
The Identity Preconditioner.
void preconditioner_solve_transpose(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. This method should apply the preconditioner operator to the vector r and re...
IdentityPreconditioner(const IdentityPreconditioner &)=delete
Broken copy constructor.
virtual ~IdentityPreconditioner()
Destructor (empty)
void operator=(const IdentityPreconditioner &)=delete
Broken assignment operator.
virtual void setup()
setup method - just sets the distribution
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. This method should apply the preconditioner operator to the vector r and re...
Describes the distribution of a distributable linear algebra type object. Typically this is a contain...
OomphCommunicator * communicator_pt() const
const access to the communicator pointer
An oomph-lib wrapper to the MPI_Comm communicator object. Just contains an MPI_Comm object (which is ...
An OomphLibError object which should be thrown when an run-time error is encountered....
Preconditioner base class. Gives an interface to call all other preconditioners through and stores th...
double Setup_time
The time it takes to set up this preconditioner.
DoubleMatrixBase * Matrix_pt
Storage for a pointer to the matrix.
void setup(DoubleMatrixBase *matrix_pt)
Setup the preconditioner: store the matrix pointer and the communicator pointer then call preconditio...
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....
virtual void preconditioner_solve_transpose(const DoubleVector &r, DoubleVector &z)
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
void disable_silent_preconditioner_setup()
Be verbose in the block preconditioner setup.
std::ostream * Stream_pt
Pointer to the output stream – defaults to std::cout.
virtual void set_comm_pt(const OomphCommunicator *const comm_pt)
Set the communicator pointer.
virtual void clean_up_memory()
Clean up memory (empty). Generic interface function.
void operator=(const Preconditioner &)=delete
Broken assignment operator.
virtual DoubleMatrixBase * matrix_pt() const
Get function for matrix pointer.
void setup(const Problem *problem_pt, DoubleMatrixBase *matrix_pt)
Compatability layer for old preconditioners where problem pointers were needed. The problem pointer i...
Preconditioner()
Constructor.
double setup_time() const
Returns the time to setup the preconditioner.
const OomphCommunicator * Comm_pt
Storage for a pointer to the communicator. Null if the preconditioner should not be distributed.
void enable_silent_preconditioner_setup()
Set up the block preconditioner quietly!
virtual ~Preconditioner()
Destructor (empty)
Preconditioner(const Preconditioner &)=delete
Broken copy constructor.
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
bool Silent_preconditioner_setup
Boolean to indicate whether or not the build should be done silently.
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....
virtual const OomphCommunicator * comm_pt() const
Get function for comm pointer.
virtual void set_matrix_pt(DoubleMatrixBase *matrix_pt)
Set the matrix pointer.
virtual void setup()=0
Setup the preconditioner. Pure virtual generic interface function.
////////////////////////////////////////////////////////////////// //////////////////////////////////...
void obsolete()
Output warning message.
double timer()
returns the time in seconds after some point in past
//////////////////////////////////////////////////////////////////// ////////////////////////////////...