From: David Wells Date: Thu, 12 May 2016 00:38:57 +0000 (-0400) Subject: Make cell_measure(...) work again. X-Git-Tag: v8.5.0-rc1~1042^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18ddfc4cf18c91d12c3af7dd9c71342342b26eaf;p=dealii.git Make cell_measure(...) work again. A result of d8bafee27cc was that users can no longer write cell_measure(...) with no given template argument (in the codimension zero case). This commit fixes that. Note: since dim does not explicitly appear alone and unmodified in the function arguments of cell_measure, that function can never have its type (more exactly, the value for dim) inferred correctly from just the arguments. Put another way, one must always write cell_measure to use this function. This was not a problem in the past when Point appeared instead of Point. --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index fd35b9952d..6aca950fea 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -166,6 +166,22 @@ namespace GridTools double cell_measure (const std::vector > &all_vertices, const unsigned int (&vertex_indices)[GeometryInfo::vertices_per_cell]); + + /** + * Same as the last function, but for the codimension zero case. This extra + * function allows one to write + * + * @code + * cell_measure(vertices, indices); + * @endcode + * + * and have the template function argument (i.e. dim) inferred + * automatically. + */ + template + double cell_measure (const std::vector > &all_vertices, + const unsigned int (&vertex_indices)[GeometryInfo::vertices_per_cell]); + /*@}*/ /** * @name Functions supporting the creation of meshes @@ -1639,6 +1655,16 @@ namespace GridTools namespace GridTools { + // This function just wraps the general case: see the note in its + // documentation above. + template + double cell_measure (const std::vector > &all_vertices, + const unsigned int (&vertex_indices)[GeometryInfo::vertices_per_cell]) + { + return cell_measure(all_vertices, vertex_indices); + } + + template void transform (const Predicate &predicate,