From: Maximilian Bergbauer Date: Thu, 4 May 2023 14:57:08 +0000 (+0200) Subject: Fix do_reinit of FEPointEvaluation for empty unit_points X-Git-Tag: v9.5.0-rc1~265^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93d29039a70925758f82aef2cce39562b8e5d4ac;p=dealii.git Fix do_reinit of FEPointEvaluation for empty unit_points --- diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index 00efffd856..eb7a779d5a 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -1495,8 +1495,18 @@ FEPointEvaluation::do_reinit() current_face_number); const_cast(n_q_points) = - n_q_points_scalar / n_lanes_user_interface + - (n_q_points_scalar % n_lanes_user_interface > 0 ? 1 : 0); + (n_q_points_scalar + n_lanes_user_interface - 1) / n_lanes_user_interface; + + if (update_flags & update_values) + values.resize(n_q_points, numbers::signaling_nan()); + if (update_flags & update_gradients) + gradients.resize(n_q_points, numbers::signaling_nan()); + + if (n_q_points == 0) + { + is_reinitialized = true; + return; + } // set unit point pointer const unsigned int unit_point_offset = @@ -1521,11 +1531,6 @@ FEPointEvaluation::do_reinit() if (update_flags_mapping & UpdateFlags::update_JxW_values) JxW_ptr = mapping_info->get_JxW(data_offset); - if (update_flags & update_values) - values.resize(n_q_points, numbers::signaling_nan()); - if (update_flags & update_gradients) - gradients.resize(n_q_points, numbers::signaling_nan()); - if (fast_path && !polynomials_are_hat_functions) { const std::size_t n_batches =