From c8f9e76310744bd47b89a2d59408c8da809ef896 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 31 Oct 2017 15:49:14 -0600 Subject: [PATCH] Make things work for std::complex data types. --- .../deal.II/numerics/vector_tools.templates.h | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index dc42b5bfab..850e3ff34e 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -133,17 +133,19 @@ namespace VectorTools const auto &jacobians = fe_values_jacobians.get_present_fe_values().get_jacobians(); - auto shifted_view = boost::make_iterator_range( - std::begin(function_values[i]) + offset, - std::begin(function_values[i]) + offset + dim); - std::array old_value; - std::copy(std::begin(shifted_view), - std::end(shifted_view), - std::begin(old_value)); + const ArrayView + source (&function_values[i][0] + offset, dim); + + Tensor<1,dim,typename ProductType::type> + destination; // value[m] <- sum jacobian_transpose[m][n] * old_value[n]: TensorAccessors::contract<1, 2, 1, dim>( - shifted_view, jacobians[i].transpose(), old_value); + destination, jacobians[i].transpose(), source); + + // now copy things back into the input=output vector + for (unsigned int d=0; d old_value; - std::copy(std::begin(shifted_view), - std::end(shifted_view), - std::begin(old_value)); + const ArrayView + source (&function_values[i][0] + offset, dim); + + Tensor<1,dim,typename ProductType::type> + destination; // value[m] <- sum inverse_jacobians[m][n] * old_value[n]: TensorAccessors::contract<1, 2, 1, dim>( - shifted_view, inverse_jacobians[i], old_value); + destination, inverse_jacobians[i], source); + destination *= jacobians[i].determinant(); - for (unsigned int j = 0; j < dim; ++j) - shifted_view[j] *= jacobians[i].determinant(); + // now copy things back into the input=output vector + for (unsigned int d=0; d