From 775187c81cde19dba481f4aa68d25c06902089a3 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Tue, 22 Aug 2023 14:30:33 +0200 Subject: [PATCH] MappingQ: don't require update_JxW_values or update_normal_vectors --- source/fe/mapping_q.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/fe/mapping_q.cc b/source/fe/mapping_q.cc index 5dcc16e8f2..5563f8a171 100644 --- a/source/fe/mapping_q.cc +++ b/source/fe/mapping_q.cc @@ -907,7 +907,9 @@ MappingQ::fill_fe_values( if (update_flags & (update_normal_vectors | update_JxW_values)) { - AssertDimension(output_data.JxW_values.size(), n_q_points); + Assert(!(update_flags & update_JxW_values) || + (output_data.JxW_values.size() == n_q_points), + ExcDimensionMismatch(output_data.JxW_values.size(), n_q_points)); Assert(!(update_flags & update_normal_vectors) || (output_data.normal_vectors.size() == n_q_points), @@ -950,8 +952,9 @@ MappingQ::fill_fe_values( for (unsigned int j = 0; j < dim; ++j) G[i][j] = DX_t[i] * DX_t[j]; - output_data.JxW_values[point] = - std::sqrt(determinant(G)) * weights[point]; + if (update_flags & update_JxW_values) + output_data.JxW_values[point] = + std::sqrt(determinant(G)) * weights[point]; if (computed_cell_similarity == CellSimilarity::inverted_translation) -- 2.39.5