]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make ArrayView argument const 11021/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 8 Oct 2020 16:41:32 +0000 (18:41 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 8 Oct 2020 16:44:17 +0000 (18:44 +0200)
include/deal.II/fe/mapping.h
include/deal.II/fe/mapping_q_generic.h
source/fe/mapping.cc
source/fe/mapping_q_generic.cc
tests/mappings/mapping_points_real_to_unit.cc

index ac4f6652b0a3d96f10ee66fbf2a3c9126fb5e8eb..a219ceb46b6e8c21fe341628aa2881998ffbe651 100644 (file)
@@ -467,7 +467,7 @@ public:
   transform_points_real_to_unit_cell(
     const typename Triangulation<dim, spacedim>::cell_iterator &cell,
     const ArrayView<const Point<spacedim>> &                    real_points,
-    ArrayView<Point<dim>> &unit_points) const;
+    const ArrayView<Point<dim>> &unit_points) const;
 
   /**
    * Transform the point @p p on the real @p cell to the corresponding point
index 501ef16289846dce5a5c59d97eac094dba4f1dac..8e21cecfdb7f7cb3717ea9be59b1e2210a268d4e 100644 (file)
@@ -186,7 +186,7 @@ public:
   transform_points_real_to_unit_cell(
     const typename Triangulation<dim, spacedim>::cell_iterator &cell,
     const ArrayView<const Point<spacedim>> &                    real_points,
-    ArrayView<Point<dim>> &unit_points) const override;
+    const ArrayView<Point<dim>> &unit_points) const override;
 
   /**
    * @}
index a70503a51ba4be233ce429766feedf6a3b7e2141..406a307879594ad94f51f11de13730bfcc9919c9 100644 (file)
@@ -81,7 +81,7 @@ void
 Mapping<dim, spacedim>::transform_points_real_to_unit_cell(
   const typename Triangulation<dim, spacedim>::cell_iterator &cell,
   const ArrayView<const Point<spacedim>> &                    real_points,
-  ArrayView<Point<dim>> &                                     unit_points) const
+  const ArrayView<Point<dim>> &                               unit_points) const
 {
   AssertDimension(real_points.size(), unit_points.size());
   for (unsigned int i = 0; i < real_points.size(); ++i)
index ab1058c97e1eb61423edb5525277ce54f5a7a922..f4c6f64b9a3b12fd4bf5e2fdd9a65700293af8b1 100644 (file)
@@ -892,7 +892,7 @@ namespace internal
 
 
       /**
-       * Implementation of transform_real_to_unit_cell for dim==spacedim
+       * Implementation of transform_real_to_unit_cell
        */
       template <int dim, int spacedim>
       Point<dim>
@@ -2307,7 +2307,7 @@ void
 MappingQGeneric<dim, spacedim>::transform_points_real_to_unit_cell(
   const typename Triangulation<dim, spacedim>::cell_iterator &cell,
   const ArrayView<const Point<spacedim>> &                    real_points,
-  ArrayView<Point<dim>> &                                     unit_points) const
+  const ArrayView<Point<dim>> &                               unit_points) const
 {
   AssertDimension(real_points.size(), unit_points.size());
   const std::vector<Point<spacedim>> support_points =
index 43b81a56de8455966571c8481db99180747aea09..19ca12142d73054eb27efc15146a58221c3b58ee 100644 (file)
@@ -95,8 +95,7 @@ test_real_to_unit_cell(const Mapping<dim, spacedim> &mapping)
   for (unsigned int i = 0; i < unit_points.size(); ++i)
     real_points[i] = mapping.transform_unit_to_real_cell(cell, unit_points[i]);
   std::vector<Point<dim>> new_points(unit_points.size());
-  ArrayView<Point<dim>>   points_view(new_points);
-  mapping.transform_points_real_to_unit_cell(cell, real_points, points_view);
+  mapping.transform_points_real_to_unit_cell(cell, real_points, new_points);
   for (unsigned int i = 0; i < unit_points.size(); ++i)
     {
       // for each of the points, verify that applying the forward map and

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.