]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use dynamic_cast to find out whether a finite element is of type
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 14 Aug 2010 12:43:00 +0000 (12:43 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Sat, 14 Aug 2010 12:43:00 +0000 (12:43 +0000)
FE_Nedelec. This is more reliable since it also captures the case of
an element that may be derived from FE_Nedelec.

git-svn-id: https://svn.dealii.org/trunk@21661 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/vectors.templates.h

index f5cf92c9f1c907b360c94e0f718500fad1a43dac..918b238a7608b693a544dddd90e8c6e7e1259941 100644 (file)
@@ -38,6 +38,7 @@
 #include <fe/fe.h>
 #include <fe/fe_tools.h>
 #include <fe/fe_values.h>
+#include <fe/fe_nedelec.h>
 #include <hp/fe_values.h>
 #include <fe/mapping_q1.h>
 #include <hp/mapping_collection.h>
@@ -3664,8 +3665,7 @@ project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
                                                   // FE is a Nedelec
                                                   // element
                  typedef FiniteElement<dim> FEL;
-
-                 AssertThrow ((cell->get_fe ().get_name ().find ("FE_Nedelec<") == 0),
+                 AssertThrow (dynamic_cast<const FE_Nedelec<dim>*>(&cell->get_fe()) == 0,
                               typename FEL::ExcInterpolationNotImplemented ());
 
                  const unsigned int dofs_per_face = cell->get_fe ().dofs_per_face;
@@ -3733,8 +3733,7 @@ project_boundary_values_curl_conforming (const DoFHandler<dim>& dof_handler,
                                                   // FE is a Nedelec
                                                   // element
                  typedef FiniteElement<dim> FEL;
-
-                 AssertThrow ((cell->get_fe ().get_name ().find ("FE_Nedelec<") == 0),
+                 AssertThrow (dynamic_cast<const FE_Nedelec<dim>*>(&cell->get_fe()) == 0,
                               typename FEL::ExcInterpolationNotImplemented ());
 
                  const unsigned int superdegree = cell->get_fe ().degree;

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.