]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fixed lines in fe_values.cc with += operator
authorDenis Davydov <davydden@gmail.com>
Mon, 2 Mar 2015 18:08:10 +0000 (19:08 +0100)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 8 May 2015 16:23:51 +0000 (11:23 -0500)
source/fe/fe_values.cc

index 152001199b631ff4e38c21f50c6d34fcdf7c98e9..94025418a0233b53bcd70b6c542e396c719e7fd1 100644 (file)
@@ -631,7 +631,8 @@ namespace FEValuesViews
               const dealii::Tensor<order,spacedim> *shape_derivative_ptr =
                 &shape_derivatives[snc][0];
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                derivatives[q_point][comp] += value **shape_derivative_ptr++;
+                derivatives[q_point][comp] += value *
+                                              typename ProductType<Number,dealii::Tensor<order,spacedim> >::type(*shape_derivative_ptr++);
             }
           else
             for (unsigned int d=0; d<spacedim; ++d)
@@ -641,7 +642,8 @@ namespace FEValuesViews
                     &shape_derivatives[shape_function_data[shape_function].
                                        row_index[d]][0];
                   for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
-                    derivatives[q_point][d] += value **shape_derivative_ptr++;
+                    derivatives[q_point][d] += value *
+                                               typename ProductType<Number,dealii::Tensor<order,spacedim> >::type(*shape_derivative_ptr++);
                 }
         }
     }
@@ -684,7 +686,7 @@ namespace FEValuesViews
                 &shape_gradients[snc][0];
               for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
                 symmetric_gradients[q_point] += value *
-                                                symmetrize_single_row(comp, *shape_gradient_ptr++);
+                  typename ProductType<Number,dealii::SymmetricTensor<2,spacedim> >::type (symmetrize_single_row(comp, *shape_gradient_ptr++));
             }
           else
             for (unsigned int q_point=0; q_point<n_quadrature_points; ++q_point)
@@ -2360,7 +2362,8 @@ namespace internal
         const Tensor<order,spacedim> *shape_derivative_ptr
           = &shape_derivatives[shape_func][0];
         for (unsigned int point=0; point<n_quadrature_points; ++point)
-          derivatives[point] += value **shape_derivative_ptr++;
+          derivatives[point] += value *
+                                dealii::Tensor<order,spacedim,Number>(*shape_derivative_ptr++);
       }
   }
 
@@ -2428,10 +2431,12 @@ namespace internal
 
               if (quadrature_points_fastest)
                 for (unsigned int point=0; point<n_quadrature_points; ++point)
-                  derivatives[comp][point] += value **shape_derivative_ptr++;
+                  derivatives[comp][point] += value *
+                                              dealii::Tensor<order,spacedim,Number>(*shape_derivative_ptr++);
               else
                 for (unsigned int point=0; point<n_quadrature_points; ++point)
-                  derivatives[point][comp] += value **shape_derivative_ptr++;
+                  derivatives[point][comp] += value *
+                                              dealii::Tensor<order,spacedim,Number>(*shape_derivative_ptr++);
             }
           else
             for (unsigned int c=0; c<n_components; ++c)
@@ -2448,10 +2453,12 @@ namespace internal
 
                 if (quadrature_points_fastest)
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    derivatives[comp][point] += value **shape_derivative_ptr++;
+                    derivatives[comp][point] += value *
+                                                dealii::Tensor<order,spacedim,Number>(*shape_derivative_ptr++);
                 else
                   for (unsigned int point=0; point<n_quadrature_points; ++point)
-                    derivatives[point][comp] += value **shape_derivative_ptr++;
+                    derivatives[point][comp] += value *
+                                                dealii::Tensor<order,spacedim,Number>(*shape_derivative_ptr++);
               }
         }
   }

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.