From: Wolfgang Bangerth Date: Tue, 21 Mar 2023 19:36:48 +0000 (-0600) Subject: Apply concepts to grid_tools.h. X-Git-Tag: v9.5.0-rc1~439^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=463f061ac6d6bef20225593ce9b15048fdc2311e;p=dealii.git Apply concepts to grid_tools.h. --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 025a4c95d3..4844cc2026 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -63,6 +63,11 @@ #include #include +#ifdef DEAL_II_HAVE_CXX20 +# include +#endif + + DEAL_II_NAMESPACE_OPEN // Forward declarations @@ -602,9 +607,13 @@ namespace GridTools * step-38. It is also used in step-49 and step-53. */ template - void - transform(const Transformation & transformation, - Triangulation &triangulation); + DEAL_II_CXX20_REQUIRES( + (std::invocable> && + std::assignable_from< + Point &, + std::invoke_result_t>>)) + void transform(const Transformation & transformation, + Triangulation &triangulation); /** * Shift each vertex of the triangulation by the given shift vector. This @@ -3704,10 +3713,14 @@ namespace GridTools - template - void - transform(const Predicate & predicate, - Triangulation &triangulation) + template + DEAL_II_CXX20_REQUIRES( + (std::invocable> && + std::assignable_from< + Point &, + std::invoke_result_t>>)) + void transform(const Transformation & transformation, + Triangulation &triangulation) { std::vector treated_vertices(triangulation.n_vertices(), false); @@ -3725,7 +3738,7 @@ namespace GridTools if (treated_vertices[cell->vertex_index(v)] == false) { // transform this vertex - cell->vertex(v) = predicate(cell->vertex(v)); + cell->vertex(v) = transformation(cell->vertex(v)); // and mark it as treated treated_vertices[cell->vertex_index(v)] = true; };