]> https://gitweb.dealii.org/ - dealii.git/commitdiff
FEPointEvaluation: check if evaluation points are provided 12169/head
authorPeter Munch <peterrmuench@gmail.com>
Mon, 10 May 2021 14:44:03 +0000 (16:44 +0200)
committerPeter Munch <peterrmuench@gmail.com>
Mon, 10 May 2021 14:44:03 +0000 (16:44 +0200)
include/deal.II/fe/fe_point_evaluation.h

index d756d7152878fec28a7b3d3fe8d1b01c5972c4e6..53d87bad3dcf00e2e0c3f21ffc8ec121e180397c 100644 (file)
@@ -25,6 +25,7 @@
 #include <deal.II/base/tensor.h>
 #include <deal.II/base/vectorization.h>
 
+#include <deal.II/fe/fe_values.h>
 #include <deal.II/fe/mapping_q_generic.h>
 
 #include <deal.II/matrix_free/evaluation_flags.h>
@@ -611,6 +612,13 @@ FEPointEvaluation<n_components, dim, spacedim>::evaluate(
   const ArrayView<const double> &                             solution_values,
   const EvaluationFlags::EvaluationFlags &                    evaluation_flag)
 {
+  if (unit_points.size() == 0) // no evaluation points provided
+    {
+      values.clear();
+      gradients.clear();
+      return;
+    }
+
   AssertDimension(solution_values.size(), fe->dofs_per_cell);
   if (((evaluation_flag & EvaluationFlags::values) ||
        (evaluation_flag & EvaluationFlags::gradients)) &&
@@ -747,6 +755,9 @@ FEPointEvaluation<n_components, dim, spacedim>::integrate(
   const ArrayView<double> &                                   solution_values,
   const EvaluationFlags::EvaluationFlags &                    integration_flags)
 {
+  if (unit_points.size() == 0) // no evaluation points provided
+    return;
+
   AssertDimension(solution_values.size(), fe->dofs_per_cell);
   if (false /*TODO*/ && (((integration_flags & EvaluationFlags::values) ||
                           (integration_flags & EvaluationFlags::gradients)) &&

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.