29 #ifndef OOMPH_ITERATIVE_LINEAR_SOLVER_HEADER
30 #define OOMPH_ITERATIVE_LINEAR_SOLVER_HEADER
35 #include <oomph-lib-config.h>
282 template<
typename MATRIX>
330 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
408 template<
typename MATRIX>
455 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
572 template<
typename MATRIX>
576 const double& n_dof);
597 template<
typename MATRIX>
640 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
678 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
710 throw OomphLibError(
"No matrix was stored -- cannot re-solve",
711 OOMPH_CURRENT_FUNCTION,
712 OOMPH_EXCEPTION_LOCATION);
727 "Gauss Seidel is not a preconditionable iterative solver",
728 OOMPH_CURRENT_FUNCTION,
729 OOMPH_EXCEPTION_LOCATION);
839 setup_helper(matrix_pt);
881 Index_of_diagonal_entries =
dynamic_cast<CRDoubleMatrix*
>(matrix_pt)
882 ->get_index_of_diagonal_entries();
915 throw OomphLibError(
"No matrix was stored -- cannot re-solve",
916 OOMPH_CURRENT_FUNCTION,
917 OOMPH_EXCEPTION_LOCATION);
932 std::string error_output_string =
"Gauss Seidel is not a ";
933 error_output_string +=
"preconditionable iterative solver";
937 error_output_string, OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
1000 template<
typename MATRIX>
1047 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
1071 std::ostringstream error_message_stream;
1074 error_message_stream <<
"Damped Jacobi can only cater to real-valued "
1075 <<
"matrices. If you require a complex-valued "
1076 <<
"version, please write this yourself. "
1077 <<
"It is likely that the only difference will be "
1078 <<
"the use of complex vectors.";
1082 OOMPH_CURRENT_FUNCTION,
1083 OOMPH_EXCEPTION_LOCATION);
1092 for (
unsigned i = 0;
i < n_row;
i++)
1103 for (
unsigned i = 0;
i < n_dof;
i++)
1147 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
1168 throw OomphLibError(
"No matrix was stored -- cannot re-solve",
1169 OOMPH_CURRENT_FUNCTION,
1170 OOMPH_EXCEPTION_LOCATION);
1225 template<
typename MATRIX>
1283 Matrix_pt =
dynamic_cast<MATRIX*
>(matrix_pt);
1378 for (
int i =
int(k);
i >= 0;
i--)
1384 for (
int j =
i - 1; j >= 0; j--)
1387 y[j] -= H[
i][j] * y[
i];
1392 unsigned n_x = x.
nrow();
1404 for (
unsigned j = 0; j <= k; j++)
1407 const double* vj_pt = v[j].values_pt();
1410 for (
unsigned i = 0;
i < n_x;
i++)
1412 temp_pt[
i] += vj_pt[
i] * y[j];
1469 else if (fabs(dy) > fabs(dx))
1472 double temp = dx / dy;
1475 sn = 1.0 / sqrt(1.0 + temp * temp);
1485 double temp = dy / dx;
1488 cs = 1.0 / sqrt(1.0 + temp * temp);
1501 double temp = cs * dx + sn * dy;
1504 dy = -sn * dx + cs * dy;
1604 if (cr_matrix_pt == 0)
1607 throw OomphLibError(
"Can't upcast input matrix to a CRDoubleMatrix!",
1608 OOMPH_CURRENT_FUNCTION,
1609 OOMPH_EXCEPTION_LOCATION);
1702 unsigned n_dof = matrix_pt->
nrow();
1708 for (
unsigned i = 0;
i < n_dof;
i++)
1718 matrix_pt->
multiply(x_small, a_prod_xsmall);
1721 double y = x[n_dof];
1724 for (
unsigned i = 0;
i < n_dof;
i++)
1727 soln[
i] = a_prod_xsmall[
i] + y * (*B_pt)[
i];
1731 soln[n_dof] =
C_pt->
dot(x_small);
1747 bool use_block_diagonal_preconditioner =
false;
1756 for (
unsigned i = 0;
i < n_dof;
i++)
1759 if (use_block_diagonal_preconditioner)
1762 rhs_small[
i] = rhs[
i];
1768 rhs_small[
i] = rhs[
i] - soln[n_dof] * (*B_pt)[
i];
1776 for (
unsigned i = 0;
i < n_dof;
i++)
1779 soln[
i] = r_small[
i];
1800 for (
int i =
int(k);
i >= 0;
i--)
1806 for (
int j =
i - 1; j >= 0; j--)
1809 y[j] -= H[
i][j] * y[
i];
1814 unsigned n_x = x.
nrow();
1826 for (
unsigned j = 0; j <= k; j++)
1829 const double* vj_pt = v[j].values_pt();
1832 for (
unsigned i = 0;
i < n_x;
i++)
1834 temp_pt[
i] += vj_pt[
i] * y[j];
1884 else if (fabs(dy) > fabs(dx))
1887 double temp = dx / dy;
1890 sn = 1.0 / sqrt(1.0 + temp * temp);
1900 double temp = dy / dx;
1903 cs = 1.0 / sqrt(1.0 + temp * temp);
1916 double temp = cs * dx + sn * dy;
1919 dy = -sn * dx + cs * dy;
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
AugmentedProblemGMRES(DoubleVector *b_pt, DoubleVector *c_pt, double *x_pt, double *rhs_pt)
Constructor.
unsigned iterations() const
Number of iterations taken.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void apply_plane_rotation(double &dx, double &dy, double &cs, double &sn)
Helper function: Apply plane rotation. This is done using the update:
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
DoubleVector * C_pt
Pointer to the row vector in the bordered system.
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
General interface to solve function.
void update(const unsigned &k, const Vector< Vector< double >> &H, const Vector< double > &s, const Vector< DoubleVector > &v, DoubleVector &x)
Helper function to update the result vector using the result, x=x_0+V_m*y.
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
CRDoubleMatrix * Matrix_pt
Pointer to matrix.
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
bool Iteration_restart
boolean indicating if iteration restarting is used
unsigned Restart
The number of iterations before the iteration proceedure is restarted if iteration restart is used.
void disable_iteration_restart()
Switches off iteration restart.
AugmentedProblemGMRES(const AugmentedProblemGMRES &)=delete
Broken copy constructor.
bool iteration_restart() const
access function indicating whether restarted GMRES is used
double * Rhs_pt
Pointer to the last entry of the RHS vector in the bordered system.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void apply_schur_complement_preconditioner(const DoubleVector &rhs, DoubleVector &soln)
Apply the block-diagonal Schur complement preconditioner to compute the LHS which has size N+1 (the a...
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
void generate_plane_rotation(double &dx, double &dy, double &cs, double &sn)
Helper function: Generate a plane rotation. This is done by finding the values of (i....
void enable_iteration_restart(const unsigned &restart)
switches on iteration restarting and takes as an argument the number of iterations after which the co...
double Schur_complement_scalar
The scalar component of the Schur complement preconditioner.
double * X_pt
Pointer to the last entry of the LHS vector in the bordered system.
void augmented_matrix_multiply(CRDoubleMatrix *matrix_pt, const DoubleVector &x, DoubleVector &soln)
Multiply the vector x by the augmented system matrix.
unsigned Iterations
Number of iterations taken.
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
void operator=(const AugmentedProblemGMRES &)=delete
Broken assignment operator.
DoubleVector * B_pt
Pointer to the column vector in the bordered system.
virtual ~AugmentedProblemGMRES()
Destructor: Clean up storage.
bool Preconditioner_LHS
boolean indicating use of left hand preconditioning (if true) or right hand preconditioning (if false...
void set_preconditioner_RHS()
Enable right preconditioning.
void set_preconditioner_LHS()
Set left preconditioning (the default)
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
unsigned iterations() const
Number of iterations taken.
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
MATRIX * Matrix_pt
Pointer to matrix.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
General interface to solve function.
unsigned Iterations
Number of iterations taken.
virtual ~BiCGStab()
Destructor (cleanup storage)
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
void operator=(const BiCGStab &)=delete
Broken assignment operator.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
BiCGStab(const BiCGStab &)=delete
Broken copy constructor.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
//////////////////////////////////////////////////////////////// ////////////////////////////////////...
//////////////////////////////////////////////////////////////////////////// ////////////////////////...
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
unsigned iterations() const
Number of iterations taken.
CG(const CG &)=delete
Broken copy constructor.
virtual ~CG()
Destructor (cleanup storage)
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
void operator=(const CG &)=delete
Broken assignment operator.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
unsigned Iterations
Number of iterations taken.
MATRIX * Matrix_pt
Pointer to matrix.
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
General interface to solve function.
A class for compressed row matrices. This is a distributable object.
void multiply(const DoubleVector &x, DoubleVector &soln) const
Multiply the matrix by the vector x: soln=Ax.
unsigned long nrow() const
Return the number of rows of the matrix.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
DampedJacobi(const DampedJacobi &)=delete
Broken copy constructor.
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
~DampedJacobi()
Empty destructor.
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
unsigned Iterations
Number of iterations taken.
void operator=(const DampedJacobi &)=delete
Broken assignment operator.
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
void extract_diagonal_entries(DoubleMatrixBase *matrix_pt)
Function to extract the diagonal entries from the matrix.
double Omega
Damping factor.
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
This is where the actual work is done – different implementations for different matrix types.
void smoother_setup(DoubleMatrixBase *matrix_pt)
Setup: Pass pointer to the matrix and store in cast form.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
unsigned iterations() const
Number of iterations taken.
DampedJacobi(const double &omega=2.0/3.0)
Empty constructor.
Vector< double > Matrix_diagonal
Vector containing the diagonal entries of A.
void solve(Problem *const &problem_pt, DoubleVector &result)
Use damped Jacobi iteration as an IterativeLinearSolver: This obtains the Jacobian matrix J and the r...
MATRIX * Matrix_pt
Pointer to the matrix.
void smoother_solve(const DoubleVector &rhs, DoubleVector &solution)
The smoother_solve function performs fixed number of iterations on the system A*result=rhs....
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
Base class for any linear algebra object that is distributable. Just contains storage for the LinearA...
LinearAlgebraDistribution * distribution_pt() const
access to the LinearAlgebraDistribution
unsigned nrow() const
access function to the number of global rows.
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,...
A vector in the mathematical sense, initially developed for linear algebra type applications....
double * values_pt()
access function to the underlying values
double dot(const DoubleVector &vec) const
compute the dot product of this vector with the vector vec.
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
void enable_computation_of_gradient()
function to enable the computation of the gradient
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
bool Preconditioner_LHS
boolean indicating use of left hand preconditioning (if true) or right hand preconditioning (if false...
double Preconditioner_application_time
Storage for the time spent applying the preconditioner.
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
General interface to solve function.
MATRIX * Matrix_pt
Pointer to matrix.
void set_preconditioner_RHS()
Enable right preconditioning.
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
GMRES(const GMRES &)=delete
Broken copy constructor.
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
unsigned Iterations
Number of iterations taken.
void operator=(const GMRES &)=delete
Broken assignment operator.
void update(const unsigned &k, const Vector< Vector< double >> &H, const Vector< double > &s, const Vector< DoubleVector > &v, DoubleVector &x)
Helper function to update the result vector using the result, x=x_0+V_m*y.
unsigned iterations() const
Number of iterations taken.
void enable_iteration_restart(const unsigned &restart)
switches on iteration restarting and takes as an argument the number of iterations after which the co...
virtual ~GMRES()
Destructor (cleanup storage)
unsigned Restart
The number of iterations before the iteration proceedure is restarted if iteration restart is used.
void apply_plane_rotation(double &dx, double &dy, double &cs, double &sn)
Helper function: Apply plane rotation. This is done using the update:
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void set_preconditioner_LHS()
Set left preconditioning (the default)
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void generate_plane_rotation(double &dx, double &dy, double &cs, double &sn)
Helper function: Generate a plane rotation. This is done by finding the values of (i....
void disable_iteration_restart()
switches off iteration restart
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
bool iteration_restart() const
access function indicating whether restarted GMRES is used
bool Iteration_restart
boolean indicating if iteration restarting is used
void smoother_solve(const DoubleVector &rhs, DoubleVector &result)
The smoother_solve function performs fixed number of iterations on the system A*result=rhs....
unsigned iterations() const
Number of iterations taken.
GS(const GS &)=delete
Broken copy constructor.
unsigned Iterations
Number of iterations taken.
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
void operator=(const GS &)=delete
Broken assignment operator.
void clean_up_memory()
Clean up data that's stored for resolve (if any has been stored)
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
CRDoubleMatrix * Matrix_pt
System matrix pointer in the format specified by the template argument.
void smoother_setup(DoubleMatrixBase *matrix_pt)
Set up the smoother for the matrix specified by the pointer.
Vector< int > Index_of_diagonal_entries
Vector whose i'th entry contains the index of the last entry below or on the diagonal of the i'th row...
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
double preconditioner_setup_time() const
Returns the time taken to set up the preconditioner.
virtual ~GS()
Destructor (cleanup storage)
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
//////////////////////////////////////////////////////////////////////// ////////////////////////////...
virtual ~GS()
Destructor (cleanup storage)
unsigned Iterations
Number of iterations taken.
double preconditioner_setup_time() const
Returns the time taken to set up the preconditioner.
bool Matrix_can_be_deleted
Boolean flag to indicate if the matrix pointed to be Matrix_pt can be deleted.
void solve_helper(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
General interface to solve function.
void clean_up_memory()
Cleanup data that's stored for resolve (if any has been stored)
void solve(DoubleMatrixBase *const &matrix_pt, const Vector< double > &rhs, Vector< double > &result)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
bool Resolving
Boolean flag to indicate if the solve is done in re-solve mode, bypassing setup of matrix and precond...
void smoother_solve(const DoubleVector &rhs, DoubleVector &result)
The smoother_solve function performs fixed number of iterations on the system A*result=rhs....
void solve(DoubleMatrixBase *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution)
Linear-algebra-type solver: Takes pointer to a matrix and rhs vector and returns the solution of the ...
void smoother_setup(DoubleMatrixBase *matrix_pt)
Set up the smoother for the matrix specified by the pointer.
void disable_resolve()
Overload disable resolve so that it cleans up memory too.
MATRIX * Matrix_pt
System matrix pointer in the format specified by the template argument.
void operator=(const GS &)=delete
Broken assignment operator.
unsigned iterations() const
Number of iterations taken.
void solve(Problem *const &problem_pt, DoubleVector &result)
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
GS(const GS &)=delete
Broken copy constructor.
void resolve(const DoubleVector &rhs, DoubleVector &result)
Re-solve the system defined by the last assembled Jacobian and the rhs vector specified here....
The Identity Preconditioner.
Base class for all linear iterative solvers. This merely defines standard interfaces for linear itera...
bool Use_iterative_solver_as_preconditioner
Use the iterative solver as preconditioner.
bool First_time_solve_when_used_as_preconditioner
When the iterative solver is used a preconditioner then we call the setup of solver method only once ...
void open_convergence_history_file_stream(const std::string &file_name, const std::string &zone_title="")
Write convergence history into file with specified filename (automatically switches on doc)....
void close_convergence_history_file_stream()
Close convergence history output stream.
Preconditioner *const & preconditioner_pt() const
Access function to preconditioner (const version)
void enable_setup_preconditioner_before_solve()
Setup the preconditioner before the solve.
double Tolerance
Convergence tolerance.
void disable_error_after_max_iter()
Don't throw an error if we don't converge within max_iter (default).
Preconditioner * Preconditioner_pt
Pointer to the preconditioner.
void enable_doc_convergence_history()
Enable documentation of the convergence history.
void enable_iterative_solver_as_preconditioner()
Enables the iterative solver be used as preconditioner (when calling the solve method it bypass the s...
virtual unsigned iterations() const =0
Number of iterations taken.
double linear_solver_solution_time() const
return the time taken to solve the linear system
virtual ~IterativeLinearSolver()
Destructor (empty)
void enable_error_after_max_iter()
Throw an error if we don't converge within max_iter.
bool Throw_error_after_max_iter
Should we throw an error instead of just returning when we hit the max iterations?
IterativeLinearSolver()
Constructor: Set (default) trivial preconditioner and set defaults for tolerance and max....
void disable_doc_convergence_history()
Disable documentation of the convergence history.
Preconditioner *& preconditioner_pt()
Access function to preconditioner.
double Preconditioner_setup_time
Preconditioner setup time.
double Jacobian_setup_time
Jacobian setup time.
static IdentityPreconditioner Default_preconditioner
Default preconditioner: The base class for preconditioners is a fully functional (if trivial!...
virtual double preconditioner_setup_time() const
returns the the time taken to setup the preconditioner
void disable_iterative_solver_as_preconditioner()
Disables the iterative solver be used as preconditioner (when calling the solve method it bypass the ...
unsigned Max_iter
Maximum number of iterations.
double & tolerance()
Access to convergence tolerance.
double Solution_time
linear solver solution time
void operator=(const IterativeLinearSolver &)=delete
Broken assignment operator.
IterativeLinearSolver(const IterativeLinearSolver &)=delete
Broken copy constructor.
std::ofstream Output_file_stream
Output file stream for convergence history.
void disable_setup_preconditioner_before_solve()
Don't set up the preconditioner before the solve.
unsigned & max_iter()
Access to max. number of iterations.
bool Doc_convergence_history
Flag indicating if the convergence history is to be documented.
double jacobian_setup_time() const
returns the time taken to assemble the jacobian matrix and residual vector
bool Setup_preconditioner_before_solve
indicates whether the preconditioner should be setup before solve. Default = true;
unsigned nrow() const
access function to the number of global rows.
Base class for all linear solvers. This merely defines standard interfaces for linear solvers,...
virtual void solve(Problem *const &problem_pt, DoubleVector &result)=0
Solver: Takes pointer to problem and returns the results vector which contains the solution of the li...
bool Enable_resolve
Boolean that indicates whether the matrix (or its factors, in the case of direct solver) should be st...
virtual void disable_resolve()
Disable resolve (i.e. store matrix and/or LU decomposition, say) This function simply resets an inter...
bool Compute_gradient
flag that indicates whether the gradient required for the globally convergent Newton method should be...
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...
virtual void preconditioner_solve(const DoubleVector &r, DoubleVector &z)=0
Apply the preconditioner. Pure virtual generic interface function. This method should apply the preco...
////////////////////////////////////////////////////////////////// //////////////////////////////////...
//////////////////////////////////////////////////////////////////// ////////////////////////////////...
virtual ~Smoother()
Virtual empty destructor.
void check_validity_of_solve_helper_inputs(MATRIX *const &matrix_pt, const DoubleVector &rhs, DoubleVector &solution, const double &n_dof)
Self-test to check that all the dimensions of the inputs to solve helper are consistent and everythin...
virtual void smoother_setup(DoubleMatrixBase *matrix_pt)=0
Set up the smoother for the matrix specified by the pointer.
virtual void smoother_solve(const DoubleVector &rhs, DoubleVector &result)=0
The smoother_solve function performs fixed number of iterations on the system A*result=rhs....
bool Use_as_smoother
When a derived class object is being used as a smoother in the MG solver (or elsewhere) the residual ...
Smoother()
Empty constructor.
std::string string(const unsigned &i)
Return the i-th string or "" if the relevant string hasn't been defined.
double timer()
returns the time in seconds after some point in past
//////////////////////////////////////////////////////////////////// ////////////////////////////////...