From 6e33b6bd9be34b86254031b8fe4410a3b0b0a377 Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 22 Jul 2013 02:46:30 +0000 Subject: [PATCH] Fix disabling bug in hp::DoFHandler::n_boundary_dofs(). git-svn-id: https://svn.dealii.org/trunk@30085 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 6 ++ deal.II/source/hp/dof_handler.cc | 3 +- tests/hp/n_boundary_dofs.cc | 86 ++++++++++++++++++++++++++++ tests/hp/n_boundary_dofs/cmp/generic | 4 ++ 4 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 tests/hp/n_boundary_dofs.cc create mode 100644 tests/hp/n_boundary_dofs/cmp/generic diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 1ff6e2ef50..a47b3af016 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -164,6 +164,12 @@ this function.
    +
  1. Fixed: hp::DoFHandler::n_boundary_dofs() had a bug that always led +to a failed assertion. This is now fixed. +
    +(Wolfgang Bangerth, 2013/07/21) +
  2. +
  3. Fixed: VectorTools::project has an option to first project onto the boundary. However, the implementation of this option ignored the mapping that is provided to the function. This is now fixed. diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index c87c3f5dcb..0b4b865540 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -1955,7 +1955,8 @@ namespace hp const unsigned int dofs_per_face = cell->get_fe().dofs_per_face; dofs_on_face.resize (dofs_per_face); - cell->face(f)->get_dof_indices (dofs_on_face); + cell->face(f)->get_dof_indices (dofs_on_face, + cell->active_fe_index()); for (unsigned int i=0; i +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +template +void test() +{ + Triangulation triangulation; + GridGenerator::hyper_cube(triangulation); + triangulation.refine_global (1); + + hp::FECollection fe; + for (unsigned int i=1; i<=GeometryInfo::max_children_per_cell; ++i) + fe.push_back (FE_Q(i)); + + hp::DoFHandler dof_handler (triangulation); + + unsigned int index=0; + for (typename hp::DoFHandler::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(); +} diff --git a/tests/hp/n_boundary_dofs/cmp/generic b/tests/hp/n_boundary_dofs/cmp/generic new file mode 100644 index 0000000000..4c6e557e17 --- /dev/null +++ b/tests/hp/n_boundary_dofs/cmp/generic @@ -0,0 +1,4 @@ + +DEAL:1d::2 +DEAL:2d::20 +DEAL:3d::698 -- 2.39.5