From: kanschat Date: Tue, 29 May 2007 18:44:02 +0000 (+0000) Subject: check systems X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=460a20abb2009482b01f350cf3eb62c8b895c248;p=dealii-svn.git check systems git-svn-id: https://svn.dealii.org/trunk@14728 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/benchmarks/dof_handler_timing.cc b/tests/benchmarks/dof_handler_timing.cc index c112768e9d..398b91b9bf 100644 --- a/tests/benchmarks/dof_handler_timing.cc +++ b/tests/benchmarks/dof_handler_timing.cc @@ -37,14 +37,14 @@ using namespace dealii; template -void indices (const DoFHandler& dof) +void indices (const DoFHandler& dof, unsigned int repeat) { typedef typename DoFHandler::active_cell_iterator I; std::vector dofs(dof.get_fe().dofs_per_cell); const I end = dof.end(); - for (unsigned int k=0;k<10;++k) + for (unsigned int k=0;kget_dof_indices(dofs); } @@ -67,7 +67,37 @@ void fevalues (const DoFHandler& dof, template -void check () +void check_mapping (const DoFHandler& dof) +{ + fevalues(dof, update_q_points); + deallog << "qpoints" << std::endl; + fevalues(dof, update_JxW_values); + deallog << "JxW" << std::endl; + fevalues(dof, update_q_points | update_JxW_values); + deallog << "qpoints|JxW" << std::endl; +} + + +template +void check_values (const DoFHandler& dof) +{ + indices(dof, 100); + deallog << "Index*100" << std::endl; + fevalues(dof, update_values); + deallog << "values" << std::endl; + fevalues(dof, update_values | update_JxW_values); + deallog << "values|JxW" << std::endl; + fevalues(dof, update_values | update_gradients + | update_q_points | update_JxW_values); + deallog << "values|gradients|qpoints|JxW" << std::endl; + fevalues(dof, update_values | update_gradients | update_second_derivatives + | update_q_points | update_JxW_values); + deallog << "values|gradients|2nds|qpoints|JxW" << std::endl; +} + + +template +void check_q () { deallog << "Mesh" << std::endl; Triangulation tr; @@ -82,24 +112,37 @@ void check () DoFHandler dof(tr); dof.distribute_dofs(q); deallog << "Dofs " << dof.n_dofs() << std::endl; - indices(dof); - deallog << "Index" << std::endl; - fevalues(dof, update_q_points); - deallog << "qpoints" << std::endl; - fevalues(dof, update_JxW_values); - deallog << "JxW" << std::endl; - fevalues(dof, update_q_points | update_JxW_values); - deallog << "qpoints|JxW" << std::endl; - fevalues(dof, update_values); - deallog << "values" << std::endl; - fevalues(dof, update_values | update_JxW_values); - deallog << "values|JxW" << std::endl; - fevalues(dof, update_values | update_gradients - | update_q_points | update_JxW_values); - deallog << "values|gradients|qpoints|JxW" << std::endl; - fevalues(dof, update_values | update_gradients | update_second_derivatives - | update_q_points | update_JxW_values); - deallog << "values|gradients|2nds|qpoints|JxW" << std::endl; + + if (i==1) + check_mapping(dof); + check_values(dof); + deallog.pop(); + } +} + + +template +void check_sys () +{ + deallog << "Mesh" << std::endl; + Triangulation tr; + GridGenerator::hyper_cube(tr); + tr.refine_global(REF/dim); + + FE_Q q(1); + + for (unsigned int i=1;i<5;++i) + { + FESystem fe(q,1< dof(tr); + dof.distribute_dofs(fe); + deallog << "Dofs " << dof.n_dofs() << std::endl; + + if (i==1) + check_mapping(dof); + check_values(dof); deallog.pop(); } } @@ -109,7 +152,9 @@ int main() { deallog.log_execution_time(true); deallog.log_time_differences(true); - check<2>(); - check<3>(); + check_q<2>(); + check_sys<2>(); + check_q<3>(); + check_sys<3>(); }