]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
step-40: done
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Jun 2013 19:15:41 +0000 (19:15 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 5 Jun 2013 19:15:41 +0000 (19:15 +0000)
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

index 3ddbfbdb1f8876c6104c34946c24c0f2d8c54963..2044b7657807c29fb0ac2181505208b683bced21 100644 (file)
@@ -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;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.