]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use make_array_view 4707/head
authorLuca Heltai <luca.heltai@sissa.it>
Mon, 7 Aug 2017 18:22:27 +0000 (12:22 -0600)
committerLuca Heltai <luca.heltai@sissa.it>
Mon, 7 Aug 2017 18:22:27 +0000 (12:22 -0600)
source/fe/fe_values.cc

index 0f75279c49e987f9a4a1976ca2d4a45f5cdf3ae4..2d1ab1755f96d10ff75caebc1028fc15a9348d71 100644 (file)
@@ -456,8 +456,8 @@ namespace FEValuesViews
     // ------------------------- scalar functions --------------------------
     template <int dim, int spacedim, typename Number>
     void
-    do_function_values (const ArrayView<const Number>  &dof_values,
-                        const Table<2,double>          &shape_values,
+    do_function_values (const ArrayView<Number> &dof_values,
+                        const Table<2,double> &shape_values,
                         const std::vector<typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                         std::vector<typename ProductType<Number,double>::type>            &values)
     {
@@ -489,7 +489,7 @@ namespace FEValuesViews
     // the order of the derivative (= rank of gradient/Hessian tensor)
     template <int order, int dim, int spacedim, typename Number>
     void
-    do_function_derivatives (const ArrayView<const Number> &dof_values,
+    do_function_derivatives (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<order,spacedim> > &shape_derivatives,
                              const std::vector<typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,dealii::Tensor<order,spacedim> >::type> &derivatives)
@@ -522,7 +522,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_laplacians (const ArrayView<const Number> &dof_values,
+    do_function_laplacians (const ArrayView<Number> &dof_values,
                             const Table<2,dealii::Tensor<2,spacedim> > &shape_hessians,
                             const std::vector<typename Scalar<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                             std::vector<typename ProductType<Number,double>::type>           &laplacians)
@@ -554,7 +554,7 @@ namespace FEValuesViews
     // ----------------------------- vector part ---------------------------
 
     template <int dim, int spacedim, typename Number>
-    void do_function_values (const ArrayView<const Number> &dof_values,
+    void do_function_values (const ArrayView<Number> &dof_values,
                              const Table<2,double>          &shape_values,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &values)
@@ -603,7 +603,7 @@ namespace FEValuesViews
 
     template <int order, int dim, int spacedim, typename Number>
     void
-    do_function_derivatives (const ArrayView<const Number> &dof_values,
+    do_function_derivatives (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<order,spacedim> > &shape_derivatives,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,dealii::Tensor<order+1,spacedim> >::type> &derivatives)
@@ -657,7 +657,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_symmetric_gradients (const ArrayView<const Number> &dof_values,
+    do_function_symmetric_gradients (const ArrayView<Number> &dof_values,
                                      const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                                      const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                                      std::vector<typename ProductType<Number,dealii::SymmetricTensor<2,spacedim> >::type> &symmetric_gradients)
@@ -710,7 +710,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_divergences (const ArrayView<const Number> &dof_values,
+    do_function_divergences (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                              const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,double>::type> &divergences)
@@ -760,7 +760,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_curls (const ArrayView<const Number> &dof_values,
+    do_function_curls (const ArrayView<Number> &dof_values,
                        const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                        const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                        std::vector<typename ProductType<Number,typename dealii::internal::CurlType<spacedim>::type>::type> &curls)
@@ -952,7 +952,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_laplacians (const ArrayView<const Number> &dof_values,
+    do_function_laplacians (const ArrayView<Number> &dof_values,
                             const Table<2,dealii::Tensor<2,spacedim> > &shape_hessians,
                             const std::vector<typename Vector<dim,spacedim>::ShapeFunctionData> &shape_function_data,
                             std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &laplacians)
@@ -1006,7 +1006,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_values (const ArrayView<const Number> &dof_values,
+    do_function_values (const ArrayView<Number> &dof_values,
                         const dealii::Table<2,double>          &shape_values,
                         const std::vector<typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
                         std::vector<typename ProductType<Number,dealii::SymmetricTensor<2,spacedim> >::type> &values)
@@ -1060,7 +1060,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_divergences (const ArrayView<const Number> &dof_values,
+    do_function_divergences (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                              const std::vector<typename SymmetricTensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &divergences)
@@ -1148,7 +1148,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_values (const ArrayView<const Number> &dof_values,
+    do_function_values (const ArrayView<Number> &dof_values,
                         const dealii::Table<2,double>          &shape_values,
                         const std::vector<typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
                         std::vector<typename ProductType<Number,dealii::Tensor<2,spacedim> >::type> &values)
@@ -1204,7 +1204,7 @@ namespace FEValuesViews
 
     template <int dim, int spacedim, typename Number>
     void
-    do_function_divergences (const ArrayView<const Number> &dof_values,
+    do_function_divergences (const ArrayView<Number> &dof_values,
                              const Table<2,dealii::Tensor<1,spacedim> > &shape_gradients,
                              const std::vector<typename Tensor<2,dim,spacedim>::ShapeFunctionData> &shape_function_data,
                              std::vector<typename ProductType<Number,dealii::Tensor<1,spacedim> >::type> &divergences)
@@ -1282,7 +1282,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_values<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_values, shape_function_data, values);
   }
 
@@ -1306,7 +1306,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<1,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
   }
 
@@ -1330,7 +1330,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<2,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
   }
 
@@ -1354,7 +1354,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_laplacians<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
   }
 
@@ -1378,7 +1378,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<3,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
   }
 
@@ -1402,7 +1402,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_values<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_values, shape_function_data, values);
   }
 
@@ -1427,7 +1427,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<1,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, gradients);
   }
 
@@ -1451,7 +1451,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_symmetric_gradients<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data,
      symmetric_gradients);
   }
@@ -1477,7 +1477,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_divergences<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
   }
 
@@ -1499,7 +1499,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values (fe_function, dof_values);
     internal::do_function_curls<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, curls);
   }
 
@@ -1522,7 +1522,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<2,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_hessians, shape_function_data, hessians);
   }
 
@@ -1549,7 +1549,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_laplacians<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_hessians, shape_function_data, laplacians);
   }
 
@@ -1572,7 +1572,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values (fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_derivatives<3,dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_3rd_derivatives, shape_function_data, third_derivatives);
   }
 
@@ -1596,7 +1596,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_values<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_values, shape_function_data, values);
   }
 
@@ -1621,7 +1621,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_divergences<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
   }
 
@@ -1643,7 +1643,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_values<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_values, shape_function_data, values);
   }
 
@@ -1668,7 +1668,7 @@ namespace FEValuesViews
     dealii::Vector<typename InputVector::value_type> dof_values(fe_values->dofs_per_cell);
     fe_values->present_cell->get_interpolated_dof_values(fe_function, dof_values);
     internal::do_function_divergences<dim,spacedim>
-    (ArrayView<const typename InputVector::value_type>(&dof_values[0], fe_values->dofs_per_cell),
+    (make_array_view(dof_values.begin(), dof_values.end()),
      fe_values->finite_element_output.shape_gradients, shape_function_data, divergences);
   }
 }

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.