]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add FEInterfaceValues::quadrature_point_indices() to support range based loops 12410/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Tue, 8 Jun 2021 14:23:55 +0000 (16:23 +0200)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Tue, 8 Jun 2021 15:48:59 +0000 (17:48 +0200)
include/deal.II/fe/fe_interface_values.h

index e464910fb3536aa6aaff76229a06fc53e823ecdf..8b37ce13a91ab97f6834c7ddd31d7b7fb2508187 100644 (file)
@@ -542,6 +542,16 @@ public:
   const std::vector<Tensor<1, spacedim>> &
   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<unsigned int, unsigned int>
+  quadrature_point_indices() const;
+
   /**
    * Return a reference to the quadrature points in real space.
    *
@@ -1063,6 +1073,15 @@ FEInterfaceValues<dim, spacedim>::get_quadrature() const
 
 
 
+template <int dim, int spacedim>
+inline std_cxx20::ranges::iota_view<unsigned int, unsigned int>
+FEInterfaceValues<dim, spacedim>::quadrature_point_indices() const
+{
+  return {0U, n_quadrature_points};
+}
+
+
+
 template <int dim, int spacedim>
 const std::vector<Point<spacedim>> &
 FEInterfaceValues<dim, spacedim>::get_quadrature_points() const

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.