From: heister Date: Fri, 12 Jul 2013 18:58:21 +0000 (+0000) Subject: merge from mainline X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fbranch_unify_linear_algebra;p=dealii-svn.git merge from mainline git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29987 0785d39b-7218-0410-832d-ea1e28bc413d --- d13c59fcd14c055b78656e0b206a11d4b54cdf7f diff --cc deal.II/examples/step-40/step-40.cc index 2044b76578,15b0ce31e5..4a0faa59d0 --- a/deal.II/examples/step-40/step-40.cc +++ b/deal.II/examples/step-40/step-40.cc @@@ -18,21 -18,7 +18,21 @@@ // already be familiar friends: #include #include + #include + +#include + +#define USE_PETSC_LA + +namespace LA +{ +#ifdef USE_PETSC_LA + using namespace dealii::LinearAlgebraPETSc; +#else + using namespace dealii::LinearAlgebraTrilinos; +#endif +} + - #include #include #include @@@ -148,23 -134,24 +148,24 @@@ namespace Step4 void refine_grid (); void output_results (const unsigned int cycle) const; - MPI_Comm mpi_communicator; + MPI_Comm mpi_communicator; - parallel::distributed::Triangulation triangulation; + parallel::distributed::Triangulation triangulation; - DoFHandler dof_handler; - FE_Q fe; + DoFHandler dof_handler; + FE_Q fe; - IndexSet locally_owned_dofs; - IndexSet locally_relevant_dofs; + IndexSet locally_owned_dofs; + IndexSet locally_relevant_dofs; - ConstraintMatrix constraints; + ConstraintMatrix constraints; - PETScWrappers::MPI::SparseMatrix system_matrix; - PETScWrappers::MPI::Vector locally_relevant_solution; - PETScWrappers::MPI::Vector system_rhs; + LA::MPI::SparseMatrix system_matrix; + LA::MPI::Vector locally_relevant_solution; + LA::MPI::Vector system_rhs; - ConditionalOStream pcout; + ConditionalOStream pcout; + TimerOutput computing_timer; }; @@@ -439,8 -437,11 +447,9 @@@ template void LaplaceProblem::solve () { + TimerOutput::Scope t(computing_timer, "solve"); - PETScWrappers::MPI::Vector - completely_distributed_solution (mpi_communicator, - dof_handler.n_dofs(), - dof_handler.n_locally_owned_dofs()); + LA::MPI::Vector + completely_distributed_solution (locally_owned_dofs, mpi_communicator); SolverControl solver_control (dof_handler.n_dofs(), 1e-12);