From: bangerth Date: Sun, 10 Sep 2006 01:07:04 +0000 (+0000) Subject: Clarify documentation. Convert an argument to array of unsigned integers, since it... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56f9e5b859466be7980e3c58e8c848a3df0692aa;p=dealii-svn.git Clarify documentation. Convert an argument to array of unsigned integers, since it is a set of indices. Also pass that array by reference, not by value -- which is a compatible change since arrays can never be generated in place except when returned by a function. git-svn-id: https://svn.dealii.org/trunk@13876 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/grid_tools.h b/deal.II/deal.II/include/grid/grid_tools.h index 3c52cb03d1..66b70f078d 100644 --- a/deal.II/deal.II/include/grid/grid_tools.h +++ b/deal.II/deal.II/include/grid/grid_tools.h @@ -59,16 +59,25 @@ class GridTools double diameter (const Triangulation<1> &tria); /** - * Return the measure of a cell - * represented by a subset of - * vertices in @p all_vertices - * which is specified by @p - * vertex_indices. + * Given a list of vertices (typically + * obtained using + * Triangulation::get_vertices) as the + * first, and a list of vertex indices + * that characterize a single cell as the + * second argument, return the measure + * (area, volume) of this cell. If this + * is a real cell, then you can get the + * same result using + * cell-@>measure(), but + * this function also works for cells + * that do not exist except that you make + * it up by naming its vertices from the + * list. */ template static - double cell_measure(const std::vector > &all_vertices, - const int vertex_indices[GeometryInfo::vertices_per_cell]); + double cell_measure (const std::vector > &all_vertices, + const unsigned int (&vertex_indices)[GeometryInfo::vertices_per_cell]); /** * Remove vertices that are not diff --git a/deal.II/deal.II/source/grid/grid_tools.cc b/deal.II/deal.II/source/grid/grid_tools.cc index 8b44eb1df6..b6c9664e2c 100644 --- a/deal.II/deal.II/source/grid/grid_tools.cc +++ b/deal.II/deal.II/source/grid/grid_tools.cc @@ -126,8 +126,8 @@ GridTools::diameter (const Triangulation<1> &tria) template <> double -GridTools::cell_measure(const std::vector > &all_vertices, - const int vertex_indices[GeometryInfo<3>::vertices_per_cell]) +GridTools::cell_measure (const std::vector > &all_vertices, + const unsigned int (&vertex_indices)[GeometryInfo<3>::vertices_per_cell]) { // note that this is the // cell_measure based on the new @@ -247,7 +247,7 @@ GridTools::cell_measure(const std::vector > &all_vertices, template double GridTools::cell_measure(const std::vector > &all_vertices, - const int [GeometryInfo::vertices_per_cell]) + const unsigned int (&) [GeometryInfo::vertices_per_cell]) { Assert(false, ExcNotImplemented()); return 0.;