From: Wolfgang Bangerth Date: Fri, 22 Jun 2001 10:35:28 +0000 (+0000) Subject: Implement previously unimplemented function and fix bug by that way. X-Git-Tag: v8.0.0~19046 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dbdbc9ddd65accbe401229c06e2492b64f4f7aa;p=dealii.git Implement previously unimplemented function and fix bug by that way. git-svn-id: https://svn.dealii.org/trunk@4748 0785d39b-7218-0410-832d-ea1e28bc413d --- 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