From: Wolfgang Bangerth Date: Mon, 22 Jul 2013 02:46:30 +0000 (+0000) Subject: Fix disabling bug in hp::DoFHandler::n_boundary_dofs(). X-Git-Tag: v8.0.0~37 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffaddd49c8e4ed8bff5388143d818700eb87f47a;p=dealii.git Fix disabling bug in hp::DoFHandler::n_boundary_dofs(). git-svn-id: https://svn.dealii.org/trunk@30085 0785d39b-7218-0410-832d-ea1e28bc413d --- 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