]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Repeat the previous patch for the hp::DoFHandler. 3602/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Thu, 17 Nov 2016 03:58:15 +0000 (20:58 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Thu, 17 Nov 2016 13:46:18 +0000 (06:46 -0700)
include/deal.II/hp/dof_handler.h
source/hp/dof_handler.cc
source/hp/dof_handler.inst.in

index c4ffd504bf687e384eb3e6990fd7c2774847f4a1..4b1b1fffd90f0d05b3db882fd25c740300d8c044 100644 (file)
@@ -906,6 +906,25 @@ namespace hp
 
   /* ----------------------- Inline functions ---------------------------------- */
 
+
+  template <int dim, int spacedim>
+  template <typename number>
+  types::global_dof_index
+  DoFHandler<dim,spacedim>::n_boundary_dofs (const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_ids) const
+  {
+    // extract the set of boundary ids and forget about the function object pointers
+    std::set<types::boundary_id> boundary_ids_only;
+    for (typename std::map<types::boundary_id, const Function<spacedim,number>*>::const_iterator
+         p = boundary_ids.begin();
+         p != boundary_ids.end(); ++p)
+      boundary_ids_only.insert (p->first);
+
+    // then just hand everything over to the other function that does the work
+    return n_boundary_dofs(boundary_ids_only);
+  }
+
+
+
   template <int dim, int spacedim>
   template <class Archive>
   void DoFHandler<dim, spacedim>::save(Archive &ar, unsigned int) const
index 097e0ec4bb5d35e1c3bb4d455cb90aa6d1aef48e..c0bcf19470d09b3840b90814a34f75a269417f6a 100644 (file)
@@ -1994,43 +1994,6 @@ namespace hp
 
 
 
-  template<int dim, int spacedim>
-  template<typename number>
-  types::global_dof_index
-  DoFHandler<dim,spacedim>::n_boundary_dofs (const std::map<types::boundary_id, const Function<spacedim,number>*> &boundary_ids) const
-  {
-    Assert (finite_elements != 0, ExcNoFESelected());
-    Assert (boundary_ids.find(numbers::internal_face_boundary_id) == boundary_ids.end(),
-            ExcInvalidBoundaryIndicator());
-
-    // same as above, but with
-    // additional checks for set of
-    // boundary indicators
-    std::set<types::global_dof_index> boundary_dofs;
-    std::vector<types::global_dof_index> dofs_on_face;
-    dofs_on_face.reserve (this->get_fe ().max_dofs_per_face());
-
-    typename HpDoFHandler<dim,spacedim>::active_cell_iterator cell = this->begin_active (),
-                                                              endc = this->end();
-    for (; cell!=endc; ++cell)
-      for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
-        if (cell->at_boundary(f) &&
-            (boundary_ids.find(cell->face(f)->boundary_id()) !=
-             boundary_ids.end()))
-          {
-            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->active_fe_index());
-            for (unsigned int i=0; i<dofs_per_face; ++i)
-              boundary_dofs.insert(dofs_on_face[i]);
-          }
-    return boundary_dofs.size();
-  }
-
-
-
   template<int dim, int spacedim>
   types::global_dof_index
   DoFHandler<dim,spacedim>::n_boundary_dofs (const std::set<types::boundary_id> &boundary_ids) const
index eac399e75d707e283509f33d37f0917b7de79d96..97578352e972111a8e01aec69bfb27596dae425f 100644 (file)
 //
 // ---------------------------------------------------------------------
 
-for (scalar: REAL_SCALARS; deal_II_dimension : DIMENSIONS)
-{
-    namespace hp
-    \{
-    template types::global_dof_index DoFHandler<deal_II_dimension>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension,scalar>*> &boundary_ids) const;
-
-#if deal_II_dimension < 3
-    template types::global_dof_index DoFHandler<deal_II_dimension,deal_II_dimension+1>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension+1,scalar>*> &boundary_ids) const;
-#endif
-
-#if deal_II_dimension == 1
-    template types::global_dof_index DoFHandler<deal_II_dimension,deal_II_dimension+2>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension+2,scalar>*> &boundary_ids) const;
-#endif
-    \}
-}
-
-for (scalar: COMPLEX_SCALARS; deal_II_dimension : DIMENSIONS)
-{
-    namespace hp
-    \{
-    template types::global_dof_index DoFHandler<deal_II_dimension>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension,scalar>*> &boundary_ids) const;
-
-#if deal_II_dimension < 3
-    template types::global_dof_index DoFHandler<deal_II_dimension,deal_II_dimension+1>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension+1,scalar>*> &boundary_ids) const;
-#endif
-
-#if deal_II_dimension == 1
-    template types::global_dof_index DoFHandler<deal_II_dimension,deal_II_dimension+2>::n_boundary_dofs<scalar> (const std::map<types::boundary_id, const Function<deal_II_dimension+2,scalar>*> &boundary_ids) const;
-#endif
-    \}
-}
-
 
 for (deal_II_dimension : DIMENSIONS)
 {

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.