From bf4fc6349232c5177ee5bd6ee4e27db8c5d37184 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 17 Oct 2002 19:59:45 +0000 Subject: [PATCH] As anna_1, but renumber in opposit direction. git-svn-id: https://svn.dealii.org/trunk@6684 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/Makefile | 3 +- tests/fe/anna_2.cc | 169 ++++++++++++++++++++++++++++++++++++++++ tests/fe/anna_2.checked | 147 ++++++++++++++++++++++++++++++++++ 3 files changed, 318 insertions(+), 1 deletion(-) create mode 100644 tests/fe/anna_2.cc create mode 100644 tests/fe/anna_2.checked diff --git a/tests/fe/Makefile b/tests/fe/Makefile index a063e4ed29..d6fcfbdb0b 100644 --- a/tests/fe/Makefile +++ b/tests/fe/Makefile @@ -40,12 +40,13 @@ shapes.exe : shapes.go $(libraries) transfer.exe : transfer.go $(libraries) up_and_down.exe : up_and_down.go $(libraries) anna_1.exe : anna_1.go $(libraries) +anna_2.exe : anna_2.go $(libraries) tests = derivatives fe_data_test fe_traits fe_tools_test mapping \ mapping_c1 shapes numbering mapping_q1_eulerian \ transfer internals \ non_primitive_1 non_primitive_2 \ - nedelec nedelec_2 nedelec_3 up_and_down anna_1 + nedelec nedelec_2 nedelec_3 up_and_down anna_1 anna_2 ############################################################ diff --git a/tests/fe/anna_2.cc b/tests/fe/anna_2.cc new file mode 100644 index 0000000000..c70b93a091 --- /dev/null +++ b/tests/fe/anna_2.cc @@ -0,0 +1,169 @@ +//---------------------------- non_primitive_1.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2002 by the deal.II authors and Anna Schneebeli +// +// 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. +// +//---------------------------- non_primitive_1.cc --------------------------- + + +// check some things about Nedelec elements, basically also that the +// DoFRenumbering::component_wise function also works for +// non_primitive elements, for which it did not work previously since +// there is no component to associate a non-primitive shape function +// with +// +// this program is similar to anna_1, except that it tests the +// component_wise function with a different order of components than +// the default is. +// +// this program is a modified version of one by Anna Schneebeli, +// University of Basel + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template +class SystemTest +{ + public: + SystemTest (); + void run (); + + private: + void make_grid_and_dofs (); + void shape_to_components (); + void check_numbering (); + + + Triangulation triangulation; + FESystem fe; + DoFHandler dof_handler; + + +}; + +template +SystemTest::SystemTest () : + fe (FE_Nedelec(1), 2, + FE_Q(1), 1), + dof_handler (triangulation) +{}; + + +template +void SystemTest::make_grid_and_dofs () +{ + + GridGenerator::hyper_cube (triangulation, -1, 1); + triangulation.refine_global (0); + deallog << "Number of active cells: " << triangulation.n_active_cells() + << std::endl; + deallog << "Total number of cells: " << triangulation.n_cells() + << std::endl; + + dof_handler.distribute_dofs (fe); + deallog << "Number of degrees of freedom: " << dof_handler.n_dofs() + << std::endl; + +}; + +template +void SystemTest::shape_to_components () +{ + // testing, if the shape function + // with index i is of type Nedelec: + // (i.e. the first component of the FESystem) + // 1 for yes, 0 for no. + + for(unsigned int i = 0; i +void SystemTest::check_numbering () +{ + DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), + endc = dof_handler.end(); + std::vector local_dof_indices(fe.dofs_per_cell); + + for (; cell!=endc; ++cell) + { + cell->get_dof_indices (local_dof_indices); + for (unsigned int i=0; i comp(fe.n_components()); + for (unsigned int i=0; iget_dof_indices (local_dof_indices); + for(unsigned int i=0; i +void SystemTest::run () +{ + make_grid_and_dofs (); + shape_to_components (); + check_numbering(); +}; + + + +int main () +{ + std::ofstream logfile("anna_2.output"); + deallog.attach(logfile); + deallog.depth_console(0); + + SystemTest<2>().run(); + SystemTest<3>().run(); + return 0; +}; diff --git a/tests/fe/anna_2.checked b/tests/fe/anna_2.checked new file mode 100644 index 0000000000..95cda6c7a0 --- /dev/null +++ b/tests/fe/anna_2.checked @@ -0,0 +1,147 @@ + +DEAL::Number of active cells: 1 +DEAL::Total number of cells: 1 +DEAL::Number of degrees of freedom: 12 +DEAL:: shapefunction 0 is Nedelec: false +DEAL:: shapefunction 1 is Nedelec: false +DEAL:: shapefunction 2 is Nedelec: false +DEAL:: shapefunction 3 is Nedelec: false +DEAL:: shapefunction 4 is Nedelec: true +DEAL:: shapefunction 5 is Nedelec: true +DEAL:: shapefunction 6 is Nedelec: true +DEAL:: shapefunction 7 is Nedelec: true +DEAL:: shapefunction 8 is Nedelec: true +DEAL:: shapefunction 9 is Nedelec: true +DEAL:: shapefunction 10 is Nedelec: true +DEAL:: shapefunction 11 is Nedelec: true +DEAL:: DoF 0 belongs to base element 1, instance 0 +DEAL:: DoF 1 belongs to base element 1, instance 0 +DEAL:: DoF 2 belongs to base element 1, instance 0 +DEAL:: DoF 3 belongs to base element 1, instance 0 +DEAL:: DoF 4 belongs to base element 0, instance 0 +DEAL:: DoF 5 belongs to base element 0, instance 1 +DEAL:: DoF 6 belongs to base element 0, instance 0 +DEAL:: DoF 7 belongs to base element 0, instance 1 +DEAL:: DoF 8 belongs to base element 0, instance 0 +DEAL:: DoF 9 belongs to base element 0, instance 1 +DEAL:: DoF 10 belongs to base element 0, instance 0 +DEAL:: DoF 11 belongs to base element 0, instance 1 +DEAL:: +DEAL:: Now we renumber the DoFs anti-component-wise: +DEAL:: ********************************************* +DEAL:: DoF 0 belongs to base 1, instance 0 +DEAL:: DoF 1 belongs to base 1, instance 0 +DEAL:: DoF 2 belongs to base 1, instance 0 +DEAL:: DoF 3 belongs to base 1, instance 0 +DEAL:: DoF 8 belongs to base 0, instance 0 +DEAL:: DoF 4 belongs to base 0, instance 1 +DEAL:: DoF 9 belongs to base 0, instance 0 +DEAL:: DoF 5 belongs to base 0, instance 1 +DEAL:: DoF 10 belongs to base 0, instance 0 +DEAL:: DoF 6 belongs to base 0, instance 1 +DEAL:: DoF 11 belongs to base 0, instance 0 +DEAL:: DoF 7 belongs to base 0, instance 1 +DEAL:: +DEAL::Number of active cells: 1 +DEAL::Total number of cells: 1 +DEAL::Number of degrees of freedom: 32 +DEAL:: shapefunction 0 is Nedelec: false +DEAL:: shapefunction 1 is Nedelec: false +DEAL:: shapefunction 2 is Nedelec: false +DEAL:: shapefunction 3 is Nedelec: false +DEAL:: shapefunction 4 is Nedelec: false +DEAL:: shapefunction 5 is Nedelec: false +DEAL:: shapefunction 6 is Nedelec: false +DEAL:: shapefunction 7 is Nedelec: false +DEAL:: shapefunction 8 is Nedelec: true +DEAL:: shapefunction 9 is Nedelec: true +DEAL:: shapefunction 10 is Nedelec: true +DEAL:: shapefunction 11 is Nedelec: true +DEAL:: shapefunction 12 is Nedelec: true +DEAL:: shapefunction 13 is Nedelec: true +DEAL:: shapefunction 14 is Nedelec: true +DEAL:: shapefunction 15 is Nedelec: true +DEAL:: shapefunction 16 is Nedelec: true +DEAL:: shapefunction 17 is Nedelec: true +DEAL:: shapefunction 18 is Nedelec: true +DEAL:: shapefunction 19 is Nedelec: true +DEAL:: shapefunction 20 is Nedelec: true +DEAL:: shapefunction 21 is Nedelec: true +DEAL:: shapefunction 22 is Nedelec: true +DEAL:: shapefunction 23 is Nedelec: true +DEAL:: shapefunction 24 is Nedelec: true +DEAL:: shapefunction 25 is Nedelec: true +DEAL:: shapefunction 26 is Nedelec: true +DEAL:: shapefunction 27 is Nedelec: true +DEAL:: shapefunction 28 is Nedelec: true +DEAL:: shapefunction 29 is Nedelec: true +DEAL:: shapefunction 30 is Nedelec: true +DEAL:: shapefunction 31 is Nedelec: true +DEAL:: DoF 0 belongs to base element 1, instance 0 +DEAL:: DoF 1 belongs to base element 1, instance 0 +DEAL:: DoF 2 belongs to base element 1, instance 0 +DEAL:: DoF 3 belongs to base element 1, instance 0 +DEAL:: DoF 4 belongs to base element 1, instance 0 +DEAL:: DoF 5 belongs to base element 1, instance 0 +DEAL:: DoF 6 belongs to base element 1, instance 0 +DEAL:: DoF 7 belongs to base element 1, instance 0 +DEAL:: DoF 8 belongs to base element 0, instance 0 +DEAL:: DoF 9 belongs to base element 0, instance 1 +DEAL:: DoF 10 belongs to base element 0, instance 0 +DEAL:: DoF 11 belongs to base element 0, instance 1 +DEAL:: DoF 12 belongs to base element 0, instance 0 +DEAL:: DoF 13 belongs to base element 0, instance 1 +DEAL:: DoF 14 belongs to base element 0, instance 0 +DEAL:: DoF 15 belongs to base element 0, instance 1 +DEAL:: DoF 16 belongs to base element 0, instance 0 +DEAL:: DoF 17 belongs to base element 0, instance 1 +DEAL:: DoF 18 belongs to base element 0, instance 0 +DEAL:: DoF 19 belongs to base element 0, instance 1 +DEAL:: DoF 20 belongs to base element 0, instance 0 +DEAL:: DoF 21 belongs to base element 0, instance 1 +DEAL:: DoF 22 belongs to base element 0, instance 0 +DEAL:: DoF 23 belongs to base element 0, instance 1 +DEAL:: DoF 24 belongs to base element 0, instance 0 +DEAL:: DoF 25 belongs to base element 0, instance 1 +DEAL:: DoF 26 belongs to base element 0, instance 0 +DEAL:: DoF 27 belongs to base element 0, instance 1 +DEAL:: DoF 28 belongs to base element 0, instance 0 +DEAL:: DoF 29 belongs to base element 0, instance 1 +DEAL:: DoF 30 belongs to base element 0, instance 0 +DEAL:: DoF 31 belongs to base element 0, instance 1 +DEAL:: +DEAL:: Now we renumber the DoFs anti-component-wise: +DEAL:: ********************************************* +DEAL:: DoF 0 belongs to base 1, instance 0 +DEAL:: DoF 1 belongs to base 1, instance 0 +DEAL:: DoF 2 belongs to base 1, instance 0 +DEAL:: DoF 3 belongs to base 1, instance 0 +DEAL:: DoF 4 belongs to base 1, instance 0 +DEAL:: DoF 5 belongs to base 1, instance 0 +DEAL:: DoF 6 belongs to base 1, instance 0 +DEAL:: DoF 7 belongs to base 1, instance 0 +DEAL:: DoF 20 belongs to base 0, instance 0 +DEAL:: DoF 8 belongs to base 0, instance 1 +DEAL:: DoF 21 belongs to base 0, instance 0 +DEAL:: DoF 9 belongs to base 0, instance 1 +DEAL:: DoF 22 belongs to base 0, instance 0 +DEAL:: DoF 10 belongs to base 0, instance 1 +DEAL:: DoF 23 belongs to base 0, instance 0 +DEAL:: DoF 11 belongs to base 0, instance 1 +DEAL:: DoF 24 belongs to base 0, instance 0 +DEAL:: DoF 12 belongs to base 0, instance 1 +DEAL:: DoF 25 belongs to base 0, instance 0 +DEAL:: DoF 13 belongs to base 0, instance 1 +DEAL:: DoF 26 belongs to base 0, instance 0 +DEAL:: DoF 14 belongs to base 0, instance 1 +DEAL:: DoF 27 belongs to base 0, instance 0 +DEAL:: DoF 15 belongs to base 0, instance 1 +DEAL:: DoF 28 belongs to base 0, instance 0 +DEAL:: DoF 16 belongs to base 0, instance 1 +DEAL:: DoF 29 belongs to base 0, instance 0 +DEAL:: DoF 17 belongs to base 0, instance 1 +DEAL:: DoF 30 belongs to base 0, instance 0 +DEAL:: DoF 18 belongs to base 0, instance 1 +DEAL:: DoF 31 belongs to base 0, instance 0 +DEAL:: DoF 19 belongs to base 0, instance 1 +DEAL:: -- 2.39.5