4 #ifndef DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH
5 #define DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH
10 #include <dune/common/shared_ptr.hh>
11 #include <dune/common/timer.hh>
29 template<
class GOS,
class SB,
class Coeff>
32 typedef typename GOS::template MatrixContainer<Coeff>::Type Matrix;
34 <
typename GOS::Traits::TrialGridFunctionSpace, Coeff>::Type VectorU;
36 <
typename GOS::Traits::TestGridFunctionSpace, Coeff>::Type VectorV;
46 Coeff mindefect_ = 1
e-99) :
47 gos(gos_), sb(sb_), reduction(reduction_), mindefect(mindefect_)
58 m.reset(
new Matrix(gos));
60 timing = watch.elapsed();
61 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
62 std::cout <<
"=== matrix setup " << timing <<
" s" << std::endl;
70 timing = watch.elapsed();
71 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
72 std::cout <<
"=== matrix assembly " << timing <<
" s" << std::endl;
75 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
76 std::cout <<
"=== matrix setup skipped" << std::endl
77 <<
"=== matrix assembly skipped" << std::endl;
83 VectorV r(gos.testGridFunctionSpace(),0.0);
86 timing = watch.elapsed();
87 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
88 std::cout <<
"=== residual assembly " << timing <<
" s" << std::endl;
90 Coeff defect = sb.norm(r);
94 VectorU z(gos.trialGridFunctionSpace(),0.0);
95 Coeff red = std::min(reduction,defect/mindefect);
97 timing = watch.elapsed();
99 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
100 std::cout <<
"=== solving (reduction: " << red <<
") "
101 << timing <<
" s" << std::endl;
112 #endif // DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH
StationaryMatrixLinearSolver(const GOS &gos_, SB &sb_, Coeff reduction_, Coeff mindefect_=1e-99)
Definition: stationarymatrix.hh:45
Definition: backendselector.hh:11
void apply(VectorU &x)
Definition: stationarymatrix.hh:50
A class for solving linear problems with stationary matrices.
Definition: stationarymatrix.hh:30
const E & e
Definition: interpolate.hh:172