From d96497473a6ea03fb867b36f8649e5c937b49590 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 17 Oct 2002 18:43:30 +0000 Subject: [PATCH] Add the anna_1 test. git-svn-id: https://svn.dealii.org/trunk@6678 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fe/Makefile | 3 +- tests/fe/anna_1.cc | 156 ++++++++++++++++++++++++++++++++++++++++ tests/fe/anna_1.checked | 44 ++++++++++++ 3 files changed, 202 insertions(+), 1 deletion(-) create mode 100644 tests/fe/anna_1.cc create mode 100644 tests/fe/anna_1.checked diff --git a/tests/fe/Makefile b/tests/fe/Makefile index 24b1ce1d59..a063e4ed29 100644 --- a/tests/fe/Makefile +++ b/tests/fe/Makefile @@ -39,12 +39,13 @@ numbering.exe : numbering.go $(libraries) 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) 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 + nedelec nedelec_2 nedelec_3 up_and_down anna_1 ############################################################ diff --git a/tests/fe/anna_1.cc b/tests/fe/anna_1.cc new file mode 100644 index 0000000000..add6218588 --- /dev/null +++ b/tests/fe/anna_1.cc @@ -0,0 +1,156 @@ +//---------------------------- 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 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 + + +class SystemTest +{ + public: + SystemTest (); + void run (); + + private: + void make_grid_and_dofs (); + void shape_to_components (); + void check_numbering (); + + + Triangulation<2> triangulation; + FESystem<2> fe; + DoFHandler<2> dof_handler; + + +}; + +SystemTest::SystemTest () : + fe (FE_Nedelec<2>(1), 2, + FE_Q<2>(1), 1), + dof_handler (triangulation) +{}; + + +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; + +}; + +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::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; iget_dof_indices (local_dof_indices); + for(unsigned int i=0; i