4 #ifndef DUNE_ISTL_SOLVER_HH 5 #define DUNE_ISTL_SOLVER_HH 78 template<
class X,
class Y>
124 enum { iterationSpacing = 5 , normSpacing = 16 };
129 s << std::setw(iterationSpacing) <<
" Iter";
130 s << std::setw(normSpacing) <<
"Defect";
131 s << std::setw(normSpacing) <<
"Rate" << std::endl;
135 template <
typename CountType,
typename DataType>
137 const CountType& iter,
138 const DataType& norm,
139 const DataType& norm_old)
const 141 const DataType rate = norm/norm_old;
142 s << std::setw(iterationSpacing) << iter <<
" ";
143 s << std::setw(normSpacing) << norm <<
" ";
144 s << std::setw(normSpacing) << rate << std::endl;
148 template <
typename CountType,
typename DataType>
150 const CountType& iter,
151 const DataType& norm)
const 153 s << std::setw(iterationSpacing) << iter <<
" ";
154 s << std::setw(normSpacing) << norm << std::endl;
void clear()
Resets all data.
Definition: solver.hh:40
Statistics about the application of an inverse operator.
Definition: solver.hh:31
double elapsed
Elapsed time in seconds.
Definition: solver.hh:62
double reduction
Reduction achieved: .
Definition: solver.hh:53
X domain_type
Type of the domain of the operator to be inverted.
Definition: solver.hh:82
virtual ~InverseOperator()
Destructor.
Definition: solver.hh:120
Y range_type
Type of the range of the operator to be inverted.
Definition: solver.hh:85
int iterations
Number of iterations.
Definition: solver.hh:50
Definition: basearray.hh:19
void printOutput(std::ostream &s, const CountType &iter, const DataType &norm) const
helper function for printing solver output
Definition: solver.hh:149
double conv_rate
Convergence rate (average reduction per step)
Definition: solver.hh:59
bool converged
True if convergence criterion has been met.
Definition: solver.hh:56
void printHeader(std::ostream &s) const
helper function for printing header of solver output
Definition: solver.hh:127
InverseOperatorResult()
Default constructor.
Definition: solver.hh:34
X::field_type field_type
The field type of the operator.
Definition: solver.hh:88
Abstract base class for all solvers.
Definition: solver.hh:79
void printOutput(std::ostream &s, const CountType &iter, const DataType &norm, const DataType &norm_old) const
helper function for printing solver output
Definition: solver.hh:136