From: Jean-Paul Pelteret Date: Tue, 8 Jun 2021 14:23:55 +0000 (+0200) Subject: Add FEInterfaceValues::quadrature_point_indices() to support range based loops X-Git-Tag: v9.4.0-rc1~1257^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12410%2Fhead;p=dealii.git Add FEInterfaceValues::quadrature_point_indices() to support range based loops --- 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