]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add a new assert checking for non-interpolatory base elements
authorMatthias Maier <tamiko@43-1.org>
Fri, 24 Nov 2017 17:27:47 +0000 (11:27 -0600)
committerMatthias Maier <tamiko@43-1.org>
Sat, 25 Nov 2017 18:41:48 +0000 (12:41 -0600)
include/deal.II/numerics/vector_tools.h
include/deal.II/numerics/vector_tools.templates.h

index 669709d97b1c711b62d7c0ac8ed71369916df9e1..fdc24fced431ff5231238e7a327210b9aeea62e6 100644 (file)
@@ -2981,16 +2981,6 @@ namespace VectorTools
 
   //@}
 
-  /**
-   * Exception
-   */
-  DeclExceptionMsg (ExcNonInterpolatingFE,
-                    "You are attempting an operation that requires the "
-                    "finite element involved to be 'interpolating', i.e., "
-                    "it needs to have support points. The finite element "
-                    "you are using here does not appear to have those for "
-                    "the required components.");
-
   /**
    * Exception
    */
index 2af1e9ec92e0243783e3f735c20accc5c01f972e..65b671e924e48a383c5a6d29156ff9c6ffcc7f86 100644 (file)
@@ -442,6 +442,23 @@ namespace VectorTools
 
               if (selected)
                 {
+#ifdef DEBUG
+                  // make sure that all selected base elements are indeed
+                  // interpolatory
+
+                  if (const auto fe_system =
+                        dynamic_cast<const FESystem<dim> *>(&fe[fe_index]))
+                    {
+                      const auto index =
+                        fe_system->system_to_base_index(i).first.first;
+                      Assert(fe_system->base_element(index)
+                             .has_generalized_support_points(),
+                             ExcMessage("The component mask supplied to "
+                                        "VectorTools::interpolate selects a "
+                                        "non-interpolatory element."));
+                    }
+#endif
+
                   // Add local values to the global vectors
                   ::dealii::internal::ElementAccess<VectorType>::add(dof_values[i],
                                                                      dofs_on_cell[i],

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.