]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEPointEvaluation: fix types for multiple components 13177/head
authorPeter Munch <peterrmuench@gmail.com>
Thu, 6 Jan 2022 12:45:28 +0000 (13:45 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Thu, 6 Jan 2022 12:45:28 +0000 (13:45 +0100)
include/deal.II/matrix_free/fe_point_evaluation.h

index 6f26a70e8f369af9f19270ef76c41f1af801d303..f00ee946236799f88d1bcabae4ed55c5c4a7fc17 100644 (file)
@@ -270,13 +270,13 @@ namespace internal
         return value[component];
       }
 
-      static Tensor<1, dim> &
+      static Tensor<1, dim, Number> &
       access(gradient_type &value, const unsigned int component)
       {
         return value[component];
       }
 
-      static const Tensor<1, dim> &
+      static const Tensor<1, dim, Number> &
       access(const gradient_type &value, const unsigned int component)
       {
         return value[component];
@@ -926,9 +926,12 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::evaluate(
                     Number>::set_gradient(val_and_grad.second,
                                           j,
                                           unit_gradients[i + j]);
-                  gradients[i + j] = apply_transformation(
+                  gradients[i + j] = static_cast<
+                    typename internal::FEPointEvaluation::
+                      EvaluatorTypeTraits<dim, n_components, double>::
+                        gradient_type>(apply_transformation(
                     mapping_data.inverse_jacobians[i + j].transpose(),
-                    unit_gradients[i + j]);
+                    unit_gradients[i + j]));
                 }
             }
         }
@@ -1055,8 +1058,11 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::integrate(
                 Assert(update_flags_mapping & update_inverse_jacobians,
                        ExcNotInitialized());
                 gradients[i + j] =
-                  apply_transformation(mapping_data.inverse_jacobians[i + j],
-                                       gradients[i + j]);
+                  static_cast<typename internal::FEPointEvaluation::
+                                EvaluatorTypeTraits<dim, n_components, double>::
+                                  gradient_type>(
+                    apply_transformation(mapping_data.inverse_jacobians[i + j],
+                                         gradients[i + j]));
                 internal::FEPointEvaluation::
                   EvaluatorTypeTraits<dim, n_components, Number>::get_gradient(
                     gradient, j, gradients[i + j]);

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.