From 12227a4f9a919e5144b2b002a4c2cf6c5ecab07b Mon Sep 17 00:00:00 2001 From: Jean-Paul Pelteret Date: Tue, 8 Jun 2021 16:23:55 +0200 Subject: [PATCH] Add FEInterfaceValues::quadrature_point_indices() to support range based loops --- include/deal.II/fe/fe_interface_values.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/deal.II/fe/fe_interface_values.h b/include/deal.II/fe/fe_interface_values.h index e464910fb3..8b37ce13a9 100644 --- a/include/deal.II/fe/fe_interface_values.h +++ b/include/deal.II/fe/fe_interface_values.h @@ -542,6 +542,16 @@ public: const std::vector> & get_normal_vectors() const; + /** + * Return an object that can be thought of as an array containing all + * indices from zero to `n_quadrature_points`. This allows to write code + * using range-based `for` loops. + * + * @see CPP11 + */ + std_cxx20::ranges::iota_view + quadrature_point_indices() const; + /** * Return a reference to the quadrature points in real space. * @@ -1063,6 +1073,15 @@ FEInterfaceValues::get_quadrature() const +template +inline std_cxx20::ranges::iota_view +FEInterfaceValues::quadrature_point_indices() const +{ + return {0U, n_quadrature_points}; +} + + + template const std::vector> & FEInterfaceValues::get_quadrature_points() const -- 2.39.5