From d38becaa81c758785612dbd65b932f8a27647c6c Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sun, 2 Jul 2017 12:20:13 -0500 Subject: [PATCH] Port arpack/step-36_parpack_mf to use inverse_operator --- tests/arpack/step-36_parpack_mf.cc | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/arpack/step-36_parpack_mf.cc b/tests/arpack/step-36_parpack_mf.cc index 3405ee3e8b..031cdca388 100644 --- a/tests/arpack/step-36_parpack_mf.cc +++ b/tests/arpack/step-36_parpack_mf.cc @@ -36,7 +36,7 @@ #include #include #include -#include +#include #include #include @@ -121,25 +121,26 @@ void test () SolverControl solver_control (dof_handler.n_dofs(), 1e-9,/*log_history*/false,/*log_results*/false); SolverControl solver_control_lin (dof_handler.n_dofs(), 1e-10,/*log_history*/false,/*log_results*/false); + // set up iterative inverse + static ReductionControl inner_control_c(dof_handler.n_dofs(), 0.0, 1.e-13); + typedef LinearAlgebra::distributed::Vector VectorType; + SolverCG solver_c(inner_control_c); PreconditionIdentity preconditioner; - IterativeInverse > shift_and_invert; - shift_and_invert.initialize(laplace,preconditioner); - shift_and_invert.solver.select("cg"); - static ReductionControl inner_control_c(dof_handler.n_dofs(), 0.0, 1.e-13); - shift_and_invert.solver.set_control(inner_control_c); + const auto shift_and_invert = + inverse_operator(linear_operator(laplace), + solver_c, + preconditioner); const unsigned int num_arnoldi_vectors = 2*eigenvalues.size() + 2; - PArpackSolver >::AdditionalData additional_data(num_arnoldi_vectors, PArpackSolver >::largest_magnitude, true); - PArpackSolver > eigensolver - (solver_control, - mpi_communicator, - additional_data); + PArpackSolver> eigensolver( + solver_control, mpi_communicator, additional_data); + eigensolver.reinit(eigenfunctions[0]); // make sure initial vector is orthogonal to the space due to constraints { -- 2.39.5