From c4d33d28210026bf8d8ccb39fc92eb32cd4d1847 Mon Sep 17 00:00:00 2001 From: bangerth Date: Wed, 23 Feb 2011 15:35:13 +0000 Subject: [PATCH] Augment documentation. Other simple mods. git-svn-id: https://svn.dealii.org/trunk@23433 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/fail/fe_nothing_07.cc | 82 ++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 25 deletions(-) diff --git a/tests/fail/fe_nothing_07.cc b/tests/fail/fe_nothing_07.cc index 5b6cf87162..326f54e6c5 100644 --- a/tests/fail/fe_nothing_07.cc +++ b/tests/fail/fe_nothing_07.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2009 by the deal.II authors +// Copyright (C) 2009, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -14,6 +14,37 @@ // test that FE_Nothing works as intended +// Create a mesh with hanging nodes and FEQ/FENothing interfaces in +// several admissible configurations we'd like to check. In 2D the +// mesh looks like the following. +// +// +---------+----+----+ +// | | 0 | 0 | +// | 1 +----+----+ +// | | 0 | 0 | +// +----+----+----+----+ +// | 1 | 1 | | +// +----+----+ 0 | +// | 1 | 1 | | +// +----+----+---------+ +// +// We then attempt to make hanging node constraints on this mesh. + +// Note: in 2d, DoF assignment should look like this: +// +// 6--------7+19--20---21 +// | | 0 | 0 | +// | 1 16---17---18 +// | | 0 | 0 | +// 4---14*--5+2--15*---3 +// | 1 | 1 | | +// 10---11-13+ 0 | +// | 1 | 1 | | +// 8----9--12+0--------1 +// +// Dofs 14 and 15 should be constrained, but at one time only 14 was +// constrained + #include "../tests.h" #include @@ -38,25 +69,6 @@ #include - // Create a mesh with hanging - // nodes and FEQ/FENothing interfaces - // in several admissible configurations - // we'd like to check. In 2D the mesh - // looks like the following. - // - // +---------+----+----+ - // | | 1 | 1 | - // | 0 +----+----+ - // | | 1 | 1 | - // +----+----+----+----+ - // | 0 | 0 | | - // +----+----+ 1 | - // | 0 | 0 | | - // +----+----+---------+ - // - // We then attempt to make hanging node - // constraints on this mesh. - template void test () { @@ -102,10 +114,6 @@ void test () hp::DoFHandler dof_handler (triangulation); - // loop over cells, and set cells - // within a circle to be of type - // FE_Nothing, while outside the - // circle to be of type FE_Q(1) { typename hp::DoFHandler::active_cell_iterator cell = dof_handler.begin_active(), @@ -122,7 +130,6 @@ void test () dof_handler.distribute_dofs (fe_collection); } - deallog << " Number of active cells: " << triangulation.n_active_cells() << std::endl @@ -143,6 +150,31 @@ void test () << constraints.n_constraints() << std::endl; + // the FE assignment is entirely + // symmetric, so the number of + // constraints must be even + Assert (constraints.n_constraints() % 2 == 0, ExcInternalError()); + + { + typename hp::DoFHandler::active_cell_iterator + cell = dof_handler.begin_active(), + endc = dof_handler.end(); + + for(; cell != endc; cell++) + { + deallog << cell << ' ' << cell->active_fe_index() << std::endl + << " "; + std::vector local_dof_indices (cell->get_fe().dofs_per_cell); + cell->get_dof_indices (local_dof_indices); + + for (unsigned int i=0; iget_fe().dofs_per_cell; ++i) + deallog << local_dof_indices[i] + << (constraints.is_constrained(local_dof_indices[i]) ? + "*" : "") + << ' '; + deallog << std::endl; + } + } } -- 2.39.5