From 3269e97ca1615c417d1e59928ab3c57477e020d9 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 5 Mar 2007 17:27:34 +0000 Subject: [PATCH] Add some timers to produce numbers for the paper. git-svn-id: https://svn.dealii.org/trunk@14520 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/examples/step-27/step-27.cc | 31 ++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/deal.II/examples/step-27/step-27.cc b/deal.II/examples/step-27/step-27.cc index 75d5f751ce..906d45f951 100644 --- a/deal.II/examples/step-27/step-27.cc +++ b/deal.II/examples/step-27/step-27.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -86,6 +87,8 @@ class LaplaceProblem Vector solution; Vector system_rhs; + + Timer distr, condense, hang; }; @@ -137,23 +140,33 @@ LaplaceProblem::~LaplaceProblem () template void LaplaceProblem::setup_system () { + distr.reset(); + distr.start(); dof_handler.distribute_dofs (fe_collection); - + distr.stop(); + sparsity_pattern.reinit (dof_handler.n_dofs(), dof_handler.n_dofs(), dof_handler.max_couplings_between_dofs()); DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); - + hang.stop(); + solution.reinit (dof_handler.n_dofs()); system_rhs.reinit (dof_handler.n_dofs()); hanging_node_constraints.clear (); + hang.reset(); + hang.start(); DoFTools::make_hanging_node_constraints (dof_handler, hanging_node_constraints); hanging_node_constraints.close (); - + hang.stop(); + + condense.reset(); + condense.start(); hanging_node_constraints.condense (sparsity_pattern); + condense.stop(); sparsity_pattern.compress(); system_matrix.reinit (sparsity_pattern); @@ -216,8 +229,10 @@ void LaplaceProblem::assemble_system () } } + condense.start(); hanging_node_constraints.condense (system_matrix); hanging_node_constraints.condense (system_rhs); + condense.stop(); std::map boundary_values; VectorTools::interpolate_boundary_values (dof_handler, 0, @@ -606,6 +621,8 @@ void LaplaceProblem::run () << triangulation.n_active_cells() << std::endl; + Timer all; + all.start(); setup_system (); std::cout << " Number of degrees of freedom: " @@ -617,6 +634,14 @@ void LaplaceProblem::run () assemble_system (); solve (); + all.stop(); + + std::cout << " All: " << all() + << ", distr: " << distr() + << ", hang: " << hang() + << ", condense: " << condense() + << std::endl; + output_results (cycle); } } -- 2.39.5