From: Daniel Arndt Date: Sun, 7 Jun 2020 03:15:52 +0000 (-0400) Subject: Remove MGCoarseGridLACIteration X-Git-Tag: v9.3.0-rc1~1430^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7a92781bb443c56c12696effa7fa0c35e3559b1f;p=dealii.git Remove MGCoarseGridLACIteration --- diff --git a/doc/news/changes/incompatibilities/20200612DanielArndt b/doc/news/changes/incompatibilities/20200612DanielArndt new file mode 100644 index 0000000000..84eb88328a --- /dev/null +++ b/doc/news/changes/incompatibilities/20200612DanielArndt @@ -0,0 +1,3 @@ +Removed: The deprecated class MGCoarseGridLACIteration has been removed. +
+(Daniel Arndt, 2020/06/12) diff --git a/include/deal.II/multigrid/mg_coarse.h b/include/deal.II/multigrid/mg_coarse.h index 5b9c0ac313..8095f24bc8 100644 --- a/include/deal.II/multigrid/mg_coarse.h +++ b/include/deal.II/multigrid/mg_coarse.h @@ -78,90 +78,6 @@ private: }; -/** - * Coarse grid solver using LAC iterative methods. This is a little wrapper, - * transforming a triplet of iterative solver, matrix and preconditioner into - * a coarse grid solver. - * - * The type of the matrix (i.e. the template parameter @p MatrixType) should - * be derived from @p Subscriptor to allow for the use of a smart pointer to - * it. - * - * @deprecated Use MGCoarseGridIterativeSolver instead. - */ -template > -class DEAL_II_DEPRECATED MGCoarseGridLACIteration - : public MGCoarseGridBase -{ -public: - /** - * Default constructor. - */ - MGCoarseGridLACIteration(); - - /** - * Constructor. Store solver, matrix and preconditioning method for later - * use. - */ - template - MGCoarseGridLACIteration(SolverType &, - const MatrixType &, - const PreconditionerType &); - - /** - * Destructor freeing the pointers. - */ - ~MGCoarseGridLACIteration(); - - /** - * Initialize new data. - */ - template - void - initialize(SolverType &, const MatrixType &, const PreconditionerType &); - - /** - * Clear all pointers. - */ - void - clear(); - - /** - * Implementation of the abstract function. Calls the solver method with - * matrix, vectors and preconditioner. - */ - void - operator()(const unsigned int level, - VectorType & dst, - const VectorType & src) const; - - /** - * Set the matrix. This gives the possibility to replace the matrix that - * was given to the constructor by a new matrix. - */ - template - void - set_matrix(const MatrixType &); - -private: - /** - * Reference to the solver. - */ - SmartPointer> - solver; - - /** - * LinearOperator wrapping a reference to the matrix. - */ - LinearOperator matrix; - - /** - * LinearOperator wrapping a reference to the preconditioner. - */ - LinearOperator precondition; -}; - - /** * Coarse grid multigrid operator for an iterative solver. @@ -368,93 +284,6 @@ MGCoarseGridApplySmoother::operator()(const unsigned int level, coarse_smooth->smooth(level, dst, src); } -/* ------------------ Functions for MGCoarseGridLACIteration ------------ */ - - -template -MGCoarseGridLACIteration::MGCoarseGridLACIteration() - : solver(0, typeid(*this).name()) - , matrix(0) - , precondition(0) -{} - - -template -template -MGCoarseGridLACIteration::MGCoarseGridLACIteration( - SolverType & s, - const MatrixType & m, - const PreconditionerType &p) - : solver(&s, typeid(*this).name()) -{ - // Workaround: Unfortunately, not every "m" object has a rich enough - // interface to populate reinit_(domain|range)_vector. Thus, supply an - // empty LinearOperator exemplar. - matrix = linear_operator(LinearOperator(), m); - precondition = linear_operator(matrix, p); -} - - -template -MGCoarseGridLACIteration::~MGCoarseGridLACIteration() -{ - clear(); -} - - -template -template -void -MGCoarseGridLACIteration::initialize( - SolverType & s, - const MatrixType & m, - const PreconditionerType &p) -{ - solver = &s; - // Workaround: Unfortunately, not every "m" object has a rich enough - // interface to populate reinit_(domain|range)_vector. Thus, supply an - // empty LinearOperator exemplar. - matrix = linear_operator(LinearOperator(), m); - precondition = linear_operator(matrix, p); -} - - -template -void -MGCoarseGridLACIteration::clear() -{ - solver = nullptr; - matrix = LinearOperator(); - precondition = LinearOperator(); -} - - -template -void -MGCoarseGridLACIteration:: -operator()(const unsigned int /* level */, - VectorType & dst, - const VectorType &src) const -{ - Assert(solver != nullptr, ExcNotInitialized()); - solver->solve(matrix, dst, src, precondition); -} - - -template -template -void -MGCoarseGridLACIteration::set_matrix( - const MatrixType &m) -{ - // Workaround: Unfortunately, not every "m" object has a rich enough - // interface to populate reinit_(domain|range)_vector. Thus, supply an - // empty LinearOperator exemplar. - matrix = linear_operator(LinearOperator(), m); -} - - - /* ------------------ Functions for MGCoarseGridIterativeSolver ------------ */ template coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef TrilinosWrappers::PreconditionJacobi Smoother; diff --git a/tests/mpi/multigrid_uniform.cc b/tests/mpi/multigrid_uniform.cc index 85930faed0..ccd1e44190 100644 --- a/tests/mpi/multigrid_uniform.cc +++ b/tests/mpi/multigrid_uniform.cc @@ -396,7 +396,10 @@ namespace Step50 SolverControl coarse_solver_control(1000, 1e-10, false, false); SolverGMRES coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef TrilinosWrappers::PreconditionJacobi Smoother; diff --git a/tests/mpi/step-39-block.cc b/tests/mpi/step-39-block.cc index c48f5cf093..5f1773aec6 100644 --- a/tests/mpi/step-39-block.cc +++ b/tests/mpi/step-39-block.cc @@ -635,8 +635,10 @@ namespace Step39 coarse_solver_control); PreconditionIdentity identity; TrilinosWrappers::SparseMatrix &coarse_matrix = mg_matrix[0]; - MGCoarseGridLACIteration, - TrilinosWrappers::MPI::Vector> + MGCoarseGridIterativeSolver, + TrilinosWrappers::SparseMatrix, + PreconditionIdentity> coarse_grid_solver(coarse_solver, coarse_matrix, identity); typedef RelaxationBlockJacobi, - TrilinosWrappers::MPI::Vector> + MGCoarseGridIterativeSolver, + TrilinosWrappers::SparseMatrix, + PreconditionIdentity> coarse_grid_solver(coarse_solver, coarse_matrix, identity); typedef TrilinosWrappers::PreconditionJacobi Smoother; diff --git a/tests/multigrid/step-16-04.cc b/tests/multigrid/step-16-04.cc index 22df24bf8d..9a2f1dad7b 100644 --- a/tests/multigrid/step-16-04.cc +++ b/tests/multigrid/step-16-04.cc @@ -380,8 +380,11 @@ LaplaceProblem::solve() SolverCG> coarse_solver( coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration>, - LinearAlgebra::distributed::Vector> + MGCoarseGridIterativeSolver< + LinearAlgebra::distributed::Vector, + SolverCG>, + SparseMatrix, + PreconditionIdentity> coarse_grid_solver(coarse_solver, mg_matrices[min_level], id); deallog << " Size of coarse grid matrix: " << mg_matrices[min_level].m() << std::endl; diff --git a/tests/multigrid/step-16-05.cc b/tests/multigrid/step-16-05.cc index e3b81fa9a0..33d64c13c4 100644 --- a/tests/multigrid/step-16-05.cc +++ b/tests/multigrid/step-16-05.cc @@ -381,8 +381,11 @@ LaplaceProblem::solve() SolverCG> coarse_solver( coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration>, - LinearAlgebra::distributed::Vector> + MGCoarseGridIterativeSolver< + LinearAlgebra::distributed::Vector, + SolverCG>, + SparseMatrix, + PreconditionIdentity> coarse_grid_solver(coarse_solver, mg_matrices[min_level], id); deallog << " Size of coarse grid matrix: " << mg_matrices[min_level].m() << std::endl; diff --git a/tests/multigrid/step-16-06.cc b/tests/multigrid/step-16-06.cc index 3b485bcc46..a9813fdf51 100644 --- a/tests/multigrid/step-16-06.cc +++ b/tests/multigrid/step-16-06.cc @@ -381,8 +381,11 @@ LaplaceProblem::solve() SolverCG> coarse_solver( coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration>, - LinearAlgebra::distributed::Vector> + MGCoarseGridIterativeSolver< + LinearAlgebra::distributed::Vector, + SolverCG>, + SparseMatrix, + PreconditionIdentity> coarse_grid_solver(coarse_solver, mg_matrices[min_level], id); deallog << " Size of coarse grid matrix: " << mg_matrices[min_level].m() << std::endl; diff --git a/tests/multigrid/step-16-50-mpi-linear-operator.cc b/tests/multigrid/step-16-50-mpi-linear-operator.cc index 9c78b5efff..8b06521f60 100644 --- a/tests/multigrid/step-16-50-mpi-linear-operator.cc +++ b/tests/multigrid/step-16-50-mpi-linear-operator.cc @@ -442,8 +442,11 @@ namespace Step50 SolverControl coarse_solver_control(1000, 1e-10, false, false); SolverCG coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> coarse_grid_solver( - coarse_solver, coarse_matrix, id); + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> + coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef LA::MPI::PreconditionJacobi Smoother; MGSmootherPrecondition mg_smoother; diff --git a/tests/multigrid/step-16-50-mpi-smoother.cc b/tests/multigrid/step-16-50-mpi-smoother.cc index d13e0240e9..4e6fe6a3c3 100644 --- a/tests/multigrid/step-16-50-mpi-smoother.cc +++ b/tests/multigrid/step-16-50-mpi-smoother.cc @@ -16,7 +16,7 @@ // Same as step-16-50, but use Jacobi smoother at the coarsest grid via // MGCoarseGridApplySmoother. In this particular case, the number of iterations -// until convergence is exactly the same as for MGCoarseGridLACIteration. +// until convergence is exactly the same as for MGCoarseGridIterativeSolver. #include #include diff --git a/tests/multigrid/step-16-50-mpi.cc b/tests/multigrid/step-16-50-mpi.cc index 14c0d02d77..d6ed95de0f 100644 --- a/tests/multigrid/step-16-50-mpi.cc +++ b/tests/multigrid/step-16-50-mpi.cc @@ -442,8 +442,11 @@ namespace Step50 SolverControl coarse_solver_control(1000, 1e-10, false, false); SolverCG coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> coarse_grid_solver( - coarse_solver, coarse_matrix, id); + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> + coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef LA::MPI::PreconditionJacobi Smoother; MGSmootherPrecondition mg_smoother; diff --git a/tests/multigrid/step-16-50-serial.cc b/tests/multigrid/step-16-50-serial.cc index 5fc76f023c..6e7b0a4f3b 100644 --- a/tests/multigrid/step-16-50-serial.cc +++ b/tests/multigrid/step-16-50-serial.cc @@ -375,8 +375,11 @@ LaplaceProblem::solve() SolverControl coarse_solver_control(1000, 1e-10, false, false); SolverCG coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> coarse_grid_solver( - coarse_solver, coarse_matrix, id); + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> + coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef PreconditionJacobi Smoother; MGSmootherPrecondition mg_smoother; diff --git a/tests/multigrid/step-50_01.cc b/tests/multigrid/step-50_01.cc index df241c12de..a7493242b5 100644 --- a/tests/multigrid/step-50_01.cc +++ b/tests/multigrid/step-50_01.cc @@ -443,8 +443,11 @@ namespace Step50 SolverControl coarse_solver_control(1000, 1e-10, false, false); SolverCG coarse_solver(coarse_solver_control); PreconditionIdentity id; - MGCoarseGridLACIteration, vector_t> coarse_grid_solver( - coarse_solver, coarse_matrix, id); + MGCoarseGridIterativeSolver, + matrix_t, + PreconditionIdentity> + coarse_grid_solver(coarse_solver, coarse_matrix, id); typedef LA::MPI::PreconditionJacobi Smoother; MGSmootherPrecondition mg_smoother;