From: cazamias Date: Fri, 16 Nov 2012 23:18:54 +0000 (+0000) Subject: Fix solving for Trilinos X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6ea277f67a688d95fc23bc50b9e7bf5db1616c4;p=dealii-svn.git Fix solving for Trilinos git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@27555 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 3717d27588..5156a151e1 100644 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@ -622,6 +622,7 @@ 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 @@ -637,6 +638,24 @@ namespace Step40 pcout << " Solved in " << solver_control.last_step() << " iterations." << std::endl; +#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); + + + solver.solve (system_matrix, completely_distributed_solution, system_rhs, + preconditioner); + + pcout << " Solved in " << solver_control.last_step() + << " iterations." << std::endl; + #endif constraints.distribute (completely_distributed_solution);