From: Bruno Turcksin Date: Wed, 13 May 2020 02:11:32 +0000 (+0000) Subject: Silence deprecation warnings X-Git-Tag: v9.3.0-rc1~1651^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fcf3d06b934ca4be44e06219d458569a86e1f0c;p=dealii.git Silence deprecation warnings --- diff --git a/include/deal.II/matrix_free/cuda_fe_evaluation.h b/include/deal.II/matrix_free/cuda_fe_evaluation.h index 030d31108b..44a3d4cb00 100644 --- a/include/deal.II/matrix_free/cuda_fe_evaluation.h +++ b/include/deal.II/matrix_free/cuda_fe_evaluation.h @@ -515,7 +515,8 @@ namespace CUDAWrappers FEEvaluation:: get_value() const { - return get_value(internal::compute_index()); + const unsigned int q_point = internal::compute_index(); + return values[q_point]; } @@ -551,7 +552,8 @@ namespace CUDAWrappers FEEvaluation:: get_dof_value() const { - return get_dof_value(internal::compute_index()); + const unsigned int dof = internal::compute_index(); + return values[dof]; } @@ -579,7 +581,8 @@ namespace CUDAWrappers FEEvaluation:: submit_value(const value_type &val_in) { - submit_value(val_in, internal::compute_index()); + const unsigned int q_point = internal::compute_index(); + values[q_point] = val_in * JxW[q_point]; } @@ -607,7 +610,8 @@ namespace CUDAWrappers FEEvaluation:: submit_dof_value(const value_type &val_in) { - submit_dof_value(val_in, internal::compute_index()); + const unsigned int dof = internal::compute_index(); + values[dof] = val_in; } @@ -660,7 +664,20 @@ namespace CUDAWrappers static_assert(n_components_ == 1, "This function only supports FE with one \ components"); - return get_gradient(internal::compute_index()); + // TODO optimize if the mesh is uniform + const unsigned int q_point = internal::compute_index(); + const Number * inv_jacobian = &inv_jac[q_point]; + gradient_type grad; + for (int d_1 = 0; d_1 < dim; ++d_1) + { + Number tmp = 0.; + for (int d_2 = 0; d_2 < dim; ++d_2) + tmp += inv_jacobian[padding_length * n_cells * (dim * d_2 + d_1)] * + gradients[d_2][q_point]; + grad[d_1] = tmp; + } + + return grad; } @@ -697,7 +714,17 @@ namespace CUDAWrappers FEEvaluation:: submit_gradient(const gradient_type &grad_in) { - submit_gradient(grad_in, internal::compute_index()); + // TODO optimize if the mesh is uniform + const unsigned int q_point = internal::compute_index(); + const Number * inv_jacobian = &inv_jac[q_point]; + for (int d_1 = 0; d_1 < dim; ++d_1) + { + Number tmp = 0.; + for (int d_2 = 0; d_2 < dim; ++d_2) + tmp += inv_jacobian[n_cells * padding_length * (dim * d_1 + d_2)] * + grad_in[d_2]; + gradients[d_1][q_point] = tmp * JxW[q_point]; + } }