]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Move the loop over the dofs into FE_Poly::correct_third_derivatives.
authorSimon Sticko <simon@sticko.se>
Fri, 14 Feb 2020 10:33:40 +0000 (11:33 +0100)
committerSimon Sticko <simon@sticko.se>
Sun, 23 Feb 2020 07:26:44 +0000 (08:26 +0100)
include/deal.II/fe/fe_poly.h
include/deal.II/fe/fe_poly.templates.h
source/fe/fe_poly.cc

index 31628d934a0c84f23e5149c78d3335b236f786c6..77efe6a4a57b4aa4bbfaf7e39889992941535aae 100644 (file)
@@ -506,8 +506,7 @@ protected:
       &output_data,
     const internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
       &                mapping_data,
-    const unsigned int n_q_points,
-    const unsigned int dof) const;
+    const unsigned int n_q_points) const;
 
 
   /**
index 890a6e7a2d1c4e46eeff42536384b7179ed8bb37..c8a5d91d40712d3a8d1b94e6936eada10ec35896 100644 (file)
@@ -281,11 +281,7 @@ FE_Poly<PolynomialType, dim, spacedim>::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<PolynomialType, dim, spacedim>::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<PolynomialType, dim, spacedim>::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<PolynomialType, dim, spacedim>::correct_third_derivatives(
     &output_data,
   const internal::FEValuesImplementation::MappingRelatedData<dim, spacedim>
     &                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
index 016cd82715cf27b40d38f3c4b7af328c1784b24e..9847a85498dc5cc4d0ec674bc2abbc83fb2229cb 100644 (file)
@@ -83,11 +83,7 @@ FE_Poly<TensorProductPolynomials<1>, 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<TensorProductPolynomials<2>, 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());
     }
 }
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.