4 #ifndef DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH 5 #define DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH 11 #include <dune/common/timer.hh> 12 #include <dune/common/deprecated.hh> 14 #warning <dune/pdelab/linearsolver/stationarymatrix.hh> and StationaryMatrixLinearSolver are deprecated and will be removed after PDELab 2.4. Please use LinearProblemSolver instead. 32 template<
class GOS,
class SB,
class Coeff>
34 DUNE_DEPRECATED_MSG(
"StationaryMatrixLinearSolver is deprecated and will be removed after PDELab 2.4. Please use LinearProblemSolver instead.")
37 typedef typename GOS::template MatrixContainer<Coeff>::Type
Matrix;
39 <
typename GOS::Traits::TrialGridFunctionSpace, Coeff>;
41 <
typename GOS::Traits::TestGridFunctionSpace, Coeff>;
45 std::shared_ptr<Matrix> m;
51 Coeff mindefect_ = 1
e-99) :
52 gos(gos_), sb(sb_), reduction(reduction_), mindefect(mindefect_)
65 timing = watch.elapsed();
66 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
67 std::cout <<
"=== matrix setup " << timing <<
" s" << std::endl;
75 timing = watch.elapsed();
76 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
77 std::cout <<
"=== matrix assembly " << timing <<
" s" << std::endl;
80 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
81 std::cout <<
"=== matrix setup skipped" << std::endl
82 <<
"=== matrix assembly skipped" << std::endl;
88 VectorV r(gos.testGridFunctionSpace(),0.0);
91 timing = watch.elapsed();
92 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
93 std::cout <<
"=== residual assembly " << timing <<
" s" << std::endl;
95 Coeff defect = sb.norm(r);
99 VectorU z(gos.trialGridFunctionSpace(),0.0);
100 Coeff red = std::min(reduction,defect/mindefect);
101 sb.apply(*m,z,r,red);
102 timing = watch.elapsed();
104 if (gos.trialGridFunctionSpace().gridView().comm().rank()==0)
105 std::cout <<
"=== solving (reduction: " << red <<
") " 106 << timing <<
" s" << std::endl;
117 #endif // DUNE_PDELAB_LINEARPROBLEM_STATIONARYMATRIX_HH StationaryMatrixLinearSolver(const GOS &gos_, SB &sb_, Coeff reduction_, Coeff mindefect_=1e-99)
Definition: stationarymatrix.hh:50
typename impl::BackendMatrixSelector< Backend, VU, VV, E >::Type Matrix
alias of the return type of BackendMatrixSelector
Definition: backend/interface.hh:134
void apply(VectorU &x)
Definition: stationarymatrix.hh:55
Definition: adaptivity.hh:27
const Entity & e
Definition: localfunctionspace.hh:111
A class for solving linear problems with stationary matrices.
Definition: stationarymatrix.hh:33
typename impl::BackendVectorSelector< GridFunctionSpace, FieldType >::Type Vector
alias of the return type of BackendVectorSelector
Definition: backend/interface.hh:113