From: Fernando Posada Date: Tue, 31 Mar 2015 08:18:42 +0000 (+0200) Subject: Added documentation for get_all_vertices_at_boundary function. X-Git-Tag: v8.3.0-rc1~335^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba9fbf6b6d76c2c577c043b1e4336121bc1ba404;p=dealii.git Added documentation for get_all_vertices_at_boundary function. --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 5cbcd29f47..e58a1b02b3 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -297,12 +297,13 @@ namespace GridTools const Function *coefficient = 0); /** + * Returns a std::map with all vertices of faces located in the boundary * - * + * @param[in] tria The Triangulation object. */ - template - std::map > - get_all_vertex_at_boundary (const Triangulation &tria); + template + std::map > + get_all_vertices_at_boundary (const Triangulation &tria); /** * Scale the entire triangulation by the given factor. To preserve the diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 70b613c7b4..a3c6a9304b 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -768,31 +768,30 @@ namespace GridTools } } - - template - std::map > - get_all_vertex_at_boundary (const Triangulation &tria) + template + std::map > + get_all_vertices_at_boundary (const Triangulation &tria) { - std::map > vertex_map; - typename Triangulation::active_cell_iterator + std::map > vertex_map; + typename Triangulation::active_cell_iterator cell = tria.begin_active(), endc = tria.end(); for (; cell!=endc; ++cell) - { - for (unsigned int i=0;i::faces_per_cell; ++i) { - const auto face = cell->face(i); - if (face->at_boundary()) - { - for (unsigned j = 0; j < GeometryInfo::vertices_per_face; ++j) + for (unsigned int i=0; i::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::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; } diff --git a/source/grid/grid_tools.inst.in b/source/grid/grid_tools.inst.in index beb84584ed..346797bd2d 100644 --- a/source/grid/grid_tools.inst.in +++ b/source/grid/grid_tools.inst.in @@ -204,6 +204,10 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS double maximal_cell_diameter (const Triangulation &triangulation); + template + std::map > + get_all_vertices_at_boundary (const Triangulation &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 &triangulation, const Function *coefficient); - template - std::map > - get_all_vertex_at_boundary (const Triangulation &tria); - # endif template