dune-pdelab  2.5-dev
seqistlsolverbackend.hh
Go to the documentation of this file.
1 // -*- tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=8 sw=2 sts=2:
3 #ifndef DUNE_PDELAB_BACKEND_ISTL_SEQISTLSOLVERBACKEND_HH
4 #define DUNE_PDELAB_BACKEND_ISTL_SEQISTLSOLVERBACKEND_HH
5 
6 // this is here for backwards compatibility and deprecation warnings, remove after 2.5.0
7 #include "ensureistlinclude.hh"
8 
9 #include <dune/common/deprecated.hh>
10 #include <dune/common/parallel/mpihelper.hh>
11 
12 #include <dune/istl/owneroverlapcopy.hh>
13 #include <dune/istl/solvercategory.hh>
14 #include <dune/istl/operators.hh>
15 #include <dune/istl/solvers.hh>
16 #include <dune/istl/preconditioners.hh>
17 #include <dune/istl/scalarproducts.hh>
18 #include <dune/istl/paamg/amg.hh>
19 #include <dune/istl/paamg/pinfo.hh>
20 #include <dune/istl/io.hh>
21 #include <dune/istl/superlu.hh>
22 #include <dune/istl/umfpack.hh>
23 
29 
30 namespace Dune {
31  namespace PDELab {
32 
36 
37  template<typename X, typename Y, typename GOS>
38  class OnTheFlyOperator : public Dune::LinearOperator<X,Y>
39  {
40  public:
41  typedef X domain_type;
42  typedef Y range_type;
43  typedef typename X::field_type field_type;
44 
45  enum {category=Dune::SolverCategory::sequential};
46 
47  OnTheFlyOperator (GOS& gos_)
48  : gos(gos_)
49  {}
50 
51  virtual void apply (const X& x, Y& y) const
52  {
53  y = 0.0;
54  gos.jacobian_apply(x,y);
55  }
56 
57  virtual void applyscaleadd (field_type alpha, const X& x, Y& y) const
58  {
59  Y temp(y);
60  temp = 0.0;
61  gos.jacobian_apply(x,temp);
62  y.axpy(alpha,temp);
63  }
64 
65  private:
66  GOS& gos;
67  };
68 
69  //==============================================================================
70  // Here we add some standard linear solvers conforming to the linear solver
71  // interface required to solve linear and nonlinear problems.
72  //==============================================================================
73 
74  template<template<class,class,class,int> class Preconditioner,
75  template<class> class Solver>
77  : public SequentialNorm, public LinearResultStorage
78  {
79  public:
85  explicit ISTLBackend_SEQ_Base(unsigned maxiter_=5000, int verbose_=1)
86  : maxiter(maxiter_), verbose(verbose_)
87  {}
88 
89 
90 
98  template<class M, class V, class W>
99  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
100  {
101  using Backend::Native;
102  using Backend::native;
103 
104  Dune::MatrixAdapter<Native<M>,
105  Native<V>,
106  Native<W>> opa(native(A));
107  Preconditioner<Native<M>,
108  Native<V>,
109  Native<W>,
110  1> prec(native(A), 3, 1.0);
111  Solver<Native<V>> solver(opa, prec, reduction, maxiter, verbose);
112  Dune::InverseOperatorResult stat;
113  solver.apply(native(z), native(r), stat);
114  res.converged = stat.converged;
115  res.iterations = stat.iterations;
116  res.elapsed = stat.elapsed;
117  res.reduction = stat.reduction;
118  res.conv_rate = stat.conv_rate;
119  }
120 
121  private:
122  unsigned maxiter;
123  int verbose;
124  };
125 
126  template<template<typename> class Solver>
128  : public SequentialNorm, public LinearResultStorage
129  {
130  public:
136  explicit ISTLBackend_SEQ_ILU0 (unsigned maxiter_=5000, int verbose_=1)
137  : maxiter(maxiter_), verbose(verbose_)
138  {}
146  template<class M, class V, class W>
147  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
148  {
149  using Backend::Native;
150  using Backend::native;
151  Dune::MatrixAdapter<Native<M>,
152  Native<V>,
153  Native<W>> opa(native(A));
154  Dune::SeqILU0<Native<M>,
155  Native<V>,
156  Native<W>
157  > ilu0(native(A), 1.0);
158  Solver<Native<V>> solver(opa, ilu0, reduction, maxiter, verbose);
159  Dune::InverseOperatorResult stat;
160  solver.apply(native(z), native(r), stat);
161  res.converged = stat.converged;
162  res.iterations = stat.iterations;
163  res.elapsed = stat.elapsed;
164  res.reduction = stat.reduction;
165  res.conv_rate = stat.conv_rate;
166  }
167  private:
168  unsigned maxiter;
169  int verbose;
170  };
171 
172  template<template<typename> class Solver>
174  : public SequentialNorm, public LinearResultStorage
175  {
176  public:
183  ISTLBackend_SEQ_ILUn (int n, double w, unsigned maxiter_=5000, int verbose_=1)
184  : n_(n), w_(w), maxiter(maxiter_), verbose(verbose_)
185  {}
193  template<class M, class V, class W>
194  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
195  {
196  using Backend::Native;
197  using Backend::native;
198  Dune::MatrixAdapter<Native<M>,
199  Native<V>,
200  Native<W>
201  > opa(native(A));
202  Dune::SeqILUn<Native<M>,
203  Native<V>,
204  Native<W>
205  > ilun(native(A), n_, w_);
206  Solver<Native<V>> solver(opa, ilun, reduction, maxiter, verbose);
207  Dune::InverseOperatorResult stat;
208  solver.apply(native(z), native(r), stat);
209  res.converged = stat.converged;
210  res.iterations = stat.iterations;
211  res.elapsed = stat.elapsed;
212  res.reduction = stat.reduction;
213  res.conv_rate = stat.conv_rate;
214  }
215  private:
216  int n_;
217  double w_;
218 
219  unsigned maxiter;
220  int verbose;
221  };
222 
225 
230  : public ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::LoopSolver>
231  {
232  public:
237  explicit ISTLBackend_SEQ_LOOP_Jac (unsigned maxiter_=5000, int verbose_=1)
238  : ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::LoopSolver>(maxiter_, verbose_)
239  {}
240  };
241 
246  : public ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::BiCGSTABSolver>
247  {
248  public:
253  explicit ISTLBackend_SEQ_BCGS_Jac (unsigned maxiter_=5000, int verbose_=1)
254  : ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::BiCGSTABSolver>(maxiter_, verbose_)
255  {}
256  };
257 
262  : public ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::BiCGSTABSolver>
263  {
264  public:
270  explicit ISTLBackend_SEQ_BCGS_SSOR (unsigned maxiter_=5000, int verbose_=1)
271  : ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::BiCGSTABSolver>(maxiter_, verbose_)
272  {}
273  };
274 
279  : public ISTLBackend_SEQ_ILU0<Dune::BiCGSTABSolver>
280  {
281  public:
287  explicit ISTLBackend_SEQ_BCGS_ILU0 (unsigned maxiter_=5000, int verbose_=1)
288  : ISTLBackend_SEQ_ILU0<Dune::BiCGSTABSolver>(maxiter_, verbose_)
289  {}
290  };
291 
296  : public ISTLBackend_SEQ_ILU0<Dune::CGSolver>
297  {
298  public:
304  explicit ISTLBackend_SEQ_CG_ILU0 (unsigned maxiter_=5000, int verbose_=1)
305  : ISTLBackend_SEQ_ILU0<Dune::CGSolver>(maxiter_, verbose_)
306  {}
307  };
308 
311  : public ISTLBackend_SEQ_ILUn<Dune::BiCGSTABSolver>
312  {
313  public:
322  explicit ISTLBackend_SEQ_BCGS_ILUn (int n_, double w_=1.0, unsigned maxiter_=5000, int verbose_=1)
323  : ISTLBackend_SEQ_ILUn<Dune::BiCGSTABSolver>(n_, w_, maxiter_, verbose_)
324  {}
325  };
326 
329  : public ISTLBackend_SEQ_ILUn<Dune::CGSolver>
330  {
331  public:
340  explicit ISTLBackend_SEQ_CG_ILUn (int n_, double w_=1.0, unsigned maxiter_=5000, int verbose_=1)
341  : ISTLBackend_SEQ_ILUn<Dune::CGSolver>(n_, w_, maxiter_, verbose_)
342  {}
343  };
344 
349  : public ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::CGSolver>
350  {
351  public:
357  explicit ISTLBackend_SEQ_CG_SSOR (unsigned maxiter_=5000, int verbose_=1)
358  : ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::CGSolver>(maxiter_, verbose_)
359  {}
360  };
361 
366  : public ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::MINRESSolver>
367  {
368  public:
374  explicit ISTLBackend_SEQ_MINRES_SSOR (unsigned maxiter_=5000, int verbose_=1)
375  : ISTLBackend_SEQ_Base<Dune::SeqSSOR, Dune::MINRESSolver>(maxiter_, verbose_)
376  {}
377  };
378 
383  : public ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::CGSolver>
384  {
385  public:
390  explicit ISTLBackend_SEQ_CG_Jac (unsigned maxiter_=5000, int verbose_=1)
391  : ISTLBackend_SEQ_Base<Dune::SeqJac, Dune::CGSolver>(maxiter_, verbose_)
392  {}
393  };
394 
395 #if HAVE_SUPERLU || DOXYGEN
396 
400  : public SequentialNorm, public LinearResultStorage
401  {
402  public:
407  explicit ISTLBackend_SEQ_SuperLU (int verbose_=1)
408  : verbose(verbose_)
409  {}
410 
411 
417  ISTLBackend_SEQ_SuperLU (int maxiter, int verbose_)
418  : verbose(verbose_)
419  {}
420 
428  template<class M, class V, class W>
429  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
430  {
431  using Backend::Native;
432  using Backend::native;
433  using ISTLM = Native<M>;
434  Dune::SuperLU<ISTLM> solver(native(A), verbose);
435  Dune::InverseOperatorResult stat;
436  solver.apply(native(z), native(r), stat);
437  res.converged = stat.converged;
438  res.iterations = stat.iterations;
439  res.elapsed = stat.elapsed;
440  res.reduction = stat.reduction;
441  res.conv_rate = stat.conv_rate;
442  }
443 
444  private:
445  int verbose;
446  };
447 #endif // HAVE_SUPERLU || DOXYGEN
448 
449 #if HAVE_SUITESPARSE_UMFPACK || DOXYGEN
450 
454  : public SequentialNorm, public LinearResultStorage
455  {
456  public:
461  explicit ISTLBackend_SEQ_UMFPack (int verbose_=1)
462  : verbose(verbose_)
463  {}
464 
465 
471  ISTLBackend_SEQ_UMFPack (int maxiter, int verbose_)
472  : verbose(verbose_)
473  {}
474 
482  template<class M, class V, class W>
483  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
484  {
485  using Backend::native;
486  using ISTLM = Backend::Native<M>;
487  Dune::UMFPack<ISTLM> solver(native(A), verbose);
488  Dune::InverseOperatorResult stat;
489  solver.apply(native(z), native(r), stat);
490  res.converged = stat.converged;
491  res.iterations = stat.iterations;
492  res.elapsed = stat.elapsed;
493  res.reduction = stat.reduction;
494  res.conv_rate = stat.conv_rate;
495  }
496 
497  private:
498  int verbose;
499  };
500 #endif // HAVE_SUITESPARSE_UMFPACK || DOXYGEN
501 
504  : public SequentialNorm, public LinearResultStorage
505  {
506  public:
510  {}
511 
519  template<class M, class V, class W>
520  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType >::real_type reduction)
521  {
522  using Backend::Native;
523  Dune::SeqJac<Native<M>,
524  Native<V>,
525  Native<W>
526  > jac(Backend::native(A),1,1.0);
527  jac.pre(z,r);
528  jac.apply(z,r);
529  jac.post(z);
530  res.converged = true;
531  res.iterations = 1;
532  res.elapsed = 0.0;
533  res.reduction = reduction;
534  res.conv_rate = reduction; // pow(reduction,1.0/1)
535  }
536  };
537 
539 
545  {
550  double tprepare;
552  int levels;
554  double tsolve;
556  double tsetup;
561  };
562 
563  template<class GO, template<class,class,class,int> class Preconditioner, template<class> class Solver,
564  bool skipBlocksizeCheck = false>
566  {
567  typedef typename GO::Traits::TrialGridFunctionSpace GFS;
568  typedef typename GO::Traits::Jacobian M;
569  typedef Backend::Native<M> MatrixType;
570  typedef typename GO::Traits::Domain V;
571  typedef Backend::Native<V> VectorType;
572  typedef Preconditioner<MatrixType,VectorType,VectorType,1> Smoother;
573  typedef Dune::MatrixAdapter<MatrixType,VectorType,VectorType> Operator;
574  typedef typename Dune::Amg::SmootherTraits<Smoother>::Arguments SmootherArgs;
575  typedef Dune::Amg::AMG<Operator,VectorType,Smoother> AMG;
576  typedef Dune::Amg::Parameters Parameters;
577 
578  public:
579  ISTLBackend_SEQ_AMG(unsigned maxiter_=5000, int verbose_=1,
580  bool reuse_=false, bool usesuperlu_=true)
581  : maxiter(maxiter_), params(15,2000), verbose(verbose_),
582  reuse(reuse_), firstapply(true), usesuperlu(usesuperlu_)
583  {
584  params.setDefaultValuesIsotropic(GFS::Traits::GridViewType::Traits::Grid::dimension);
585  params.setDebugLevel(verbose_);
586 #if !HAVE_SUPERLU
587  if (usesuperlu == true)
588  {
589  std::cout << "WARNING: You are using AMG without SuperLU!"
590  << " Please consider installing SuperLU,"
591  << " or set the usesuperlu flag to false"
592  << " to suppress this warning." << std::endl;
593  }
594 #endif
595  }
596 
601  void setparams(Parameters params_)
602  {
603  params = params_;
604  }
605 
610  typename V::ElementType norm (const V& v) const
611  {
612  return Backend::native(v).two_norm();
613  }
614 
622  void apply(M& A, V& z, V& r, typename Dune::template FieldTraits<typename V::ElementType >::real_type reduction)
623  {
624  Timer watch;
625  MatrixType& mat = Backend::native(A);
626  typedef Dune::Amg::CoarsenCriterion<Dune::Amg::SymmetricCriterion<MatrixType,
627  Dune::Amg::FirstDiagonal> > Criterion;
628  SmootherArgs smootherArgs;
629  smootherArgs.iterations = 1;
630  smootherArgs.relaxationFactor = 1;
631 
632  Criterion criterion(params);
633  //only construct a new AMG if the matrix changes
634  if (reuse==false || firstapply==true){
635  oop.reset(new Operator(mat));
636  amg.reset(new AMG(*oop, criterion, smootherArgs));
637  firstapply = false;
638  stats.tsetup = watch.elapsed();
639  stats.levels = amg->maxlevels();
640  stats.directCoarseLevelSolver=amg->usesDirectCoarseLevelSolver();
641  }
642  watch.reset();
643  Dune::InverseOperatorResult stat;
644 
645  Solver<VectorType> solver(*oop,*amg,reduction,maxiter,verbose);
646  solver.apply(Backend::native(z),Backend::native(r),stat);
647  stats.tsolve= watch.elapsed();
648  res.converged = stat.converged;
649  res.iterations = stat.iterations;
650  res.elapsed = stat.elapsed;
651  res.reduction = stat.reduction;
652  res.conv_rate = stat.conv_rate;
653  }
654 
655 
661  {
662  return stats;
663  }
664 
665  private:
666  unsigned maxiter;
667  Parameters params;
668  int verbose;
669  bool reuse;
670  bool firstapply;
671  bool usesuperlu;
672  std::shared_ptr<Operator> oop;
673  std::shared_ptr<AMG> amg;
674  ISTLAMGStatistics stats;
675  };
676 
679 
685  template<class GO>
687  : public ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::CGSolver>
688  {
689 
690  public:
699  ISTLBackend_SEQ_CG_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1,
700  bool reuse_=false, bool usesuperlu_=true)
701  : ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::CGSolver>
702  (maxiter_, verbose_, reuse_, usesuperlu_)
703  {}
704  };
705 
711  template<class GO>
713  : public ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::BiCGSTABSolver>
714  {
715 
716  public:
725  ISTLBackend_SEQ_BCGS_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1,
726  bool reuse_=false, bool usesuperlu_=true)
727  : ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::BiCGSTABSolver>
728  (maxiter_, verbose_, reuse_, usesuperlu_)
729  {}
730  };
731 
737  template<class GO>
739  : public ISTLBackend_SEQ_AMG<GO, Dune::SeqSOR, Dune::BiCGSTABSolver>
740  {
741 
742  public:
751  ISTLBackend_SEQ_BCGS_AMG_SOR(unsigned maxiter_=5000, int verbose_=1,
752  bool reuse_=false, bool usesuperlu_=true)
753  : ISTLBackend_SEQ_AMG<GO, Dune::SeqSOR, Dune::BiCGSTABSolver>
754  (maxiter_, verbose_, reuse_, usesuperlu_)
755  {}
756  };
757 
763  template<class GO>
765  : public ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::LoopSolver>
766  {
767 
768  public:
777  ISTLBackend_SEQ_LS_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1,
778  bool reuse_=false, bool usesuperlu_=true)
779  : ISTLBackend_SEQ_AMG<GO, Dune::SeqSSOR, Dune::LoopSolver>
780  (maxiter_, verbose_, reuse_, usesuperlu_)
781  {}
782  };
783 
789  template<class GO>
791  : public ISTLBackend_SEQ_AMG<GO, Dune::SeqSOR, Dune::LoopSolver>
792  {
793 
794  public:
803  ISTLBackend_SEQ_LS_AMG_SOR(unsigned maxiter_=5000, int verbose_=1,
804  bool reuse_=false, bool usesuperlu_=true)
805  : ISTLBackend_SEQ_AMG<GO, Dune::SeqSOR, Dune::LoopSolver>
806  (maxiter_, verbose_, reuse_, usesuperlu_)
807  {}
808  };
809 
816  : public SequentialNorm, public LinearResultStorage
817  {
818  public :
819 
826  explicit ISTLBackend_SEQ_GMRES_ILU0(int restart_ = 200, int maxiter_ = 5000, int verbose_ = 1)
827  : restart(restart_), maxiter(maxiter_), verbose(verbose_)
828  {}
829 
837  template<class M, class V, class W>
838  void apply(M& A, V& z, W& r, typename Dune::template FieldTraits<typename W::ElementType>::real_type reduction)
839  {
840  using Backend::Native;
841  using Backend::native;
842  Dune::MatrixAdapter<
843  Native<M>,
844  Native<V>,
845  Native<W>
846  > opa(native(A));
847  Dune::SeqILU0<
848  Native<M>,
849  Native<V>,
850  Native<W>
851  > ilu0(native(A), 1.0);
852  Dune::RestartedGMResSolver<Native<V>> solver(opa,ilu0,reduction,restart,maxiter,verbose);
853  Dune::InverseOperatorResult stat;
854  solver.apply(native(z), native(r), stat);
855  res.converged = stat.converged;
856  res.iterations = stat.iterations;
857  res.elapsed = stat.elapsed;
858  res.reduction = stat.reduction;
859  res.conv_rate = stat.conv_rate;
860  }
861 
862  private :
863  int restart, maxiter, verbose;
864  };
865 
868 
869  } // namespace PDELab
870 } // namespace Dune
871 
872 #endif // DUNE_PDELAB_BACKEND_ISTL_SEQISTLSOLVERBACKEND_HH
ISTLBackend_SEQ_SuperLU(int maxiter, int verbose_)
make a linear solver object
Definition: seqistlsolverbackend.hh:417
ISTLBackend_SEQ_AMG(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Definition: seqistlsolverbackend.hh:579
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:429
ISTLBackend_SEQ_UMFPack(int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:461
Backend using a MINRes solver preconditioned by SSOR.
Definition: seqistlsolverbackend.hh:365
void apply(M &A, V &z, V &r, typename Dune::template FieldTraits< typename V::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:622
typename native_type< T >::type Native
Alias of the native container type associated with T or T itself if it is not a backend wrapper...
Definition: backend/interface.hh:176
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:838
Class providing some statistics of the AMG solver.
Definition: seqistlsolverbackend.hh:544
int levels
the number of levels in the AMG hierarchy.
Definition: seqistlsolverbackend.hh:552
Solver backend using SuperLU as a direct solver.
Definition: seqistlsolverbackend.hh:399
ISTLBackend_SEQ_BCGS_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Constructor.
Definition: seqistlsolverbackend.hh:725
ISTLBackend_SEQ_UMFPack(int maxiter, int verbose_)
make a linear solver object
Definition: seqistlsolverbackend.hh:471
ISTLBackend_SEQ_BCGS_AMG_SOR(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Constructor.
Definition: seqistlsolverbackend.hh:751
V::ElementType norm(const V &v) const
compute global norm of a vector
Definition: seqistlsolverbackend.hh:610
Sequential Loop solver preconditioned with AMG smoothed by SSOR.
Definition: seqistlsolverbackend.hh:764
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:483
Definition: solver.hh:42
ISTLBackend_SEQ_BCGS_Jac(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:253
Y range_type
Definition: seqistlsolverbackend.hh:42
Sequential conjugate gradient solver preconditioned with AMG smoothed by SSOR.
Definition: seqistlsolverbackend.hh:686
ISTLBackend_SEQ_CG_SSOR(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:357
ISTLBackend_SEQ_Base(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:85
const ISTLAMGStatistics & statistics() const
Get statistics of the AMG solver (no of levels, timings).
Definition: seqistlsolverbackend.hh:660
Definition: seqistlsolverbackend.hh:127
ISTLBackend_SEQ_CG_ILUn(int n_, double w_=1.0, unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:340
For backward compatibility – Do not use this!
Definition: adaptivity.hh:27
Linear solver backend for Restarted GMRes preconditioned with ILU(0)
Definition: seqistlsolverbackend.hh:815
ISTLBackend_SEQ_GMRES_ILU0(int restart_=200, int maxiter_=5000, int verbose_=1)
make linear solver object
Definition: seqistlsolverbackend.hh:826
Backend for sequential BiCGSTAB solver with ILU0 preconditioner.
Definition: seqistlsolverbackend.hh:278
Solver to be used for explicit time-steppers with (block-)diagonal mass matrix.
Definition: seqistlsolverbackend.hh:503
double tsetup
The time needed for building the AMG hierarchy (coarsening).
Definition: seqistlsolverbackend.hh:556
Backend for sequential loop solver with Jacobi preconditioner.
Definition: seqistlsolverbackend.hh:229
Backend for conjugate gradient solver with Jacobi preconditioner.
Definition: seqistlsolverbackend.hh:382
void setparams(Parameters params_)
set AMG parameters
Definition: seqistlsolverbackend.hh:601
OnTheFlyOperator(GOS &gos_)
Definition: seqistlsolverbackend.hh:47
ISTLBackend_SEQ_CG_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Constructor.
Definition: seqistlsolverbackend.hh:699
Sequential BiCGSTAB solver preconditioned with AMG smoothed by SOR.
Definition: seqistlsolverbackend.hh:738
ISTLBackend_SEQ_LS_AMG_SSOR(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Constructor.
Definition: seqistlsolverbackend.hh:777
Sequential BiCGStab solver with ILU0 preconditioner.
Definition: seqistlsolverbackend.hh:310
Definition: seqistlsolverbackend.hh:565
virtual void applyscaleadd(field_type alpha, const X &x, Y &y) const
Definition: seqistlsolverbackend.hh:57
Solver backend using UMFPack as a direct solver.
Definition: seqistlsolverbackend.hh:453
ISTLBackend_SEQ_LS_AMG_SOR(unsigned maxiter_=5000, int verbose_=1, bool reuse_=false, bool usesuperlu_=true)
Constructor.
Definition: seqistlsolverbackend.hh:803
ISTLBackend_SEQ_LOOP_Jac(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:237
ISTLBackend_SEQ_MINRES_SSOR(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:374
VTKWriter & w
Definition: function.hh:1100
ISTLBackend_SEQ_BCGS_SSOR(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:270
int iterations
The number of iterations performed until convergence was reached.
Definition: seqistlsolverbackend.hh:558
Definition: seqistlsolverbackend.hh:76
Sequential Loop solver preconditioned with AMG smoothed by SOR.
Definition: seqistlsolverbackend.hh:790
Sequential BiCGStab solver preconditioned with AMG smoothed by SSOR.
Definition: seqistlsolverbackend.hh:712
ISTLBackend_SEQ_CG_Jac(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:390
Definition: solver.hh:16
ISTLBackend_SEQ_BCGS_ILUn(int n_, double w_=1.0, unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:322
Backend for sequential BiCGSTAB solver with SSOR preconditioner.
Definition: seqistlsolverbackend.hh:261
Definition: seqistlsolverbackend.hh:45
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:520
X domain_type
Definition: seqistlsolverbackend.hh:41
Definition: seqistlsolverbackend.hh:173
Definition: seqistlsolverbackend.hh:38
double tsolve
The time spent in solving the system (without building the hierarchy.
Definition: seqistlsolverbackend.hh:554
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:99
virtual void apply(const X &x, Y &y) const
Definition: seqistlsolverbackend.hh:51
X::field_type field_type
Definition: seqistlsolverbackend.hh:43
ISTLBackend_SEQ_ExplicitDiagonal()
make a linear solver object
Definition: seqistlsolverbackend.hh:509
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:147
ISTLBackend_SEQ_SuperLU(int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:407
Backend for sequential conjugate gradient solver with SSOR preconditioner.
Definition: seqistlsolverbackend.hh:348
Backend for sequential conjugate gradient solver with ILU0 preconditioner.
Definition: seqistlsolverbackend.hh:295
ISTLBackend_SEQ_BCGS_ILU0(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:287
double tprepare
The needed for computing the parallel information and for adapting the linear system.
Definition: seqistlsolverbackend.hh:550
std::enable_if< std::is_base_of< impl::WrapperBase, T >::value, Native< T > &>::type native(T &t)
Definition: backend/interface.hh:192
Backend for sequential BiCGSTAB solver with Jacobi preconditioner.
Definition: seqistlsolverbackend.hh:245
ISTLBackend_SEQ_CG_ILU0(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:304
ISTLBackend_SEQ_ILUn(int n, double w, unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:183
ISTLBackend_SEQ_ILU0(unsigned maxiter_=5000, int verbose_=1)
make a linear solver object
Definition: seqistlsolverbackend.hh:136
Sequential congute gradient solver with ILU0 preconditioner.
Definition: seqistlsolverbackend.hh:328
void apply(M &A, V &z, W &r, typename Dune::template FieldTraits< typename W::ElementType >::real_type reduction)
solve the given linear system
Definition: seqistlsolverbackend.hh:194
bool directCoarseLevelSolver
True if a direct solver was used on the coarset level.
Definition: seqistlsolverbackend.hh:560