]> https://gitweb.dealii.org/ - dealii.git/commitdiff
matrix-free FEEvaluation: initialize with nan
authorTimo Heister <timo.heister@gmail.com>
Tue, 19 Jul 2022 23:04:48 +0000 (19:04 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 21 Jul 2022 14:59:54 +0000 (10:59 -0400)
Initialize the internal scratch_data of FEEvaluation with signaling_nans
in debug mode.

include/deal.II/matrix_free/fe_evaluation_data.h

index 230231f44ae82c365b669f6ff5e2677e19bce4c7..da9d22100abc85a1f4edebc018fe67dea7c90dd8 100644 (file)
@@ -23,6 +23,7 @@
 #include <deal.II/base/array_view.h>
 #include <deal.II/base/exceptions.h>
 #include <deal.II/base/geometry_info.h>
+#include <deal.II/base/signaling_nan.h>
 #include <deal.II/base/smartpointer.h>
 #include <deal.II/base/std_cxx20/iota_view.h>
 #include <deal.II/base/symmetric_tensor.h>
@@ -1219,7 +1220,13 @@ FEEvaluationData<dim, Number, is_face>::set_data_pointers(
      n_quadrature_points);
 
   const unsigned int allocated_size = size_scratch_data + size_data_arrays;
+#  ifdef DEBUG
+  scratch_data_array->clear();
+  scratch_data_array->resize(allocated_size,
+                             Number(numbers::signaling_nan<ScalarNumber>()));
+#  else
   scratch_data_array->resize_fast(allocated_size);
+#  endif
   scratch_data.reinit(scratch_data_array->begin() + size_data_arrays,
                       size_scratch_data);
 

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.