From a407ea52efa211945b8f1073d854431a60e17ad7 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 29 Mar 2006 18:06:41 +0000 Subject: [PATCH] New test git-svn-id: https://svn.dealii.org/trunk@12756 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/Makefile | 3 +- tests/bits/get_dof_indices_01.cc | 90 ++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 tests/bits/get_dof_indices_01.cc diff --git a/tests/bits/Makefile b/tests/bits/Makefile index f8a973c8b0..53e7381099 100644 --- a/tests/bits/Makefile +++ b/tests/bits/Makefile @@ -72,7 +72,8 @@ tests_x = geometry_info_* \ get_fe_from_name \ christian_* \ oliver_* \ - accessor_equality* + accessor_equality* \ + get_dof_indices_* # tests for the hp branch: # fe_collection_* diff --git a/tests/bits/get_dof_indices_01.cc b/tests/bits/get_dof_indices_01.cc new file mode 100644 index 0000000000..9e1d72fa0c --- /dev/null +++ b/tests/bits/get_dof_indices_01.cc @@ -0,0 +1,90 @@ +//---------------------------- get_dof_indices_01.cc --------------------------- +// $Id$ +// Version: $Name$ +// +// Copyright (C) 2006 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. +// +//---------------------------- get_dof_indices_01.cc --------------------------- + + +// make sure we can call DoFCellAccessor::get_dof_indices also for +// inactive cells + +#include "../tests.h" +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + + + + + +template +void test () +{ + Triangulation triangulation; + DoFHandler dof_handler(triangulation); + + GridGenerator::hyper_cube (triangulation); + triangulation.refine_global (1); + + FE_Q fe(1); + dof_handler.distribute_dofs (fe); + + // loop over all cells, active or + // not + std::vector local_dof_indices (fe.dofs_per_cell); + for (typename DoFHandler::cell_iterator cell=dof_handler.begin(); + cell != dof_handler.end(); ++cell) + { + cell->get_dof_indices (local_dof_indices); + + deallog << "Cell = " << cell + << ", DoFs="; + for (unsigned int i=0; i::invalid_dof_index, + ExcInternalError()); + deallog << local_dof_indices[i] << ' '; + } + + deallog << std::endl; + } +} + + + +int main () +{ + std::ofstream logfile("get_dof_indices_01/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + test<1>(); + test<2>(); + test<3>(); + + return 0; +} + -- 2.39.5