From: Martin Kronbichler Date: Wed, 5 Nov 2014 09:01:09 +0000 (+0100) Subject: Merge branch 'master' of https://github.com/dealii/dealii X-Git-Tag: v8.2.0-rc1~88^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F213%2Fhead;p=dealii.git Merge branch 'master' of https://github.com/dealii/dealii --- 2a52b0728c170fe1ada171da65c582bf047f8e68 diff --cc doc/news/changes.h index eb0567c0d3,dde13a8e69..ba368eb32e --- a/doc/news/changes.h +++ b/doc/news/changes.h @@@ -307,21 -325,22 +325,37 @@@ inconvenience this causes

Specific improvements

    +
  1. Fixed: Using the FEEvaluation framework did not work for + scalar elements in 1d because there were conflicting partial + specializations. This is now fixed. +
    + (Shiva Rudraraju, 2014/11/04) +
  2. + +
  3. New: There is now a macro DEAL_II_VERSION_GTE + that can be used to test whether the deal.II version is greater + than or equal a particular version number. This is useful if you + need to make application programs compatible with different + deal.II releases. +
    + (Wolfgang Bangerth, 2014/10/31) +
  4. + +
  5. New: The vector classes in deal.II (including Trilinos and PETSc + wrappers) now have a new method x.add_and_dot(factor,v,w) which performs + x.add(factor,v) and subsequent inner product of x with another vector + w. This operation occurs in some iterative solvers; by a combined operation, + reduced memory transfer and thus higher performance are enabled. +
    + (Martin Kronbichler, 2014/10/27) +
  6. + +
  7. Improved: Inner products and norms on deal.II's own vector classes now + use vectorization through VectorizedArray if available. +
    + (Martin Kronbichler, 2014/10/27) +
  8. +
  9. Changed: PETSc and Trilinos vectors with ghost entries can now be reset to zero using = 0.0;
    diff --cc include/deal.II/lac/solver.h index 748e748eec,7431309c6e..8bcd2344ec --- a/include/deal.II/lac/solver.h +++ b/include/deal.II/lac/solver.h @@@ -79,7 -81,7 +81,7 @@@ template class Vector * void reinit (const Vector &model_vector, * const bool leave_elements_uninitialized = false); * -- * // Scalar product between the current object ++ * // Inner product between the current object * // and the argument * double operator * (const Vector &v) const; * @@@ -99,6 -101,6 +101,13 @@@ * void equ (const double a, * const Vector &x); * ++ * // Combined scaled addition of vector x into ++ * // the current object and subsequent inner ++ * // product of the current object with v ++ * double add_and_dot (const double a, ++ * const Vector &x, ++ * const Vector &v); ++ * * // Multiply the elements of the current * // object by a fixed value * Vector & operator *= (const double a); diff --cc include/deal.II/lac/solver_bicgstab.h index f86d60e47e,8e0c03e492..0f68bf44d4 --- a/include/deal.II/lac/solver_bicgstab.h +++ b/include/deal.II/lac/solver_bicgstab.h @@@ -349,13 -389,18 +389,17 @@@ SolverBicgstab::iterate(const M //TODO:[?] Find better breakdown criterion if (std::fabs(alpha) > 1.e10) - return true; + return IterationResult(true, state, step, res); - r.add(-alpha, v); + res = std::sqrt(r.add_and_dot(-alpha, v, r)); // check for early success, see the lac/bicgstab_early testcase as to // why this is necessary - if (this->control().check(step, res) == SolverControl::success) + // + // note: the vector *Vx we pass to the iteration_status signal here is only + // the current approximation, not the one we will return with, + // which will be x=*Vx + alpha*y - res = r.l2_norm(); + if (this->iteration_status(step, res, *Vx) == SolverControl::success) { Vx->add(alpha, y); print_vectors(step, *Vx, r, y); @@@ -367,16 -412,14 +411,16 @@@ rhobar = t*r; omega = rhobar/(t*t); Vx->add(alpha, y, omega, z); - r.add(-omega, t); if (additional_data.exact_residual) - res = criterion(A, *Vx, *Vb); + { + r.add(-omega, t); + res = criterion(A, *Vx, *Vb); + } else - res = r.l2_norm(); + res = std::sqrt(r.add_and_dot(-omega, t, r)); - state = this->control().check(step, res); + state = this->iteration_status(step, res, *Vx); print_vectors(step, *Vx, r, y); } while (state == SolverControl::iterate);