* Return the number of degrees of freedom located on those parts of the
* boundary which have a boundary indicator listed in the given set. The
* reason that a @p map rather than a @p set is used is the same as
- * described in the section on the @p make_boundary_sparsity_pattern
- * function.
+ * described in the documentation of that variant of
+ * DoFTools::make_boundary_sparsity_pattern() that takes a map.
+ * To this end, the type of the @p boundary_ids argument is the same
+ * as typename FunctionMap<spacedim,number>::type.
*
- * The type of boundary_ids equals typename FunctionMap<spacedim,number>::type .
+ * There is, however, another overload of this function that takes
+ * a @p set argument (see below).
*/
template <typename number>
types::global_dof_index
n_boundary_dofs (const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_ids) const;
/**
- * Same function, but with different data type of the argument, which is
- * here simply a list of the boundary indicators under consideration.
+ * Return the number of degrees of freedom located on those parts of the
+ * boundary which have a boundary indicator listed in the given set. The
*/
types::global_dof_index
n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const;
-/* -------------- declaration of explicit specializations ------------- */
-
#ifndef DOXYGEN
-template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs () const;
-template <> types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &) const;
-
-
/* ----------------------- Inline functions ---------------------------------- */
* Return the number of degrees of freedom located on those parts of the
* boundary which have a boundary indicator listed in the given set. The
* reason that a @p map rather than a @p set is used is the same as
- * described in the section on the @p make_boundary_sparsity_pattern
- * function.
+ * described in the documentation of that variant of
+ * DoFTools::make_boundary_sparsity_pattern() that takes a map.
+ * To this end, the type of the @p boundary_ids argument is the same
+ * as typename FunctionMap<spacedim,number>::type.
*
- * The type of @p boundary_ids equals typename FunctionMap<spacedim,number>::type.
+ * There is, however, another overload of this function that takes
+ * a @p set argument (see below).
*/
template <typename number>
types::global_dof_index
n_boundary_dofs (const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_ids) const;
/**
- * Same function, but with different data type of the argument, which is
- * here simply a list of the boundary indicators under consideration.
+ * Return the number of degrees of freedom located on those parts of the
+ * boundary which have a boundary indicator listed in the given set. The
*/
types::global_dof_index
n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const;
-template <>
-types::global_dof_index DoFHandler<1>::n_boundary_dofs () const
-{
- return 2*get_fe().dofs_per_vertex;
-}
-
-
-
-template <>
-template <typename number>
-types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::map<types::boundary_id, const Function<1,number>*> &boundary_ids) const
-{
- // check that only boundary
- // indicators 0 and 1 are allowed
- // in 1d
- for (typename std::map<types::boundary_id, const Function<1,number>*>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((i->first == 0) || (i->first == 1),
- ExcInvalidBoundaryIndicator());
-
- return boundary_ids.size()*get_fe().dofs_per_vertex;
-}
-
-
-
-template <>
-types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
-{
- // check that only boundary
- // indicators 0 and 1 are allowed
- // in 1d
- for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((*i == 0) || (*i == 1),
- ExcInvalidBoundaryIndicator());
-
- return boundary_ids.size()*get_fe().dofs_per_vertex;
-}
-
-
-template <>
-types::global_dof_index DoFHandler<1,2>::n_boundary_dofs () const
-{
- return 2*get_fe().dofs_per_vertex;
-}
-
-
-
-template <>
-template <typename number>
-types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::map<types::boundary_id, const Function<2,number>*> &boundary_ids) const
-{
- // check that only boundary
- // indicators 0 and 1 are allowed
- // in 1d
- for (typename std::map<types::boundary_id, const Function<2,number>*>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((i->first == 0) || (i->first == 1),
- ExcInvalidBoundaryIndicator());
-
- return boundary_ids.size()*get_fe().dofs_per_vertex;
-}
-
-
-
-template <>
-types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
-{
- // check that only boundary
- // indicators 0 and 1 are allowed
- // in 1d
- for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((*i == 0) || (*i == 1),
- ExcInvalidBoundaryIndicator());
-
- return boundary_ids.size()*get_fe().dofs_per_vertex;
-}
-
-
-
template <int dim, int spacedim>
types::global_dof_index DoFHandler<dim,spacedim>::n_boundary_dofs () const
{
//------------------------------------------------------------------
- template <>
- types::global_dof_index DoFHandler<1>::n_boundary_dofs () const
- {
- Assert (finite_elements != nullptr, ExcNoFESelected());
-
- DoFHandler<1,1>::cell_iterator cell;
- types::global_dof_index n = 0;
-
- // search left-most cell
- cell = this->begin_active();
- while (!cell->at_boundary(0))
- cell = cell->neighbor(0);
- n += cell->get_fe().dofs_per_vertex;
-
- // same with right-most cell
- cell = this->begin_active();
- while (!cell->at_boundary(1))
- cell = cell->neighbor(1);
- n += cell->get_fe().dofs_per_vertex;
-
- return n;
- }
-
-
-
- template <>
- template <typename number>
- types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::map<types::boundary_id, const Function<1,number>*> &boundary_ids) const
- {
- Assert (finite_elements != nullptr, ExcNoFESelected());
-
- // check that only boundary
- // indicators 0 and 1 are allowed
- // in 1d
- for (typename std::map<types::boundary_id, const Function<1,number>*>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((i->first == 0) || (i->first == 1),
- ExcInvalidBoundaryIndicator());
-
- DoFHandler<1,1>::active_cell_iterator cell;
- types::global_dof_index n = 0;
-
- // search left-most cell
- if (boundary_ids.find (0) != boundary_ids.end())
- {
- cell = this->begin_active();
- while (!cell->at_boundary(0))
- cell = cell->neighbor(0);
- n += cell->get_fe().dofs_per_vertex;
- }
-
- // same with right-most cell
- if (boundary_ids.find (1) != boundary_ids.end())
- {
- cell = this->begin_active();
- while (!cell->at_boundary(1))
- cell = cell->neighbor(1);
- n += cell->get_fe().dofs_per_vertex;
- }
-
- return n;
- }
-
-
-
- template <>
- types::global_dof_index DoFHandler<1>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
- {
- Assert (finite_elements != nullptr, ExcNoFESelected());
-
- // check that only boundary indicators 0 and 1 are allowed in 1d
- for (std::set<types::boundary_id>::const_iterator i=boundary_ids.begin();
- i!=boundary_ids.end(); ++i)
- Assert ((*i == 0) || (*i == 1),
- ExcInvalidBoundaryIndicator());
-
- DoFHandler<1,1>::active_cell_iterator cell;
- types::global_dof_index n = 0;
-
- // search left-most cell
- if (boundary_ids.find (0) != boundary_ids.end())
- {
- cell = this->begin_active();
- while (!cell->at_boundary(0))
- cell = cell->neighbor(0);
- n += cell->get_fe().dofs_per_vertex;
- }
-
- // same with right-most cell
- if (boundary_ids.find (1) != boundary_ids.end())
- {
- cell = this->begin_active();
- while (!cell->at_boundary(1))
- cell = cell->neighbor(1);
- n += cell->get_fe().dofs_per_vertex;
- }
-
- return n;
- }
-
-
- template <>
- types::global_dof_index DoFHandler<1,2>::n_boundary_dofs () const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
- template <>
- template <typename number>
- types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::map<types::boundary_id, const Function<2,number>*> &) const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
- template <>
- types::global_dof_index DoFHandler<1,2>::n_boundary_dofs (const std::set<types::boundary_id> &) const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
-
-
- template <>
- types::global_dof_index DoFHandler<1,3>::n_boundary_dofs () const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
- template <>
- template <typename number>
- types::global_dof_index DoFHandler<1,3>::n_boundary_dofs (const std::map<types::boundary_id, const Function<3,number>*> &) const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
- template <>
- types::global_dof_index DoFHandler<1,3>::n_boundary_dofs (const std::set<types::boundary_id> &) const
- {
- Assert(false,ExcNotImplemented());
- return 0;
- }
-
-
template <int dim, int spacedim>
types::global_dof_index DoFHandler<dim,spacedim>::n_boundary_dofs () const
{
cell->active_fe_index());
for (unsigned int i=0; i<dofs_per_face; ++i)
boundary_dofs.insert(dofs_on_face[i]);
- };
+ }
return boundary_dofs.size();
}
cell->active_fe_index());
for (unsigned int i=0; i<dofs_per_face; ++i)
boundary_dofs.insert(dofs_on_face[i]);
- };
+ }
return boundary_dofs.size();
}