From 8719ca80c97187d81e5fd62c72d68fbee3c94d17 Mon Sep 17 00:00:00 2001 From: heister Date: Wed, 5 Jun 2013 19:15:41 +0000 Subject: [PATCH] step-40: done git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29767 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-40/step-40.cc | 34 +++++++---------------------- 1 file changed, 8 insertions(+), 26 deletions(-) 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; -- 2.39.5