]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make various comment and naming changes based on discussion in pull request
authorSpencer Patty <srobertp@gmail.com>
Fri, 5 Feb 2016 04:13:42 +0000 (22:13 -0600)
committerSpencer Patty <srobertp@gmail.com>
Fri, 5 Feb 2016 04:13:42 +0000 (22:13 -0600)
include/deal.II/grid/grid_tools.h
source/grid/grid_tools.cc

index 77dfe71e48e0ec4043518ca9c3d5432fca8a6660..f51b4b90414561103c3e87fc4a6fe3b232067216 100644 (file)
@@ -1092,26 +1092,33 @@ namespace GridTools
    * parallel:distributed::Triangulation<dim> are supported and handled
    * appropriately.
    *
-   * It is necessary that the finite element underlying the Container used has
-   * degrees of freedom on faces (2d or 3d) and lines (in 3d).  This unfortunately
-   * precludes the FE_DGQ<dim> finite element.  Likewise, the finite element
-   * must have nodal basis elements for this implementation to make sense.
-   *
-   * @tparam Container The Container could be a DoFHandler<dim> or hp::DoFHandler<dim>.
-   * @param[in] dof_handler The Container which could be built on a Triangulation<dim>
-   * or a parallel:distributed::Triangulation<dim> and should be using a nodal
-   * finite element with degrees of freedom defined on faces (2d or 3d) and
-   * lines (3d).
-   * @param[out] dof_to_support_patch_map A map from the global_dof_index of dofs on locally relevant cells
-   * to vectors containing Container::active_cell_iterators of
+   * It is necessary that the finite element underlying the MeshType used has
+   * degrees of freedom that are logically associated to a vertex, line, quad, 
+   * or hex.  This includes both nodal degrees of freedom and other modal types
+   * of dofs that are associated to an edge, etc.  The result is the patch of 
+   * cells representing the support of the basis element associated to the 
+   * degree of freedom.  For instance using an FE_Q finite element, we obtain
+   * the standard patch of cells touching the degree of freedom and then others 
+   * that take care of possible hanging node constraints.  Using a FE_DGQ finite
+   * element, the degrees of freedom are logically considered to be "interior" to
+   * the cells so the patch would be the cell on which the degree of freedom is 
+   * located.
+   *
+   * @tparam MeshType The MeshType should be a DoFHandler<dim> or hp::DoFHandler<dim>.
+   * @param[in] dof_handler The MeshType which could be built on a Triangulation<dim>
+   * or a parallel::distributed::Triangulation<dim> and should be using a finite
+   * element that has degrees of freedom that are logically associated to a vertex,
+   * line, quad, or hex.
+   * @param[out] dof_to_support_patch_map A map from the global_dof_index of DoFs
+   * on locally relevant cells to vectors containing MeshType::active_cell_iterators of
    * cells in support of basis function at that degree of freedom.
    *
    *  @author Spencer Patty, 2016
    *
    */
-  template <class Container>
-  std::map< types::global_dof_index,std::vector<typename Container::active_cell_iterator> >
-  get_dof_to_support_patch_map(Container &dof_handler);
+  template <class MeshType>
+  std::map< types::global_dof_index,std::vector<typename MeshType::active_cell_iterator> >
+  get_dof_to_support_patch_map(MeshType &dof_handler);
 
 
   /*@}*/
index 141882bcd90a1193631c79b065df74067eb37f6a..6511c18b2e5f2c438243e1c9ec825899e7079b31 100644 (file)
@@ -3049,13 +3049,11 @@ next_cell:
 
 
 
