From 18ddfc4cf18c91d12c3af7dd9c71342342b26eaf Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 11 May 2016 20:38:57 -0400 Subject: [PATCH] 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. --- include/deal.II/grid/grid_tools.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) 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, -- 2.39.5