From: Wolfgang Bangerth Date: Tue, 31 Oct 2017 21:49:14 +0000 (-0600) Subject: Make things work for std::complex data types. X-Git-Tag: v9.0.0-rc1~824^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8f9e76310744bd47b89a2d59408c8da809ef896;p=dealii.git Make things work for std::complex data types. --- 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