]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Provide one function that we now need in creating hanging node constraints
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 3 Sep 2006 21:04:27 +0000 (21:04 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 3 Sep 2006 21:04:27 +0000 (21:04 +0000)
git-svn-id: https://svn.dealii.org/trunk@13822 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/dofs/dof_accessor.h
deal.II/deal.II/include/dofs/dof_accessor.templates.h

index 7636d1657026481b890d94d7f80392e019ef014e..1e547a277631f031d73d6841c31267a38fc27aa8 100644 (file)
@@ -446,6 +446,17 @@ class DoFAccessor : public DoFObjectAccessor_Inheritance<structdim, DH::dimensio
     bool
     fe_index_is_active (const unsigned int fe_index) const;
 
+                                    /**
+                                     * Return a reference to the finite
+                                     * element used on this object with the
+                                     * given @p fe_index. @p fe_index must be
+                                     * used on this object,
+                                     * i.e. <code>fe_index_is_active(fe_index)</code>
+                                     * must return true.
+                                     */
+    const FiniteElement<DH::dimension> &
+    get_fe (const unsigned int fe_index) const;
+    
                                      /**
                                      * Exceptions for child classes
                                      *
index 19f0d1424048be51e3f0b8cc041d393e32f3262c..552a58701c1d1766ebe1a5c624af178e73edb56a 100644 (file)
@@ -257,6 +257,90 @@ DoFAccessor<dim,DH>::fe_index_is_active (const unsigned int fe_index) const
 }
 
 
+
+template <int dim, class DH>
+inline
+const FiniteElement<DH::dimension> &
+DoFAccessor<dim,DH>::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));
+  
+  return this->dof_handler->get_fe()[fe_index];
+}
+
+
+
+template <>
+inline
+const FiniteElement<1> &
+DoFAccessor<1,::DoFHandler<1> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
+
+
+template <>
+inline
+const FiniteElement<2> &
+DoFAccessor<1,::DoFHandler<2> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
+
+
+template <>
+inline
+const FiniteElement<3> &
+DoFAccessor<1,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
+
+
+template <>
+inline
+const FiniteElement<2> &
+DoFAccessor<2,::DoFHandler<2> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
+
+
+template <>
+inline
+const FiniteElement<3> &
+DoFAccessor<2,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
+
+
+template <>
+inline
+const FiniteElement<3> &
+DoFAccessor<3,::DoFHandler<3> >::get_fe (const unsigned int fe_index) const
+{
+  Assert (fe_index_is_active (fe_index) == true,
+         ExcMessage ("This message can only be called for active fe indices"));  
+  return this->dof_handler->get_fe();
+}
+
 /*------------------------- Functions: DoFObjectAccessor<1,dim> -----------------------*/
 
 

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.