]> https://gitweb.dealii.org/ - dealii.git/commitdiff
MappingQ: don't require update_JxW_values or update_normal_vectors 15914/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 22 Aug 2023 12:30:33 +0000 (14:30 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 22 Aug 2023 12:32:25 +0000 (14:32 +0200)
source/fe/mapping_q.cc

index 5dcc16e8f2bd4d7ca640783bceb31e9c4e4ad6b6..5563f8a1717b39058e80142a7768c924eff34b61 100644 (file)
@@ -907,7 +907,9 @@ MappingQ<dim, spacedim>::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<dim, spacedim>::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)

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.