]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added documentation for get_all_vertices_at_boundary function.
authorFernando Posada <eposada@sissa.it>
Tue, 31 Mar 2015 08:18:42 +0000 (10:18 +0200)
committerFernando Posada <eposada@sissa.it>
Tue, 31 Mar 2015 09:06:07 +0000 (11:06 +0200)
include/deal.II/grid/grid_tools.h
source/grid/grid_tools.cc
source/grid/grid_tools.inst.in

index 5cbcd29f4722e86ce2d41af1b63a339a2d0d5a1c..e58a1b02b3a2cd9b2340ba874af36ff29813cbed 100644 (file)
@@ -297,12 +297,13 @@ namespace GridTools
                           const Function<dim,double> *coefficient = 0);
 
   /**
+  * Returns a std::map with all vertices of faces located in the boundary
   *
-  *
+  * @param[in] tria The Triangulation object.
   */
-  template<int dim>
-  std::map<unsigned int,Point<dim> >
-  get_all_vertex_at_boundary (const Triangulation<dim> &tria);
+  template <int dim, int spacedim>
+  std::map<unsigned int,Point<spacedim> >
+  get_all_vertices_at_boundary (const Triangulation<dim, spacedim> &tria);
 
   /**
    * Scale the entire triangulation by the given factor. To preserve the
index 70b613c7b4085b67982c08a52d6e90d22c7960d9..a3c6a9304bf359dc73255e324d5bd00d2d9b6463 100644 (file)
@@ -768,31 +768,30 @@ namespace GridTools
         }
   }
 
-
-  template<int dim>
-  std::map<unsigned int,Point<dim> >
-  get_all_vertex_at_boundary (const Triangulation<dim> &tria)
+  template <int dim, int spacedim>
+  std::map<unsigned int,Point<spacedim> >
+  get_all_vertices_at_boundary (const Triangulation<dim, spacedim> &tria)
   {
-    std::map<unsigned int, Point<dim> > vertex_map;   
-    typename Triangulation<dim>::active_cell_iterator
+    std::map<unsigned int, Point<spacedim> > vertex_map;
+    typename Triangulation<dim,spacedim>::active_cell_iterator
     cell = tria.begin_active(),
     endc = tria.end();
     for (; cell!=endc; ++cell)
-    { 
-      for (unsigned int i=0;i<GeometryInfo<dim>::faces_per_cell; ++i)
       {
-        const auto face = cell->face(i);
-        if (face->at_boundary())
-        {
-          for (unsigned j = 0; j < GeometryInfo<dim>::vertices_per_face; ++j)
+        for (unsigned int i=0; i<GeometryInfo<dim>::faces_per_cell; ++i)
           {
-            const auto vertex = face->vertex(j);
-            const auto vertex_index = face->vertex_index(j);
-            vertex_map[vertex_index] = vertex / vertex.norm();
+            const auto face = cell->face(i);
+            if (face->at_boundary())
+              {
+                for (unsigned j = 0; j < GeometryInfo<dim>::vertices_per_face; ++j)
+                  {
+                    const auto vertex = face->vertex(j);
+                    const auto vertex_index = face->vertex_index(j);
+                    vertex_map[vertex_index] = vertex;
+                  }
+              }
           }
-        }
       }
-    }
     return vertex_map;
   }
 
index beb84584ed5406f83b81975274ac1ce179812815..346797bd2d1fde4aade1d391d464247015699a0d 100644 (file)
@@ -204,6 +204,10 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
       double
       maximal_cell_diameter (const Triangulation<deal_II_dimension, deal_II_space_dimension> &triangulation);
 
+    template
+    std::map<unsigned int,Point<deal_II_space_dimension> >
+    get_all_vertices_at_boundary (const Triangulation<deal_II_dimension,deal_II_space_dimension> &tria);
+
 #if deal_II_dimension == deal_II_space_dimension
 #  if deal_II_dimension > 1
     template
@@ -212,10 +216,6 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension :  SPACE_DIMENSIONS
                        Triangulation<deal_II_dimension> &triangulation,
                        const Function<deal_II_dimension> *coefficient);
 
-    template
-    std::map<unsigned int,Point<deal_II_dimension> >
-    get_all_vertex_at_boundary (const Triangulation<deal_II_dimension> &tria);
-
 #  endif
 
     template

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.