]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some more 12265/head
authorDaniel Arndt <arndtd@ornl.gov>
Mon, 3 Jan 2022 16:32:07 +0000 (11:32 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 11 Jan 2022 17:36:15 +0000 (12:36 -0500)
include/deal.II/matrix_free/evaluation_kernels.h
include/deal.II/matrix_free/fe_evaluation.h
include/deal.II/matrix_free/mapping_info.templates.h
include/deal.II/matrix_free/mapping_info_storage.templates.h
source/fe/mapping_q.cc
source/grid/tria_description.cc
source/non_matching/fe_immersed_values.cc

index aee881a3224e4d0139ba925f9b9e982ada0f3015..25b2120a0cc6758aa55af42161d3ffbecd195250 100644 (file)
@@ -545,10 +545,10 @@ namespace internal
                     eval0.template gradients<0, false, false>(gradients_quad,
                                                               values_dofs);
                 }
-              if (integration_flag & EvaluationFlags::hessians)
+              if ((integration_flag & EvaluationFlags::hessians) != 0u)
                 {
-                  if (integration_flag & EvaluationFlags::values ||
-                      integration_flag & EvaluationFlags::gradients ||
+                  if ((integration_flag & EvaluationFlags::values) != 0u ||
+                      (integration_flag & EvaluationFlags::gradients) != 0u ||
                       add_into_values_array == true)
                     eval0.template hessians<0, false, true>(hessians_quad,
                                                             values_dofs);
@@ -591,13 +591,13 @@ namespace internal
                   eval1.template values<1, false, false>(gradients_quad, temp1);
                   eval0.template gradients<0, false, true>(temp1, values_dofs);
                 }
-              if (integration_flag & EvaluationFlags::hessians)
+              if ((integration_flag & EvaluationFlags::hessians) != 0u)
                 {
                   // grad xx
                   eval1.template values<1, false, false>(hessians_quad, temp1);
 
-                  if (integration_flag & EvaluationFlags::values ||
-                      integration_flag & EvaluationFlags::gradients ||
+                  if ((integration_flag & EvaluationFlags::values) != 0u ||
+                      (integration_flag & EvaluationFlags::gradients) != 0u ||
                       add_into_values_array == true)
                     eval0.template hessians<0, false, true>(temp1, values_dofs);
                   else
@@ -658,14 +658,14 @@ namespace internal
                   eval1.template values<1, false, false>(temp1, temp2);
                   eval0.template gradients<0, false, true>(temp2, values_dofs);
                 }
-              if (integration_flag & EvaluationFlags::hessians)
+              if ((integration_flag & EvaluationFlags::hessians) != 0u)
                 {
                   // grad xx
                   eval2.template values<2, false, false>(hessians_quad, temp1);
                   eval1.template values<1, false, false>(temp1, temp2);
 
-                  if (integration_flag & EvaluationFlags::values ||
-                      integration_flag & EvaluationFlags::gradients ||
+                  if ((integration_flag & EvaluationFlags::values) != 0u ||
+                      (integration_flag & EvaluationFlags::gradients) != 0u ||
                       add_into_values_array == true)
                     eval0.template hessians<0, false, true>(temp2, values_dofs);
                   else
@@ -1377,7 +1377,7 @@ namespace internal
 
     for (unsigned int c = 0; c < n_components; ++c)
       {
-        if (evaluation_flag & EvaluationFlags::values)
+        if ((evaluation_flag & EvaluationFlags::values) != 0u)
           for (unsigned int i = 0; i < n_points; ++i)
             fe_eval.begin_values()[n_points * c + i] =
               values_dofs[n_points * c + i];
@@ -1414,8 +1414,8 @@ namespace internal
       eval(AlignedVector<Number>(),
            shape.shape_gradients_collocation_eo,
            shape.shape_hessians_collocation_eo);
-    if (evaluation_flag &
-        (EvaluationFlags::gradients | EvaluationFlags::hessians))
+    if ((evaluation_flag &
+         (EvaluationFlags::gradients | EvaluationFlags::hessians)) != 0u)
       {
         eval.template gradients<0, true, false>(values_dofs, gradients_quad);
         if (dim > 1)
@@ -1467,7 +1467,7 @@ namespace internal
 
     for (unsigned int c = 0; c < n_components; ++c)
       {
-        if (integration_flag & EvaluationFlags::values)
+        if ((integration_flag & EvaluationFlags::values) != 0u)
           {
             if (add_into_values_array)
               for (unsigned int i = 0; i < n_points; ++i)
@@ -1486,7 +1486,7 @@ namespace internal
                      fe_eval.begin_hessians() +
                        c * dim * (dim + 1) / 2 * n_points,
                      add_into_values_array ||
-                       (integration_flag & EvaluationFlags::values));
+                       ((integration_flag & EvaluationFlags::values) != 0u));
       }
   }
 
@@ -1515,7 +1515,7 @@ namespace internal
            shape.shape_hessians_collocation_eo);
     constexpr std::size_t n_points = Utilities::pow(fe_degree + 1, dim);
 
-    if (integration_flag & EvaluationFlags::hessians)
+    if ((integration_flag & EvaluationFlags::hessians) != 0u)
       {
         // diagonal
         // grad xx
@@ -1573,16 +1573,16 @@ namespace internal
         // if we did not integrate gradients, set the last slot to zero
         // which was not touched before, in order to avoid the if
         // statement in the gradients loop below
-        if (!(integration_flag & EvaluationFlags::gradients))
+        if ((integration_flag & EvaluationFlags::gradients) == 0u)
           for (unsigned int q = 0; q < n_points; ++q)
             gradients_quad[(dim - 1) * n_points + q] = Number();
       }
 
-    if (integration_flag &
-        (EvaluationFlags::gradients | EvaluationFlags::hessians))
+    if ((integration_flag &
+         (EvaluationFlags::gradients | EvaluationFlags::hessians)) != 0u)
       {
         if (add_into_values_array ||
-            integration_flag & EvaluationFlags::hessians)
+            (integration_flag & EvaluationFlags::hessians) != 0u)
           eval.template gradients<0, false, true>(gradients_quad, values_dofs);
         else
           eval.template gradients<0, false, false>(gradients_quad, values_dofs);
@@ -2066,8 +2066,8 @@ namespace internal
       // keep a copy of the original pointer for the case of the Hessians
       Number *values_dofs_ptr = values_dofs;
 
-      if (evaluation_flag & EvaluationFlags::values &&
-          !(evaluation_flag & EvaluationFlags::gradients))
+      if ((evaluation_flag & EvaluationFlags::values) != 0u &&
+          ((evaluation_flag & EvaluationFlags::gradients) == 0u))
         for (unsigned int c = 0; c < n_components; ++c)
           {
             switch (dim)
@@ -2093,7 +2093,7 @@ namespace internal
             values_dofs += 3 * n_dofs;
             values_quad += n_q_points;
           }
-      else if (evaluation_flag & EvaluationFlags::gradients)
+      else if ((evaluation_flag & EvaluationFlags::gradients) != 0u)
         for (unsigned int c = 0; c < n_components; ++c)
           {
             switch (dim)
@@ -2134,7 +2134,7 @@ namespace internal
                                                                gradients_quad +
                                                                  n_q_points);
 
-                      if (evaluation_flag & EvaluationFlags::values)
+                      if ((evaluation_flag & EvaluationFlags::values) != 0u)
                         eval1.template values<1, true, false>(scratch_data,
                                                               values_quad);
                     }
@@ -2151,7 +2151,7 @@ namespace internal
                                                           n_q_points);
                   eval0.template gradients<0, true, false>(values_dofs,
                                                            gradients_quad);
-                  if (evaluation_flag & EvaluationFlags::values)
+                  if ((evaluation_flag & EvaluationFlags::values) != 0u)
                     eval0.template values<0, true, false>(values_dofs,
                                                           values_quad);
                   break;
@@ -2167,7 +2167,7 @@ namespace internal
             gradients_quad += dim * n_q_points;
           }
 
