From: Martin Kronbichler Date: Thu, 8 Oct 2020 16:41:32 +0000 (+0200) Subject: Make ArrayView argument const X-Git-Tag: v9.3.0-rc1~1018^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27967e21b9006e0afb1a63fe59e4de7df3772078;p=dealii.git Make ArrayView argument const --- diff --git a/include/deal.II/fe/mapping.h b/include/deal.II/fe/mapping.h index ac4f6652b0..a219ceb46b 100644 --- a/include/deal.II/fe/mapping.h +++ b/include/deal.II/fe/mapping.h @@ -467,7 +467,7 @@ public: transform_points_real_to_unit_cell( const typename Triangulation::cell_iterator &cell, const ArrayView> & real_points, - ArrayView> &unit_points) const; + const ArrayView> &unit_points) const; /** * Transform the point @p p on the real @p cell to the corresponding point diff --git a/include/deal.II/fe/mapping_q_generic.h b/include/deal.II/fe/mapping_q_generic.h index 501ef16289..8e21cecfdb 100644 --- a/include/deal.II/fe/mapping_q_generic.h +++ b/include/deal.II/fe/mapping_q_generic.h @@ -186,7 +186,7 @@ public: transform_points_real_to_unit_cell( const typename Triangulation::cell_iterator &cell, const ArrayView> & real_points, - ArrayView> &unit_points) const override; + const ArrayView> &unit_points) const override; /** * @} diff --git a/source/fe/mapping.cc b/source/fe/mapping.cc index a70503a51b..406a307879 100644 --- a/source/fe/mapping.cc +++ b/source/fe/mapping.cc @@ -81,7 +81,7 @@ void Mapping::transform_points_real_to_unit_cell( const typename Triangulation::cell_iterator &cell, const ArrayView> & real_points, - ArrayView> & unit_points) const + const ArrayView> & unit_points) const { AssertDimension(real_points.size(), unit_points.size()); for (unsigned int i = 0; i < real_points.size(); ++i) diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index ab1058c97e..f4c6f64b9a 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -892,7 +892,7 @@ namespace internal /** - * Implementation of transform_real_to_unit_cell for dim==spacedim + * Implementation of transform_real_to_unit_cell */ template Point @@ -2307,7 +2307,7 @@ void MappingQGeneric::transform_points_real_to_unit_cell( const typename Triangulation::cell_iterator &cell, const ArrayView> & real_points, - ArrayView> & unit_points) const + const ArrayView> & unit_points) const { AssertDimension(real_points.size(), unit_points.size()); const std::vector> support_points = diff --git a/tests/mappings/mapping_points_real_to_unit.cc b/tests/mappings/mapping_points_real_to_unit.cc index 43b81a56de..19ca12142d 100644 --- a/tests/mappings/mapping_points_real_to_unit.cc +++ b/tests/mappings/mapping_points_real_to_unit.cc @@ -95,8 +95,7 @@ test_real_to_unit_cell(const Mapping &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> new_points(unit_points.size()); - ArrayView> 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