]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
merge from mainline branch_unify_linear_algebra
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Jul 2013 18:58:21 +0000 (18:58 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 12 Jul 2013 18:58:21 +0000 (18:58 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_unify_linear_algebra@29987 0785d39b-7218-0410-832d-ea1e28bc413d

1  2 
deal.II/examples/step-40/step-40.cc

index 2044b7657807c29fb0ac2181505208b683bced21,15b0ce31e5f85e58c9e10c365d9c8bf7f7c9162f..4a0faa59d085e870458e8240a2a9f710217aa26f
  // already be familiar friends:
  #include <deal.II/base/quadrature_lib.h>
  #include <deal.II/base/function.h>
+ #include <deal.II/base/timer.h>
 +
 +#include <deal.II/lac/generic_linear_algebra.h>
 +
 +#define USE_PETSC_LA
 +
 +namespace LA
 +{
 +#ifdef USE_PETSC_LA
 +  using namespace dealii::LinearAlgebraPETSc;
 +#else
 +  using namespace dealii::LinearAlgebraTrilinos;
 +#endif
 +}
 +
  #include <deal.II/lac/vector.h>
  #include <deal.II/lac/full_matrix.h>
  #include <deal.II/lac/solver_cg.h>
@@@ -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<dim>   triangulation;
+     parallel::distributed::Triangulation<dim> triangulation;
  
-     DoFHandler<dim>      dof_handler;
-     FE_Q<dim>            fe;
+     DoFHandler<dim>                           dof_handler;
+     FE_Q<dim>                                 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;
    };
  
  
    template <int dim>
    void LaplaceProblem<dim>::solve ()
    {
 -    PETScWrappers::MPI::Vector
 -    completely_distributed_solution (mpi_communicator,
 -                                     dof_handler.n_dofs(),
 -                                     dof_handler.n_locally_owned_dofs());
+     TimerOutput::Scope t(computing_timer, "solve");
 +    LA::MPI::Vector
 +    completely_distributed_solution (locally_owned_dofs, mpi_communicator);
  
      SolverControl solver_control (dof_handler.n_dofs(), 1e-12);
  

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.