From: kanschat Date: Thu, 31 May 2007 18:07:22 +0000 (+0000) Subject: BIG test for refinement and dof handler setup X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=de2923317422fa7a153b72c96cfa81a01b7bcf94;p=dealii-svn.git BIG test for refinement and dof handler setup git-svn-id: https://svn.dealii.org/trunk@14738 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/benchmarks/dof_handler_size.cc b/tests/benchmarks/dof_handler_size.cc index 50bccecd3a..4d5d106029 100644 --- a/tests/benchmarks/dof_handler_size.cc +++ b/tests/benchmarks/dof_handler_size.cc @@ -12,6 +12,7 @@ //---------------------------------------------------------------------- #include +#include #include #include @@ -103,6 +104,8 @@ void check (bool local) int main() { + std::ofstream out("dof_handler_size/output"); + deallog.attach(out); deallog.push("local"); check<2>(true); check<3>(true); diff --git a/tests/benchmarks/dof_handler_timing_01.cc b/tests/benchmarks/dof_handler_timing_01.cc new file mode 100644 index 0000000000..713efbf46c --- /dev/null +++ b/tests/benchmarks/dof_handler_timing_01.cc @@ -0,0 +1,106 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2007 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//---------------------------------------------------------------------- + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace dealii; + + +// Fill dof handlers for different elements and see how large they get. +template +void check_dofs(DOF& dof, unsigned int repeat) +{ + FE_Q q1(1); + + deallog << "Start" << std::endl; + for (unsigned int i=1;i<6;++i) + { + FE_Q fe(i); + for (unsigned int i=0;i fe(q1, 1 << i); + for (unsigned int i=0;i +void check (bool local) +{ + deallog << "Dimension " << dim << std::endl; + Triangulation tr(Triangulation::maximum_smoothing); + GridGenerator::hyper_cube(tr); + + if (local) + for (unsigned int i=0;i<1800/dim;++i) + { + tr.last_active()->set_refine_flag(); + tr.execute_coarsening_and_refinement(); + } + else + tr.refine_global(21/dim); + + deallog << "Levels " << tr.n_levels() << " Cells "<< tr.n_cells() + << std::endl + << " active " << tr.n_active_cells() + << " memory " << tr.memory_consumption()/1.e6 + << std::endl; + + deallog.push("DoF"); + DoFHandler dof(tr); + check_dofs(dof, (local ? 10 : 1)); + deallog.pop(); + deallog.push("MGDoF"); + MGDoFHandler mgdof(tr); + check_dofs(mgdof, (local ? 10 : 1)); + deallog.pop(); +} + +int main() +{ + std::ofstream out("dof_handler_timing_01/output"); + deallog.log_execution_time(true); + deallog.log_time_differences(true); + deallog.attach(out); + deallog.push("local"); + check<2>(true); + check<3>(true); + deallog.pop(); + deallog.push("global"); + check<2>(false); + check<3>(false); + deallog.pop(); +} +