From: kanschat Date: Mon, 28 May 2007 05:18:02 +0000 (+0000) Subject: test index access and finer mesh X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=23f3b3ef8280744074441531047532b1b7900b2b;p=dealii-svn.git test index access and finer mesh git-svn-id: https://svn.dealii.org/trunk@14723 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/benchmarks/dof_handler_size.cc b/tests/benchmarks/dof_handler_size.cc index b772ffecdb..d80980c325 100644 --- a/tests/benchmarks/dof_handler_size.cc +++ b/tests/benchmarks/dof_handler_size.cc @@ -17,12 +17,27 @@ #include #include #include +#include #include #include #include using namespace dealii; +template +void indices (const DoFHandler& dof) +{ + typedef typename DoFHandler::active_cell_iterator I; + + std::vector dofs(dof.get_fe().dofs_per_cell); + const I end = dof.end(); + + for (I i=dof.begin_active(); i!=end;++i) + { + i->get_dof_indices(dofs); + } +} + template void check () @@ -30,7 +45,7 @@ void check () deallog << "Dimension " << dim << std::endl; Triangulation tr; GridGenerator::hyper_cube(tr); - tr.refine_global(18/dim); + tr.refine_global(21/dim); deallog << "Cells " << std::setw(12) << tr.n_cells() << " active " << std::setw(12) << tr.n_active_cells() @@ -50,12 +65,22 @@ void check () << " quotient " << (1./dof.n_dofs()*dof.memory_consumption()) << std::endl; + indices(dof); + deallog << "Index1" << std::endl; + indices(dof); + deallog << "Index2" << std::endl; + dof.distribute_dofs(q3); deallog << "Dofs Q3 " << std::setw(12) << dof.n_dofs() << " memory " << std::setw(12) << dof.memory_consumption() << " quotient " << (1./dof.n_dofs()*dof.memory_consumption()) << std::endl; + indices(dof); + deallog << "Index1" << std::endl; + indices(dof); + deallog << "Index2" << std::endl; + dof.distribute_dofs(sys1); deallog << "Dofs Sys1 " << std::setw(12) << dof.n_dofs() << " memory " << std::setw(12) << dof.memory_consumption() @@ -67,11 +92,17 @@ void check () << " memory " << std::setw(12) << dof.memory_consumption() << " quotient " << (1./dof.n_dofs()*dof.memory_consumption()) << std::endl; + + indices(dof); + deallog << "Index1" << std::endl; + indices(dof); + deallog << "Index2" << std::endl; } int main() { deallog.log_execution_time(true); + deallog.log_time_differences(true); check<2>(); check<3>(); }