From 7dbdbc9ddd65accbe401229c06e2492b64f4f7aa Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 22 Jun 2001 10:35:28 +0000 Subject: [PATCH] Implement previously unimplemented function and fix bug by that way. git-svn-id: https://svn.dealii.org/trunk@4748 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/dofs/dof_handler.cc | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index f263da4fa8..222b8a10ea 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1144,27 +1144,43 @@ template <> unsigned int DoFHandler<1>::n_boundary_dofs () const { Assert (selected_fe != 0, ExcNoFESelected()); - Assert (false, ExcNotImplemented()); - return 0; + return 2*selected_fe->dofs_per_vertex; }; template <> -unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &) const +unsigned int DoFHandler<1>::n_boundary_dofs (const FunctionMap &boundary_indicators) const { Assert (selected_fe != 0, ExcNoFESelected()); - return 2*selected_fe->dofs_per_vertex; + + // check that only boundary + // indicators 0 and 1 are allowed + // in 1d + for (FunctionMap::const_iterator i=boundary_indicators.begin(); + i!=boundary_indicators.end(); ++i) + Assert ((i->first == 0) || (i->first == 1), + ExcInvalidBoundaryIndicator()); + + return boundary_indicators.size()*selected_fe->dofs_per_vertex; }; template <> -unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &) const +unsigned int DoFHandler<1>::n_boundary_dofs (const std::set &boundary_indicators) const { Assert (selected_fe != 0, ExcNoFESelected()); - Assert (false, ExcNotImplemented()); - return 0; + + // check that only boundary + // indicators 0 and 1 are allowed + // in 1d + for (std::set::const_iterator i=boundary_indicators.begin(); + i!=boundary_indicators.end(); ++i) + Assert ((*i == 0) || (*i == 1), + ExcInvalidBoundaryIndicator()); + + return boundary_indicators.size()*selected_fe->dofs_per_vertex; }; #endif -- 2.39.5