From: Matthias Maier Date: Fri, 24 Nov 2017 17:27:47 +0000 (-0600) Subject: add a new assert checking for non-interpolatory base elements X-Git-Tag: v9.0.0-rc1~728^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f254953ff606d6a0137016c4c7b5eece9abcdffa;p=dealii.git add a new assert checking for non-interpolatory base elements --- diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index 669709d97b..fdc24fced4 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -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 */ diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 2af1e9ec92..65b671e924 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -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 *>(&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::add(dof_values[i], dofs_on_cell[i],