16 #ifndef dealii_solver_qmrs_h 17 #define dealii_solver_qmrs_h 19 #include <deal.II/base/config.h> 21 #include <deal.II/base/logstream.h> 22 #include <deal.II/base/subscriptor.h> 24 #include <deal.II/lac/solver.h> 25 #include <deal.II/lac/solver_control.h> 29 DEAL_II_NAMESPACE_OPEN
94 template <
typename VectorType = Vector<
double>>
178 template <
typename MatrixType,
typename PreconditionerType>
180 solve(
const MatrixType & A,
182 const VectorType & b,
183 const PreconditionerType &preconditioner);
192 const VectorType & x,
193 const VectorType & r,
194 const VectorType & d)
const;
210 double last_residual;
213 const double last_residual);
220 template <
typename MatrixType,
typename PreconditionerType>
224 const VectorType & b,
225 const PreconditionerType &preconditioner,
244 template <
class VectorType>
247 const double last_residual)
249 , last_residual(last_residual)
254 template <
class VectorType>
263 template <
class VectorType>
271 template <
class VectorType>
276 const VectorType &)
const 279 template <
class VectorType>
280 template <
typename MatrixType,
typename PreconditionerType>
284 const VectorType & b,
285 const PreconditionerType &preconditioner)
315 deallog <<
"Restart step " <<
step << std::endl;
316 state =
iterate(A, x, b, preconditioner, *Vr, *Vu, *Vq, *Vt, *Vd);
327 template <
class VectorType>
328 template <
typename MatrixType,
typename PreconditionerType>
332 const VectorType & b,
333 const PreconditionerType &preconditioner,
344 double tau, rho, theta = 0;
355 preconditioner.vmult(t, r);
362 preconditioner.vmult(q, t);
366 res = std::sqrt(tau);
381 const double sigma = q * t;
388 const double alpha = rho / sigma;
394 const double theta_old = theta;
400 preconditioner.vmult(t, r);
410 const double psi = 1. / (1. + theta);
414 d.sadd(psi * theta_old, psi * alpha, q);
422 res = std::sqrt((it + 1) * tau);
443 const double rho_old = rho;
454 preconditioner.vmult(u, t);
459 const double beta = rho / rho_old;
467 DEAL_II_NAMESPACE_CLOSE
Stop iteration, goal not reached.
bool left_preconditioning
#define AssertThrow(cond, exc)
SolverQMRS(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
Stop iteration, goal reached.
boost::signals2::signal< SolverControl::State(const unsigned int iteration, const double check_value, const VectorType ¤t_iterate), StateCombiner > iteration_status
virtual void print_vectors(const unsigned int step, const VectorType &x, const VectorType &r, const VectorType &d) const
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
VectorMemory< VectorType > & memory
AdditionalData(const bool left_preconditioning=false, const double solver_tolerance=1.e-9, const bool breakdown_testing=true, const double breakdown_threshold=1.e-16)
IterationResult iterate(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner, VectorType &r, VectorType &u, VectorType &q, VectorType &t, VectorType &d)
double breakdown_threshold
AdditionalData additional_data