-  template <class Container>
-  std::map< types::global_dof_index,std::vector<typename Container::active_cell_iterator> >
-  get_dof_to_support_patch_map(Container &dof_handler)
+  template <class MeshType>
+  std::map< types::global_dof_index,std::vector<typename MeshType::active_cell_iterator> >
+  get_dof_to_support_patch_map(MeshType &dof_handler)
   {
 
-    //  TODO: Add Assert( fe is not dg)
-
     // This is the map from global_dof_index to
     // a set of cells on patch.  We first map into
     // a set because it is very likely that we
@@ -3066,18 +3064,18 @@ next_cell:
     // constructed, we will copy to a map of vectors
     // since that is the prefered output for other
     // functions.
-    std::map< types::global_dof_index,std::set<typename Container::active_cell_iterator> > dof_to_set_of_cells_map;
+    std::map< types::global_dof_index,std::set<typename MeshType::active_cell_iterator> > dof_to_set_of_cells_map;
 
-    std::vector<types::global_dof_index> local_dof_index;
-    std::vector<types::global_dof_index> local_face_dof_index;
-    std::vector<types::global_dof_index> local_line_dof_index;
+    std::vector<types::global_dof_index> local_dof_indices;
+    std::vector<types::global_dof_index> local_face_dof_indices;
+    std::vector<types::global_dof_index> local_line_dof_indices;
 
     // in 3d, we need pointers from active lines to the
     // active parent lines, so we construct it as needed.
-    std::map<typename Container::active_line_iterator, typename Container::line_iterator > lines_to_parent_lines_map;
-    if (Container::dimension == 3)
+    std::map<typename MeshType::active_line_iterator, typename MeshType::line_iterator > lines_to_parent_lines_map;
+    if (MeshType::dimension == 3)
       {
-        typename Container::active_cell_iterator cell = dof_handler.begin_active(),
+        typename MeshType::active_cell_iterator cell = dof_handler.begin_active(),
                                                  endc = dof_handler.end();
         for (; cell!=endc; ++cell)
           {
@@ -3087,7 +3085,7 @@ next_cell:
             // few and we don't have to use them.
             if (cell->is_artificial() == false)
               {
-                for (unsigned int l=0; l<GeometryInfo<Container::dimension>::lines_per_cell; ++l)
+                for (unsigned int l=0; l<GeometryInfo<MeshType::dimension>::lines_per_cell; ++l)
                   if (cell->line(l)->has_children())
                     for (unsigned int c=0; c<cell->line(l)->n_children(); ++c)
                       {
@@ -3107,7 +3105,7 @@ next_cell:
     // which it is a part, mainly the ones that must
     // be added on account of adaptivity hanging node
     // constraints.
-    typename Container::active_cell_iterator cell = dof_handler.begin_active(),
+    typename MeshType::active_cell_iterator cell = dof_handler.begin_active(),
                                              endc = dof_handler.end();
     for (; cell!=endc; ++cell)
       {
@@ -3117,13 +3115,13 @@ next_cell:
         if (cell->is_artificial() == false)
           {
             const unsigned int n_dofs_per_cell = cell->get_fe().dofs_per_cell;
-            local_dof_index.resize(n_dofs_per_cell);
+            local_dof_indices.resize(n_dofs_per_cell);
 
             // Take care of adding cell pointer to each
             // dofs that exists on cell.
-            cell->get_dof_indices(local_dof_index);
+            cell->get_dof_indices(local_dof_indices);
             for (unsigned int i=0; i< n_dofs_per_cell; ++i )
-              dof_to_set_of_cells_map[local_dof_index[i]].insert(cell);
+              dof_to_set_of_cells_map[local_dof_indices[i]].insert(cell);
 
             // In the case of the adjacent cell (over
             // faces or edges) being more refined, we
@@ -3133,7 +3131,7 @@ next_cell:
             // face (or line).
 
             // Take care of dofs on neighbor faces
-            for (unsigned int f=0; f<GeometryInfo<Container::dimension>::faces_per_cell; ++f)
+            for (unsigned int f=0; f<GeometryInfo<MeshType::dimension>::faces_per_cell; ++f)
               {
                 if (cell->face(f)->has_children())
                   {
@@ -3154,11 +3152,11 @@ next_cell:
                         Assert (cell->face(f)->child(c)->has_children() == false, ExcInternalError());
 
                         const unsigned int n_dofs_per_face = cell->get_fe().dofs_per_face;
-                        local_face_dof_index.resize(n_dofs_per_face);
+                        local_face_dof_indices.resize(n_dofs_per_face);
 
-                        cell->face(f)->child(c)->get_dof_indices(local_face_dof_index);
+                        cell->face(f)->child(c)->get_dof_indices(local_face_dof_indices);
                         for (unsigned int i=0; i< n_dofs_per_face; ++i )
-                          dof_to_set_of_cells_map[local_face_dof_index[i]].insert(cell);
+                          dof_to_set_of_cells_map[local_face_dof_indices[i]].insert(cell);
                       }
                   }
                 else if ((cell->face(f)->at_boundary() == false) && (cell->neighbor_is_coarser(f)))
@@ -3184,11 +3182,11 @@ next_cell:
                     unsigned int subface = neighbor_face_no_subface_no.second;
 
                     const unsigned int n_dofs_per_face = cell->get_fe().dofs_per_face;
-                    local_face_dof_index.resize(n_dofs_per_face);
+                    local_face_dof_indices.resize(n_dofs_per_face);
 
-                    cell->neighbor(f)->face(face_no)->get_dof_indices(local_face_dof_index);
+                    cell->neighbor(f)->face(face_no)->get_dof_indices(local_face_dof_indices);
                     for (unsigned int i=0; i< n_dofs_per_face; ++i )
-                      dof_to_set_of_cells_map[local_face_dof_index[i]].insert(cell);
+                      dof_to_set_of_cells_map[local_face_dof_indices[i]].insert(cell);
 
                     // Add cell to all dofs of children of
                     // parent face
@@ -3197,12 +3195,12 @@ next_cell:
                         if (c != subface) // don't repeat work on dofs of original cell
                           {
                             const unsigned int n_dofs_per_face = cell->get_fe().dofs_per_face;
-                            local_face_dof_index.resize(n_dofs_per_face);
+                            local_face_dof_indices.resize(n_dofs_per_face);
 
                             Assert (cell->neighbor(f)->face(face_no)->child(c)->has_children() == false, ExcInternalError());
-                            cell->neighbor(f)->face(face_no)->child(c)->get_dof_indices(local_face_dof_index);
+                            cell->neighbor(f)->face(face_no)->child(c)->get_dof_indices(local_face_dof_indices);
                             for (unsigned int i=0; i<n_dofs_per_face; ++i )
-                              dof_to_set_of_cells_map[local_face_dof_index[i]].insert(cell);
+                              dof_to_set_of_cells_map[local_face_dof_indices[i]].insert(cell);
                           }
                       }
                   }
@@ -3216,9 +3214,9 @@ next_cell:
             // if cell's line has an active parent, then
             // distribute cell to dofs on parent line
             // and dofs on all children of parent line.
-            if (Container::dimension == 3)
+            if (MeshType::dimension == 3)
               {
-                for (unsigned int l=0; l<GeometryInfo<Container::dimension>::lines_per_cell; ++l)
+                for (unsigned int l=0; l<GeometryInfo<MeshType::dimension>::lines_per_cell; ++l)
                   {
                     if (cell->line(l)->has_children())
                       {
@@ -3230,11 +3228,11 @@ next_cell:
                             // on line not including the vertices of the line.
                             const unsigned int n_dofs_per_line = 2*cell->get_fe().dofs_per_vertex
                                                                  + cell->get_fe().dofs_per_line;
-                            local_line_dof_index.resize(n_dofs_per_line);
+                            local_line_dof_indices.resize(n_dofs_per_line);
 
-                            cell->line(l)->child(c)->get_dof_indices(local_line_dof_index);
+                            cell->line(l)->child(c)->get_dof_indices(local_line_dof_indices);
                             for (unsigned int i=0; i<n_dofs_per_line; ++i )
-                              dof_to_set_of_cells_map[local_line_dof_index[i]].insert(cell);
+                              dof_to_set_of_cells_map[local_line_dof_indices[i]].insert(cell);
                           }
                       }
                     // user flag was set above to denote that
@@ -3243,18 +3241,18 @@ next_cell:
                     // children
                     else if (cell->line(l)->user_flag_set() == true)
                       {
-                        typename Container::line_iterator parent_line = lines_to_parent_lines_map[cell->line(l)];
+                        typename MeshType::line_iterator parent_line = lines_to_parent_lines_map[cell->line(l)];
                         Assert (parent_line->has_children(), ExcInternalError() );
 
                         // dofs_per_line returns number of dofs
                         // on line not including the vertices of the line.
                         const unsigned int n_dofs_per_line = 2*cell->get_fe().dofs_per_vertex
                                                              + cell->get_fe().dofs_per_line;
-                        local_line_dof_index.resize(n_dofs_per_line);
+                        local_line_dof_indices.resize(n_dofs_per_line);
 
-                        parent_line->get_dof_indices(local_line_dof_index);
+                        parent_line->get_dof_indices(local_line_dof_indices);
                         for (unsigned int i=0; i<n_dofs_per_line; ++i )
-                          dof_to_set_of_cells_map[local_line_dof_index[i]].insert(cell);
+                          dof_to_set_of_cells_map[local_line_dof_indices[i]].insert(cell);
 
                         for (unsigned int c=0; c<parent_line->n_children(); ++c)
                           {
@@ -3262,11 +3260,11 @@ next_cell:
 
                             const unsigned int n_dofs_per_line = 2*cell->get_fe().dofs_per_vertex
                                                                  + cell->get_fe().dofs_per_line;
-                            local_line_dof_index.resize(n_dofs_per_line);
+                            local_line_dof_indices.resize(n_dofs_per_line);
 
-                            parent_line->child(c)->get_dof_indices(local_line_dof_index);
+                            parent_line->child(c)->get_dof_indices(local_line_dof_indices);
                             for (unsigned int i=0; i<n_dofs_per_line; ++i )
-                              dof_to_set_of_cells_map[local_line_dof_index[i]].insert(cell);
+                              dof_to_set_of_cells_map[local_line_dof_indices[i]].insert(cell);
                           }
 
                         // clear up user flags set from earlier
@@ -3277,16 +3275,16 @@ next_cell:
                         cell->line(l)->clear_user_flag();
                       }
                   } // for lines l
-              }// if Container::dimension == 3
+              }// if MeshType::dimension == 3
           }// if cell->is_locally_owned()
       }// for cells
 
 
     // Finally, we copy map of sets to
     // map of vectors using assign()
-    std::map< types::global_dof_index, std::vector<typename Container::active_cell_iterator> > dof_to_cell_patches;
+    std::map< types::global_dof_index, std::vector<typename MeshType::active_cell_iterator> > dof_to_cell_patches;
 
-    typename std::map<types::global_dof_index, std::set< typename Container::active_cell_iterator> >::iterator
+    typename std::map<types::global_dof_index, std::set< typename MeshType::active_cell_iterator> >::iterator
     it = dof_to_set_of_cells_map.begin(),
     it_end = dof_to_set_of_cells_map.end();
     for ( ; it!=it_end; ++it)

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.