From: Peter Munch Date: Tue, 22 Aug 2023 12:30:33 +0000 (+0200) Subject: MappingQ: don't require update_JxW_values or update_normal_vectors X-Git-Tag: relicensing~567^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F15914%2Fhead;p=dealii.git MappingQ: don't require update_JxW_values or update_normal_vectors --- 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)