--- /dev/null
+// ---------------------------------------------------------------------
+// $Id$
+//
+// Copyright (C) 2008 - 2013 by the deal.II authors
+//
+// This file is part of the deal.II library.
+//
+// The deal.II library is free software; you can use it, redistribute
+// it, and/or modify it under the terms of the GNU Lesser General
+// Public License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+// The full text of the license can be found in the file LICENSE at
+// the top level of the deal.II distribution.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Check the consistency of the number cache of DoFHandler for a sequential
+// object. Like deal.II/n_boundary_dofs but for an hp object
+
+
+#include "../tests.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/intergrid_map.h>
+#include <deal.II/base/utilities.h>
+#include <deal.II/hp/dof_handler.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_dgq.h>
+#include <deal.II/hp/fe_collection.h>
+
+#include <fstream>
+#include <cstdlib>
+
+
+template<int dim>
+void test()
+{
+ Triangulation<dim> triangulation;
+ GridGenerator::hyper_cube(triangulation);
+ triangulation.refine_global (1);
+
+ hp::FECollection<dim> fe;
+ for (unsigned int i=1; i<=GeometryInfo<dim>::max_children_per_cell; ++i)
+ fe.push_back (FE_Q<dim>(i));
+
+ hp::DoFHandler<dim> dof_handler (triangulation);
+
+ unsigned int index=0;
+ for (typename hp::DoFHandler<dim>::active_cell_iterator
+ cell = dof_handler.begin_active();
+ cell != dof_handler.end(); ++cell, ++index)
+ cell->set_active_fe_index (index);
+
+ dof_handler.distribute_dofs (fe);
+
+ const unsigned int N = dof_handler.n_boundary_dofs();
+ deallog << N << std::endl;
+}
+
+
+int main()
+{
+ std::ofstream logfile("n_boundary_dofs/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ deallog.push("1d");
+ test<1>();
+ deallog.pop();
+
+ deallog.push("2d");
+ test<2>();
+ deallog.pop();
+
+ deallog.push("3d");
+ test<3>();
+ deallog.pop();
+}