From: Matthias Maier Date: Sun, 2 Jul 2017 17:37:19 +0000 (-0500) Subject: port arpack/tep-36_parpack_trilinos to inverse_operator X-Git-Tag: v9.0.0-rc1~1447^2~5 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3900f13973ca5576416a0157a5401b5e7b007737;p=dealii.git port arpack/tep-36_parpack_trilinos to inverse_operator --- diff --git a/tests/arpack/step-36_parpack_trilinos.cc b/tests/arpack/step-36_parpack_trilinos.cc index 9ca48e5973..47dce55743 100644 --- a/tests/arpack/step-36_parpack_trilinos.cc +++ b/tests/arpack/step-36_parpack_trilinos.cc @@ -38,7 +38,8 @@ #include #include -#include +#include +#include #include #include @@ -278,15 +279,20 @@ 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); - PArpackSolver::Shift shifted_matrix(stiffness_matrix,mass_matrix,shift); - TrilinosWrappers::PreconditionIdentity preconditioner; - IterativeInverse shift_and_invert; - shift_and_invert.initialize(shifted_matrix,preconditioner); - shift_and_invert.solver.select("cg"); static ReductionControl inner_control_c(/*maxiter*/stiffness_matrix.m(), /*tolerance (global)*/ 0.0, /*reduce (w.r.t. initial)*/ 1.e-13); - shift_and_invert.solver.set_control(inner_control_c); + + typedef TrilinosWrappers::MPI::Vector VectorType; + SolverCG solver_c(inner_control_c); + TrilinosWrappers::PreconditionIdentity preconditioner; + + const auto shifted_matrix = + linear_operator(stiffness_matrix) - + shift * linear_operator(mass_matrix); + + const auto shift_and_invert = + inverse_operator(shifted_matrix, solver_c, preconditioner); const unsigned int num_arnoldi_vectors = 2*eigenvalues.size() + 2;