From: Timo Heister Date: Wed, 5 Jun 2013 19:15:41 +0000 (+0000) Subject: step-40: done X-Git-Tag: v8.0.0~120^2~44 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e705b55310712ee87ff7bab8b25044328ebcd3d0;p=dealii.git step-40: done git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29767 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/examples/step-40/step-40.cc b/deal.II/examples/step-40/step-40.cc index 3ddbfbdb1f..2044b76578 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -444,33 +444,17 @@ namespace Step40 SolverControl solver_control (dof_handler.n_dofs(), 1e-12); -#ifdef USE_PETSC_LA - - PETScWrappers::SolverCG solver(solver_control, mpi_communicator); - - // Ask for a symmetric preconditioner by setting the first parameter in - // AdditionalData to true. - LA::MPI::PreconditionAMG - preconditioner(system_matrix, - PETScWrappers::PreconditionBoomerAMG::AdditionalData(true)); - - solver.solve (system_matrix, completely_distributed_solution, system_rhs, - preconditioner); + LA::SolverCG solver(solver_control, mpi_communicator); + LA::MPI::PreconditionAMG preconditioner; - pcout << " Solved in " << solver_control.last_step() - << " iterations." << std::endl; + LA::MPI::PreconditionAMG::AdditionalData data; +#ifdef USE_PETSC_LA + data.symmetric_operator = true; #else - - TrilinosWrappers::SolverCG solver(solver_control); - - // Ask for a symmetric preconditioner by - // setting the first parameter in - // AdditionalData to true. - LA::MPI::PreconditionAMG - preconditioner; - preconditioner.initialize(system_matrix); - + //trilinos defaults are good +#endif + preconditioner.initialize(system_matrix, data); solver.solve (system_matrix, completely_distributed_solution, system_rhs, preconditioner); @@ -478,8 +462,6 @@ namespace Step40 pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; -#endif - constraints.distribute (completely_distributed_solution); locally_relevant_solution = completely_distributed_solution;