diff --git a/dune/solvers/solvers/loopsolver.hh b/dune/solvers/solvers/loopsolver.hh index 7484bf09519ad06c688f0525e7b2b8bcbb77fa60..d1b1800ccd3b9a17550650d2dddd08a0f6bf1531 100644 --- a/dune/solvers/solvers/loopsolver.hh +++ b/dune/solvers/solvers/loopsolver.hh @@ -69,43 +69,24 @@ public: /** * \brief Add a convergence criterion * - * \param f The criterion functor - * \param header The header string - * - * This is a short cut for - * \code{.cpp} - * loopSolver.addCriterion(Criterion(f,header)); - * \endcode - * For the possible choices for return values of - * the functor refer to the documentation of Criterion. - */ - template<class F> - void addCriterion(F&& f, const std::string& header) - { - monitors_.push_back(Dune::Solvers::Criterion(std::forward<F>(f), header)); - } - - /** - * \brief Add a convergence monitor + * All criteria are checked after each loop. The solver loop will + * terminate once any of the supplied criteria evaluates to true. + * If you want to terminate only if several criteria are true + * you can combine criteria using the overloaded bitwise + * logical operations. * - * \param f The monitor functor - * \param format A printf format string used to print the result of f - * \param header The header string + * Besides checking the criterion the LoopSolver will + * print the diagnostic string returned by the criterion + * in a column with the criterions header string on top. * - * This is a short cut for - * \code{.cpp} - * loopSolver.addCriterion(Criterion(f,format,header)); - * \endcode - * This will add an always-false Criterion only for - * diagnostic. The result of the function will be - * formated according to the format string and - * printed in a column with the criterions header - * string on top. + * This is a convenience method that just forwards all + * arguments to the constructor of Dune::Solvers::Criterion. + * Refer to the documentation of the latter for details. */ - template<class F> - void addMonitor(F&& f, const std::string& format, const std::string& header) + template<class... Args> + void addCriterion(const Args&... args) { - monitors_.push_back(Criterion(std::forward<F>(f), format, header)); + monitors_.push_back(Dune::Solvers::Criterion(args...)); } /**