-      if (evaluation_flag & EvaluationFlags::hessians)
+      if ((evaluation_flag & EvaluationFlags::hessians) != 0u)
         {
           values_dofs = values_dofs_ptr;
           for (unsigned int c = 0; c < n_components; ++c)
@@ -2268,8 +2268,8 @@ namespace internal
       // keep a copy of the original pointer for the case of the Hessians
       Number *values_dofs_ptr = values_dofs;
 
-      if (integration_flag & EvaluationFlags::values &&
-          !(integration_flag & EvaluationFlags::gradients))
+      if ((integration_flag & EvaluationFlags::values) != 0u &&
+          (integration_flag & EvaluationFlags::gradients) == 0u)
         for (unsigned int c = 0; c < n_components; ++c)
           {
             switch (dim)
@@ -2293,7 +2293,7 @@ namespace internal
             values_dofs += 3 * n_dofs;
             values_quad += n_q_points;
           }
-      else if (integration_flag & EvaluationFlags::gradients)
+      else if ((integration_flag & EvaluationFlags::gradients) != 0u)
         for (unsigned int c = 0; c < n_components; ++c)
           {
             switch (dim)
@@ -2318,7 +2318,7 @@ namespace internal
                         eval_grad(AlignedVector<Number>(),
                                   data.shape_gradients_collocation_eo,
                                   AlignedVector<Number>());
-                      if (integration_flag & EvaluationFlags::values)
+                      if ((integration_flag & EvaluationFlags::values) != 0u)
                         eval_grad.template gradients<1, false, true>(
                           gradients_quad + n_q_points, values_quad);
                       else
@@ -2333,7 +2333,7 @@ namespace internal
                     }
                   else
                     {
-                      if (integration_flag & EvaluationFlags::values)
+                      if ((integration_flag & EvaluationFlags::values) != 0u)
                         {
                           eval1.template values<1, false, false>(values_quad,
                                                                  scratch_data);
@@ -2361,7 +2361,7 @@ namespace internal
                                                          values_dofs + n_dofs);
                   eval0.template gradients<0, false, false>(gradients_quad,
                                                             values_dofs);
-                  if (integration_flag & EvaluationFlags::values)
+                  if ((integration_flag & EvaluationFlags::values) != 0u)
                     eval0.template values<0, false, true>(values_quad,
                                                           values_dofs);
                   break;
@@ -2377,7 +2377,7 @@ namespace internal
             gradients_quad += dim * n_q_points;
           }
 
-      if (integration_flag & EvaluationFlags::hessians)
+      if ((integration_flag & EvaluationFlags::hessians) != 0u)
         {
           values_dofs = values_dofs_ptr;
           for (unsigned int c = 0; c < n_components; ++c)
@@ -2388,8 +2388,8 @@ namespace internal
                     // grad xx
                     eval1.template values<1, false, false>(hessians_quad,
                                                            scratch_data);
-                    if (integration_flag &
-                        (EvaluationFlags::values | EvaluationFlags::gradients))
+                    if ((integration_flag & (EvaluationFlags::values |
+                                             EvaluationFlags::gradients)) != 0u)
                       eval0.template hessians<0, false, true>(scratch_data,
                                                               values_dofs);
                     else
@@ -2422,7 +2422,7 @@ namespace internal
                     eval1.template values<1, false, false>(hessians_quad +
                                                              4 * n_q_points,
                                                            scratch_data);
-                    if (integration_flag & EvaluationFlags::gradients)
+                    if ((integration_flag & EvaluationFlags::gradients) != 0u)
                       eval0.template gradients<0, false, true>(scratch_data,
                                                                values_dofs +
                                                                  n_dofs);
@@ -2441,8 +2441,8 @@ namespace internal
                     break;
                   case 2:
                     // grad xx
-                    if (integration_flag &
-                        (EvaluationFlags::values | EvaluationFlags::gradients))
+                    if ((integration_flag & (EvaluationFlags::values |
+                                             EvaluationFlags::gradients)) != 0u)
                       eval0.template hessians<0, false, true>(hessians_quad,
                                                               values_dofs);
                     else
@@ -2453,7 +2453,7 @@ namespace internal
                     eval0.template values<0, false, false>(
                       hessians_quad + n_q_points, values_dofs + 2 * n_dofs);
                     // grad xy
-                    if (integration_flag & EvaluationFlags::gradients)
+                    if ((integration_flag & EvaluationFlags::gradients) != 0u)
                       eval0.template gradients<0, false, true>(
                         hessians_quad + 2 * n_q_points, values_dofs + n_dofs);
                     else
@@ -2462,9 +2462,9 @@ namespace internal
                     break;
                   case 1:
                     values_dofs[2] = hessians_quad[0];
-                    if (!(integration_flag & EvaluationFlags::values))
+                    if ((integration_flag & EvaluationFlags::values) == 0u)
                       values_dofs[0] = 0;
-                    if (!(integration_flag & EvaluationFlags::gradients))
+                    if ((integration_flag & EvaluationFlags::gradients) == 0u)
                       values_dofs[1] = 0;
                     break;
                   default:
index 2de3e862bc594e9314239c0de191a5824e34eedb..ac12008a35112966fffc075bab29b1dcb44fac97 100644 (file)
@@ -2980,7 +2980,7 @@ inline FEEvaluationBase<dim,
   Assert(this->data == nullptr, ExcInternalError());
   this->data =
     new internal::MatrixFreeFunctions::ShapeInfo<VectorizedArrayType>(
-      Quadrature<dim - is_face>(quadrature),
+      Quadrature<(is_face ? dim - 1 : dim)>(quadrature),
       fe,
       fe.component_to_base_index(first_selected_component).first);
 
@@ -7349,7 +7349,7 @@ FEEvaluation<dim,
   if ((integration_flag & EvaluationFlags::gradients) != 0u)
     Assert(this->gradients_quad_submitted == true,
            internal::ExcAccessToUninitializedField());
-  if (integration_flag & EvaluationFlags::hessians)
+  if ((integration_flag & EvaluationFlags::hessians) != 0u)
     Assert(this->hessians_quad_submitted == true,
            internal::ExcAccessToUninitializedField());
 #  endif
@@ -7368,7 +7368,7 @@ FEEvaluation<dim,
       (this->cell_type > internal::MatrixFreeFunctions::affine))
     {
       unsigned int size = n_components * dim * n_q_points;
-      if (integration_flag & EvaluationFlags::gradients)
+      if ((integration_flag & EvaluationFlags::gradients) != 0u)
         {
           for (unsigned int i = 0; i < size; ++i)
             this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
@@ -7857,7 +7857,7 @@ FEFaceEvaluation<dim,
     this->values_quad_initialized = true;
   if ((evaluation_flag_actual & EvaluationFlags::gradients) != 0u)
     this->gradients_quad_initialized = true;
-  if (evaluation_flag_actual & EvaluationFlags::hessians)
+  if ((evaluation_flag_actual & EvaluationFlags::hessians) != 0u)
     this->hessians_quad_initialized = true;
 #  endif
 }
@@ -7966,7 +7966,7 @@ FEFaceEvaluation<dim,
       (this->cell_type > internal::MatrixFreeFunctions::affine))
     {
       unsigned int size = n_components * dim * n_q_points;
-      if (integration_flag & EvaluationFlags::gradients)
+      if ((integration_flag & EvaluationFlags::gradients) != 0u)
         {
           for (unsigned int i = 0; i < size; ++i)
             this->gradients_quad[i] += this->gradients_from_hessians_quad[i];
index 42627038f6bddc1c26e7ca3511d6da7ae33f79e7..12eb72404c10c3bd318266d4573e940bb34f1e3c 100644 (file)
@@ -92,8 +92,8 @@ namespace internal
           update_quadrature_points) != 0u ?
            update_quadrature_points :
            update_default) |
-        ((update_flags_inner_faces | update_flags_boundary_faces) &
-             (update_jacobian_grads | update_hessians) ?
+        (((update_flags_inner_faces | update_flags_boundary_faces) &
+          (update_jacobian_grads | update_hessians)) != 0u ?
            update_jacobian_grads :
            update_default) |
         update_normal_vectors | update_JxW_values | update_jacobians;
index 806c337104054bc3ed971015d78185eaeeca55a3..c48c11702f1735483d022885fafe13b45da0311f 100644 (file)
@@ -134,11 +134,11 @@ namespace internal
       // for Hessian information, need inverse Jacobians and the derivative of
       // Jacobians (these two together will give use the gradients of the
       // inverse Jacobians, which is what we need)
-      if (update_flags & update_hessians ||
-          update_flags & update_jacobian_grads)
+      if ((update_flags & update_hessians) != 0u ||
+          (update_flags & update_jacobian_grads) != 0u)
         new_flags |= update_jacobian_grads;
 
-      if (update_flags & update_quadrature_points)
+      if ((update_flags & update_quadrature_points) != 0u)
         new_flags |= update_quadrature_points;
 
       // there is one more thing: if we have a quadrature formula with only
index a1f6379e6846629a8fe134967c71a3dd60bad51c..ad9d475c4f28e329bf71a54dca36c04eb3a8c7e6 100644 (file)
@@ -1332,7 +1332,7 @@ MappingQ<dim, spacedim>::fill_fe_immersed_surface_values(
   const UpdateFlags          update_flags = data.update_each;
   const std::vector<double> &weights      = quadrature.get_weights();
 
-  if (update_flags & (update_normal_vectors | update_JxW_values))
+  if ((update_flags & (update_normal_vectors | update_JxW_values)) != 0u)
     {
       AssertDimension(output_data.JxW_values.size(), n_q_points);
 
@@ -1364,7 +1364,7 @@ MappingQ<dim, spacedim>::fill_fe_immersed_surface_values(
 
           output_data.JxW_values[point] = weights[point] * det * normal.norm();
 
-          if (update_flags & update_normal_vectors)
+          if ((update_flags & update_normal_vectors) != 0u)
             {
               normal /= normal.norm();
               output_data.normal_vectors[point] = normal;
@@ -1373,7 +1373,7 @@ MappingQ<dim, spacedim>::fill_fe_immersed_surface_values(
     }
 
   // copy values from InternalData to vector given by reference
-  if (update_flags & update_jacobians)
+  if ((update_flags & update_jacobians) != 0u)
     {
       AssertDimension(output_data.jacobians.size(), n_q_points);
       for (unsigned int point = 0; point < n_q_points; ++point)
@@ -1381,7 +1381,7 @@ MappingQ<dim, spacedim>::fill_fe_immersed_surface_values(
     }
 
   // copy values from InternalData to vector given by reference
-  if (update_flags & update_inverse_jacobians)
+  if ((update_flags & update_inverse_jacobians) != 0u)
     {
       AssertDimension(output_data.inverse_jacobians.size(), n_q_points);
       for (unsigned int point = 0; point < n_q_points; ++point)
index ceccb8d8e662bddac86261b9f0cad7facb1ba7fe..1ea4609460e1c627d4b2930a343f15feb4ae7ac0 100644 (file)
@@ -424,9 +424,9 @@ namespace TriangulationDescription
           , level_subdomain_id_function(level_subdomain_id_function)
           , comm(comm)
           , settings(settings)
-          , construct_multigrid(
-              settings &
-              TriangulationDescription::Settings::construct_multigrid_hierarchy)
+          , construct_multigrid((settings & TriangulationDescription::Settings::
+                                              construct_multigrid_hierarchy) !=
+                                0u)
         {
           Assert(
             !(settings & TriangulationDescription::Settings::
index f741815e8590cb7933bffb708af07d2b9a9310e2..45714218a66bd43b61231fc9593abb6f26752796 100644 (file)
@@ -176,11 +176,11 @@ namespace NonMatching
   {
     UpdateFlags flags = this->compute_update_flags(update_flags);
 
-    if (flags & (update_JxW_values | update_normal_vectors))
+    if ((flags & (update_JxW_values | update_normal_vectors)) != 0u)
       flags |= update_covariant_transformation;
 
     // Initialize the base classes.
-    if (flags & update_mapping)
+    if ((flags & update_mapping) != 0u)
       this->mapping_output.initialize(this->n_quadrature_points, flags);
     this->finite_element_output.initialize(this->n_quadrature_points,
                                            *this->fe,
@@ -200,7 +200,7 @@ namespace NonMatching
 
     Threads::Task<std::unique_ptr<typename Mapping<dim>::InternalDataBase>>
       mapping_get_data;
-    if (flags & update_mapping)
+    if ((flags & update_mapping) != 0u)
       mapping_get_data = Threads::new_task(&Mapping<dim>::get_data,
                                            *this->mapping,
                                            flags,
@@ -210,7 +210,7 @@ namespace NonMatching
 
     // Then collect answers from the two task above.
     this->fe_data = std::move(fe_get_data.return_value());
-    if (flags & update_mapping)
+    if ((flags & update_mapping) != 0u)
       this->mapping_data = std::move(mapping_get_data.return_value());
     else
       this->mapping_data =

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.