From: Simon Sticko Date: Fri, 14 Feb 2020 10:33:40 +0000 (+0100) Subject: Move the loop over the dofs into FE_Poly::correct_third_derivatives. X-Git-Tag: v9.2.0-rc1~401^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2155e352091e731cfb602d78e2f2130e7f80838;p=dealii.git Move the loop over the dofs into FE_Poly::correct_third_derivatives. --- diff --git a/include/deal.II/fe/fe_poly.h b/include/deal.II/fe/fe_poly.h index 31628d934a..77efe6a4a5 100644 --- a/include/deal.II/fe/fe_poly.h +++ b/include/deal.II/fe/fe_poly.h @@ -506,8 +506,7 @@ protected: &output_data, const internal::FEValuesImplementation::MappingRelatedData & mapping_data, - const unsigned int n_q_points, - const unsigned int dof) const; + const unsigned int n_q_points) const; /** diff --git a/include/deal.II/fe/fe_poly.templates.h b/include/deal.II/fe/fe_poly.templates.h index 890a6e7a2d..c8a5d91d40 100644 --- a/include/deal.II/fe/fe_poly.templates.h +++ b/include/deal.II/fe/fe_poly.templates.h @@ -281,11 +281,7 @@ FE_Poly::fill_fe_values( make_array_view(output_data.shape_3rd_derivatives, k)); - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives(output_data, - mapping_data, - quadrature.size(), - k); + correct_third_derivatives(output_data, mapping_data, quadrature.size()); } } @@ -368,11 +364,7 @@ FE_Poly::fill_fe_face_values( make_array_view(output_data.shape_3rd_derivatives, k)); - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives(output_data, - mapping_data, - quadrature.size(), - k); + correct_third_derivatives(output_data, mapping_data, quadrature.size()); } } @@ -458,11 +450,7 @@ FE_Poly::fill_fe_subface_values( make_array_view(output_data.shape_3rd_derivatives, k)); - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives(output_data, - mapping_data, - quadrature.size(), - k); + correct_third_derivatives(output_data, mapping_data, quadrature.size()); } } @@ -494,26 +482,26 @@ FE_Poly::correct_third_derivatives( &output_data, const internal::FEValuesImplementation::MappingRelatedData & mapping_data, - const unsigned int n_q_points, - const unsigned int dof) const + const unsigned int n_q_points) const { - for (unsigned int i = 0; i < n_q_points; ++i) - for (unsigned int j = 0; j < spacedim; ++j) - for (unsigned int k = 0; k < spacedim; ++k) - for (unsigned int l = 0; l < spacedim; ++l) - for (unsigned int m = 0; m < spacedim; ++m) - { - output_data.shape_3rd_derivatives[dof][i][j][k][l] -= - (mapping_data.jacobian_pushed_forward_grads[i][m][j][l] * - output_data.shape_hessians[dof][i][k][m]) + - (mapping_data.jacobian_pushed_forward_grads[i][m][k][l] * - output_data.shape_hessians[dof][i][j][m]) + - (mapping_data.jacobian_pushed_forward_grads[i][m][j][k] * - output_data.shape_hessians[dof][i][l][m]) + - (mapping_data - .jacobian_pushed_forward_2nd_derivatives[i][m][j][k][l] * - output_data.shape_gradients[dof][i][m]); - } + for (unsigned int dof = 0; dof < this->dofs_per_cell; ++dof) + for (unsigned int i = 0; i < n_q_points; ++i) + for (unsigned int j = 0; j < spacedim; ++j) + for (unsigned int k = 0; k < spacedim; ++k) + for (unsigned int l = 0; l < spacedim; ++l) + for (unsigned int m = 0; m < spacedim; ++m) + { + output_data.shape_3rd_derivatives[dof][i][j][k][l] -= + (mapping_data.jacobian_pushed_forward_grads[i][m][j][l] * + output_data.shape_hessians[dof][i][k][m]) + + (mapping_data.jacobian_pushed_forward_grads[i][m][k][l] * + output_data.shape_hessians[dof][i][j][m]) + + (mapping_data.jacobian_pushed_forward_grads[i][m][j][k] * + output_data.shape_hessians[dof][i][l][m]) + + (mapping_data + .jacobian_pushed_forward_2nd_derivatives[i][m][j][k][l] * + output_data.shape_gradients[dof][i][m]); + } } namespace internal diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc index 016cd82715..9847a85498 100644 --- a/source/fe/fe_poly.cc +++ b/source/fe/fe_poly.cc @@ -83,11 +83,7 @@ FE_Poly, 1, 2>::fill_fe_values( make_array_view(output_data.shape_3rd_derivatives, k)); - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives(output_data, - mapping_data, - quadrature.size(), - k); + correct_third_derivatives(output_data, mapping_data, quadrature.size()); } } @@ -147,11 +143,7 @@ FE_Poly, 2, 3>::fill_fe_values( make_array_view(output_data.shape_3rd_derivatives, k)); - for (unsigned int k = 0; k < this->dofs_per_cell; ++k) - correct_third_derivatives(output_data, - mapping_data, - quadrature.size(), - k); + correct_third_derivatives(output_data, mapping_data, quadrature.size()); } }