From abecc20d8d68dbd7666fd678385b71c692f6b7d1 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 3 Jan 2022 11:32:07 -0500 Subject: [PATCH] Fix some more --- .../deal.II/matrix_free/evaluation_kernels.h | 80 +++++++++---------- include/deal.II/matrix_free/fe_evaluation.h | 10 +-- .../matrix_free/mapping_info.templates.h | 4 +- .../mapping_info_storage.templates.h | 6 +- source/fe/mapping_q.cc | 8 +- source/grid/tria_description.cc | 6 +- source/non_matching/fe_immersed_values.cc | 8 +- 7 files changed, 61 insertions(+), 61 deletions(-) diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index aee881a322..25b2120a0c 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -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(), 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(), data.shape_gradients_collocation_eo, AlignedVector()); - 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: diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index 2de3e862bc..ac12008a35 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -2980,7 +2980,7 @@ inline FEEvaluationBasedata == nullptr, ExcInternalError()); this->data = new internal::MatrixFreeFunctions::ShapeInfo( - Quadrature(quadrature), + Quadrature<(is_face ? dim - 1 : dim)>(quadrature), fe, fe.component_to_base_index(first_selected_component).first); @@ -7349,7 +7349,7 @@ FEEvaluationgradients_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 @@ FEEvaluationcell_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 @@ FEFaceEvaluationvalues_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 @@ FEFaceEvaluationcell_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]; diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 42627038f6..12eb72404c 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -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; diff --git a/include/deal.II/matrix_free/mapping_info_storage.templates.h b/include/deal.II/matrix_free/mapping_info_storage.templates.h index 806c337104..c48c11702f 100644 --- a/include/deal.II/matrix_free/mapping_info_storage.templates.h +++ b/include/deal.II/matrix_free/mapping_info_storage.templates.h @@ -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 diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index a1f6379e68..ad9d475c4f 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -1332,7 +1332,7 @@ MappingQ::fill_fe_immersed_surface_values( const UpdateFlags update_flags = data.update_each; const std::vector &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::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::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::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) diff --git a/source/grid/tria_description.cc b/source/grid/tria_description.cc index ceccb8d8e6..1ea4609460 100644 --- a/source/grid/tria_description.cc +++ b/source/grid/tria_description.cc @@ -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:: diff --git a/source/non_matching/fe_immersed_values.cc b/source/non_matching/fe_immersed_values.cc index f741815e85..45714218a6 100644 --- a/source/non_matching/fe_immersed_values.cc +++ b/source/non_matching/fe_immersed_values.cc @@ -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::InternalDataBase>> mapping_get_data; - if (flags & update_mapping) + if ((flags & update_mapping) != 0u) mapping_get_data = Threads::new_task(&Mapping::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 = -- 2.39.5