]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add an Assert for DoFHandler::get_finite_element()
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 20 Aug 2017 10:42:06 +0000 (12:42 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 20 Aug 2017 11:16:45 +0000 (13:16 +0200)
include/deal.II/dofs/dof_handler.h
include/deal.II/hp/dof_handler.h

index 2d4f0aa5a26fb258b51e44394ac0e1cb7042572a..7fa090decb38ea4271fc3321a600c006d707f676 100644 (file)
@@ -836,9 +836,11 @@ public:
 
   /**
    * Return a constant reference to the selected finite element object.
+   * Since there is only one FiniteElement @index must be equal to zero
+   * which is also the default value.
    */
   const FiniteElement<dim,spacedim> &
-  get_finite_element (const unsigned int number=0) const;
+  get_finite_element (const unsigned int index=0) const;
 
   /**
     * Return a constant reference to the set of finite element objects that
@@ -1243,8 +1245,10 @@ template <int dim, int spacedim>
 inline
 const FiniteElement<dim,spacedim> &
 DoFHandler<dim,spacedim>::get_finite_element
-(const unsigned int) const
+(const unsigned int index) const
 {
+  (void) index;
+  Assert(index == 0, ExcMessage("There is only one FiniteElement stored. The index must be zero!"));
   Assert(selected_fe!=nullptr,
          ExcMessage("You are trying to access the DoFHandler's FiniteElement object before it has been initialized."));
   return *selected_fe;
index c3b1d33b1217f366f9c6fcfc6f9c5409af9eeb52..12961669b2affecdb978ebd9ac848c56b11cb6dc 100644 (file)
@@ -665,11 +665,11 @@ namespace hp
     const hp::FECollection<dim,spacedim> &get_fe () const DEAL_II_DEPRECATED;
 
     /**
-     * Return a constant reference to the ith finite element object that is
+     * Return a constant reference to the indexth finite element object that is
      * used by this @p DoFHandler.
      */
     const FiniteElement<dim,spacedim> &
-    get_finite_element (const unsigned int i) const;
+    get_finite_element (const unsigned int index) const;
 
     /**
      * Return a constant reference to the set of finite element objects that

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.