From d270fceb01e1f3b54fb7ea6760b31c97dadf08e0 Mon Sep 17 00:00:00 2001 From: goll Date: Wed, 6 Jul 2011 16:31:11 +0000 Subject: [PATCH] Rename test and add a new one that verifies FECollection objects with more than one element. git-svn-id: https://svn.dealii.org/trunk@23925 0785d39b-7218-0410-832d-ea1e28bc413d --- ...p.cc => count_dofs_per_component_hp_01.cc} | 2 +- .../cmp/generic | 0 tests/bits/count_dofs_per_component_hp_02.cc | 84 +++++++++++++++++++ .../cmp/generic | 10 +++ 4 files changed, 95 insertions(+), 1 deletion(-) rename tests/bits/{count_dofs_per_component_hp.cc => count_dofs_per_component_hp_01.cc} (97%) rename tests/bits/{count_dofs_per_component_hp => count_dofs_per_component_hp_01}/cmp/generic (100%) create mode 100644 tests/bits/count_dofs_per_component_hp_02.cc create mode 100644 tests/bits/count_dofs_per_component_hp_02/cmp/generic diff --git a/tests/bits/count_dofs_per_component_hp.cc b/tests/bits/count_dofs_per_component_hp_01.cc similarity index 97% rename from tests/bits/count_dofs_per_component_hp.cc rename to tests/bits/count_dofs_per_component_hp_01.cc index 184f1397ec..53d93b2487 100644 --- a/tests/bits/count_dofs_per_component_hp.cc +++ b/tests/bits/count_dofs_per_component_hp_01.cc @@ -71,7 +71,7 @@ void test () int main () { - std::ofstream logfile("count_dofs_per_component_hp/output"); + std::ofstream logfile("count_dofs_per_component_hp_01/output"); deallog.attach(logfile); deallog.depth_console(0); deallog.threshold_double(1.e-10); diff --git a/tests/bits/count_dofs_per_component_hp/cmp/generic b/tests/bits/count_dofs_per_component_hp_01/cmp/generic similarity index 100% rename from tests/bits/count_dofs_per_component_hp/cmp/generic rename to tests/bits/count_dofs_per_component_hp_01/cmp/generic diff --git a/tests/bits/count_dofs_per_component_hp_02.cc b/tests/bits/count_dofs_per_component_hp_02.cc new file mode 100644 index 0000000000..00aab45536 --- /dev/null +++ b/tests/bits/count_dofs_per_component_hp_02.cc @@ -0,0 +1,84 @@ +//---------------------------------------------------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2003, 2004, 2005, 2009 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 "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// check +// DoFTools:: +// count_dofs_per_component (...); +// for the hp case +// +// in contrast to the _01 test also check that this works if the element +// collection has more than one element + + +using namespace std; + +template +void test () +{ + Triangulation triangulation; + GridGenerator::hyper_cube(triangulation); + triangulation.refine_global(2); + + //define DoFhandler and FEs + FE_Q u1(2); + FE_Q p1(1); + FESystem fe_system1(u1, 2, p1, 1); + FE_Q u2(3); + FE_Q p2(2); + FESystem fe_system2(u2, 2, p2, 1); + + hp::FECollection fe_collection; + fe_collection.push_back(fe_system1); + fe_collection.push_back(fe_system2); + + hp::DoFHandler hp_dof_handler(triangulation); + hp_dof_handler.begin_active()->set_active_fe_index(1); + + //distribute dofs + hp_dof_handler.distribute_dofs(fe_collection); + + //count dofs per component and show them on the screen + std::vector dofs_per_component_hp(3,0); + DoFTools::count_dofs_per_component(hp_dof_handler, dofs_per_component_hp); + + for (unsigned int i=0; i<3; i++) + { + deallog <<"DoFs in the " < (); + test<2> (); + test<3> (); + return 0; +} diff --git a/tests/bits/count_dofs_per_component_hp_02/cmp/generic b/tests/bits/count_dofs_per_component_hp_02/cmp/generic new file mode 100644 index 0000000000..1698e0edcb --- /dev/null +++ b/tests/bits/count_dofs_per_component_hp_02/cmp/generic @@ -0,0 +1,10 @@ + +DEAL::DoFs in the 0. component for hp FE: 10 +DEAL::DoFs in the 1. component for hp FE: 10 +DEAL::DoFs in the 2. component for hp FE: 6 +DEAL::DoFs in the 0. component for hp FE: 90 +DEAL::DoFs in the 1. component for hp FE: 90 +DEAL::DoFs in the 2. component for hp FE: 30 +DEAL::DoFs in the 0. component for hp FE: 778 +DEAL::DoFs in the 1. component for hp FE: 778 +DEAL::DoFs in the 2. component for hp FE: 144 -- 2.39.5