From: Matthias Maier Date: Thu, 22 Jun 2023 05:55:59 +0000 (-0500) Subject: fe/fe_values: convert internal::do_function_laplacians to ArrayView X-Git-Tag: v9.5.0-rc1~59^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=09a28d61d555936ff0b9088e57b956077ab29f6c;p=dealii.git fe/fe_values: convert internal::do_function_laplacians to ArrayView --- diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index ecbcf5cf55..4d7bc738e8 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -3116,7 +3116,7 @@ namespace internal template void do_function_laplacians( - const Number2 * dof_values_ptr, + const ArrayView & dof_values, const dealii::Table<2, Tensor<2, spacedim>> &shape_hessians, std::vector & laplacians) { @@ -3133,7 +3133,7 @@ namespace internal // the trace of the Hessian. for (unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func) { - const Number2 value = dof_values_ptr[shape_func]; + const Number2 value = dof_values[shape_func]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -3153,7 +3153,7 @@ namespace internal template void do_function_laplacians( - const Number * dof_values_ptr, + const ArrayView & dof_values, const dealii::Table<2, Tensor<2, spacedim>> &shape_hessians, const FiniteElement & fe, const std::vector & shape_function_to_row_table, @@ -3200,7 +3200,7 @@ namespace internal for (unsigned int shape_func = 0; shape_func < dofs_per_cell; ++shape_func) { - const Number &value = dof_values_ptr[shape_func + mc * dofs_per_cell]; + const Number &value = dof_values[shape_func + mc * dofs_per_cell]; // For auto-differentiable numbers, the fact that a DoF value is zero // does not imply that its derivatives are zero as well. So we // can't filter by value for these number types. @@ -3648,7 +3648,8 @@ FEValuesBase::get_function_laplacians( // get function values of dofs on this cell Vector dof_values(dofs_per_cell); present_cell.get_interpolated_dof_values(fe_function, dof_values); - internal::do_function_laplacians(dof_values.begin(), + internal::do_function_laplacians(make_array_view(dof_values.begin(), + dof_values.end()), this->finite_element_output.shape_hessians, laplacians); } @@ -3672,7 +3673,8 @@ FEValuesBase::get_function_laplacians( boost::container::small_vector dof_values(dofs_per_cell); for (unsigned int i = 0; i < dofs_per_cell; ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); - internal::do_function_laplacians(dof_values.data(), + internal::do_function_laplacians(make_array_view(dof_values.begin(), + dof_values.end()), this->finite_element_output.shape_hessians, laplacians); } @@ -3696,7 +3698,7 @@ FEValuesBase::get_function_laplacians( Vector dof_values(dofs_per_cell); present_cell.get_interpolated_dof_values(fe_function, dof_values); internal::do_function_laplacians( - dof_values.begin(), + make_array_view(dof_values.begin(), dof_values.end()), this->finite_element_output.shape_hessians, *fe, this->finite_element_output.shape_function_to_row_table, @@ -3725,7 +3727,7 @@ FEValuesBase::get_function_laplacians( for (unsigned int i = 0; i < indices.size(); ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); internal::do_function_laplacians( - dof_values.data(), + make_array_view(dof_values.begin(), dof_values.end()), this->finite_element_output.shape_hessians, *fe, this->finite_element_output.shape_function_to_row_table, @@ -3755,7 +3757,7 @@ FEValuesBase::get_function_laplacians( for (unsigned int i = 0; i < indices.size(); ++i) dof_values[i] = internal::get_vector_element(fe_function, indices[i]); internal::do_function_laplacians( - dof_values.data(), + make_array_view(dof_values.begin(), dof_values.end()), this->finite_element_output.shape_hessians, *fe, this->finite_element_output.shape_function_to_row_table,