From a13e5216ae7271cf95f15b6149df28d9c8fbfc6a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 25 Jan 2015 13:04:58 -0600 Subject: [PATCH] Remove deprecated classes PreconditionedMatrix and PreconditionLACSolver. --- doc/news/changes.h | 1 + include/deal.II/lac/precondition.h | 243 ----------------------------- 2 files changed, 1 insertion(+), 243 deletions(-) diff --git a/doc/news/changes.h b/doc/news/changes.h index ea390d237d..caccbe2d22 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -209,6 +209,7 @@ inconvenience this causes. - Class MGMatrix. - Multigrid::vmult and friends. - Classes FEEvaluationDGP, FEEvaluationGeneral and FEEvaluationGL. + - Classes PreconditionedMatrix and PreconditionLACSolver.
This release also removes the deprecated class MGDoFHandler. The functionality of this class had previously been incorporated into diff --git a/include/deal.II/lac/precondition.h b/include/deal.II/lac/precondition.h index 9f665aa88c..d3c2af77db 100644 --- a/include/deal.II/lac/precondition.h +++ b/include/deal.II/lac/precondition.h @@ -646,153 +646,6 @@ private: -/** - * @deprecated This class has been superseded by IterativeInverse, which is - * more flexible and easier to use. - * - * Preconditioner using an iterative solver. This preconditioner uses a fully - * initialized LAC iterative solver for the approximate inverse of the matrix. - * Naturally, this solver needs another preconditionig method. - * - * Usually, the use of ReductionControl is preferred over the use of the basic - * SolverControl in defining this solver. - * - * Krylov space methods like SolverCG or SolverBicgstab become inefficient if - * soution down to machine accuracy is needed. This is due to the fact, that - * round-off errors spoil the orthogonality of the vector sequences. - * Therefore, a nested iteration of two methods is proposed: The outer method - * is SolverRichardson, since it is robust with respect to round-of errors. - * The inner loop is an appropriate Krylov space method, since it is fast. - * - * @code - * // Declare related objects - * - * SparseMatrix A; - * Vector x; - * Vector b; - * GrowingVectorMemory > mem; - * - * ReductionControl inner_control (10, 1.e-30, 1.e-2) - * SolverCG > inner_iteration (inner_control, mem); - * PreconditionSSOR > inner_precondition; - * inner_precondition.initialize (A, 1.2); - * - * PreconditionLACSolver precondition; - * precondition.initialize (inner_iteration, A, inner_precondition); - * - * SolverControl outer_control(100, 1.e-16); - * SolverRichardson > outer_iteration; - * - * outer_iteration.solve (A, x, b, precondition); - * @endcode - * - * Each time we call the inner loop, reduction of the residual by a factor - * 1.e-2 is attempted. Since the right hand side vector of the inner - * iteration is the residual of the outer loop, the relative errors are far - * from machine accuracy, even if the errors of the outer loop are in the - * range of machine accuracy. - * - * @author Guido Kanschat, 1999 - */ -template, class PRECONDITION = PreconditionIdentity> -class PreconditionLACSolver : public Subscriptor -{ -public: - /** - * Constructor. All work is done in initialize. - */ - PreconditionLACSolver (); - - /** - * Initialization function. Provide a solver object, a matrix, and another - * preconditioner for this. - */ - void initialize (SOLVER &, - const MATRIX &, - const PRECONDITION &); - - /** - * Execute preconditioning. - */ - template - void vmult (VECTOR &, const VECTOR &) const; - -private: - /** - * The solver object to use. - */ - SmartPointer > solver; - - /** - * The matrix in use. - */ - SmartPointer > matrix; - - /** - * The preconditioner to use. - */ - SmartPointer > precondition; -} DEAL_II_DEPRECATED; - - - -/** - * @deprecated Use ProductMatrix instead. - * - * Matrix with preconditioner. Given a matrix $A$ and a preconditioner $P$, - * this class implements a new matrix with the matrix-vector product $PA$. It - * needs an auxiliary vector for that. - * - * By this time, this is considered a temporary object to be plugged into - * eigenvalue solvers. Therefore, no SmartPointer is used for A and - * P. - * - * @author Guido Kanschat, 2000 - */ -template -class PreconditionedMatrix : public Subscriptor -{ -public: - /** - * Constructor. Provide matrix, preconditioner and a memory pool to obtain - * the auxiliary vector. - */ - PreconditionedMatrix (const MATRIX &A, - const PRECOND &P, - VectorMemory &mem); - - /** - * Preconditioned matrix-vector-product. - */ - void vmult (VECTOR &dst, const VECTOR &src) const; - - /** - * Transposed preconditioned matrix-vector-product. - */ - void Tvmult (VECTOR &dst, const VECTOR &src) const; - - /** - * Residual $b-PAx$. - */ - double residual (VECTOR &dst, const VECTOR &src, const VECTOR &rhs) const; - -private: - /** - * Storage for the matrix. - */ - const MATRIX &A; - /** - * Storage for preconditioner. - */ - const PRECOND &P; - /** - * Memory pool for vectors. - */ - VectorMemory &mem; -} DEAL_II_DEPRECATED; - - - /** * Preconditioning with a Chebyshev polynomial for symmetric positive definite * matrices. This preconditioner is similar to a Jacobi preconditioner if the @@ -1344,102 +1197,6 @@ AdditionalData (const double relaxation) -////////////////////////////////////////////////////////////////////// - -template -PreconditionLACSolver -::PreconditionLACSolver () - : - solver(0), matrix(0), precondition(0) -{} - - -template -void -PreconditionLACSolver -::initialize (SOLVER &s, - const MATRIX &m, - const PRECONDITION &p) -{ - solver = &s; - matrix = &m; - precondition = &p; -} - - -template -template -void -PreconditionLACSolver::vmult (VECTOR &dst, - const VECTOR &src) const -{ - Assert (solver !=0 && matrix != 0 && precondition != 0, - ExcNotInitialized()); - - solver->solve(*matrix, dst, src, *precondition); -} - -////////////////////////////////////////////////////////////////////// - - -template -inline -PreconditionedMatrix -::PreconditionedMatrix (const MATRIX &A, - const PRECOND &P, - VectorMemory &mem): - A(A), P(P), mem(mem) -{} - - -template -inline void -PreconditionedMatrix -::vmult (VECTOR &dst, - const VECTOR &src) const -{ - VECTOR *h = mem.alloc(); - h->reinit(src); - A.vmult(*h, src); - P.vmult(dst, *h); - mem.free(h); -} - - - -template -inline void -PreconditionedMatrix -::Tvmult (VECTOR &dst, - const VECTOR &src) const -{ - VECTOR *h = mem.alloc(); - h->reinit(src); - A.Tvmult(*h, src); - P.Tvmult(dst, *h); - mem.free(h); -} - - - -template -inline double -PreconditionedMatrix -::residual (VECTOR &dst, - const VECTOR &src, - const VECTOR &rhs) const -{ - VECTOR *h = mem.alloc(); - h->reinit(src); - A.vmult(*h, src); - P.vmult(dst, *h); - mem.free(h); - dst.sadd(-1.,1.,rhs); - return dst.l2_norm (); -} - - - //--------------------------------------------------------------------------- namespace internal -- 2.39.5