]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Clean up a few things in the hp parts. For example, some functions
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Apr 2006 15:45:53 +0000 (15:45 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Wed, 26 Apr 2006 15:45:53 +0000 (15:45 +0000)
only make sense for dim==structdim.

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

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

index 5c5d63f9095c7694f2db86344ff0b76cd55ee8f4..f719da3dccdcd5282a4c70751e512a2c97a94760 100644 (file)
@@ -1096,6 +1096,10 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::dof_index (const unsigned int i) const
   Assert (i<this->get_fe().dofs_per_line,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
 
+                                  // for lines in 1d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
       ->dof_line_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,
@@ -1108,6 +1112,7 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::dof_index (const unsigned int i) const
 }
 
 
+
 template <>
 inline
 unsigned int
@@ -1145,6 +1150,7 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::dof_index (const unsigned int i) const
 }
 
 
+
 template <>
 inline
 unsigned int
@@ -1202,6 +1208,10 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_index (const unsigned int i,
   Assert (i<this->get_fe().dofs_per_line,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_line));
 
+                                  // for lines in 1d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
                               ->dof_line_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,
@@ -1214,6 +1224,7 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::set_dof_index (const unsigned int i,
 }
 
 
+
 template <>
 inline
 void
@@ -1249,6 +1260,7 @@ DoFObjectAccessor<1, hp::DoFHandler<2> >::set_dof_index (const unsigned int i,
 }
 
 
+
 template <>
 inline
 void
@@ -1297,7 +1309,10 @@ inline
 const FiniteElement<2> &
 DoFObjectAccessor<1,hp::DoFHandler<2> >::get_fe () const
 {
-  return (*dof_handler->finite_elements)[active_fe_index ()];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return (*dof_handler->finite_elements)[0];
 }
 
 
@@ -1307,7 +1322,10 @@ inline
 const FiniteElement<3> &
 DoFObjectAccessor<1,hp::DoFHandler<3> >::get_fe () const
 {
-  return (*dof_handler->finite_elements)[active_fe_index ()];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return (*dof_handler->finite_elements)[0];
 }
 
 
@@ -1334,14 +1352,10 @@ inline
 unsigned int
 DoFObjectAccessor<1,hp::DoFHandler<2> >::active_fe_index () const
 {
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  return this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return 0;
 }
 
 
@@ -1351,14 +1365,10 @@ inline
 unsigned int
 DoFObjectAccessor<1,hp::DoFHandler<3> >::active_fe_index () const
 {
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  return this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return 0;
 }
 
 
@@ -1387,20 +1397,11 @@ DoFObjectAccessor<1,hp::DoFHandler<1> >::set_active_fe_index (const unsigned int
 template <>
 inline
 void
-DoFObjectAccessor<1,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int i)
+DoFObjectAccessor<1,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int)
 {
-  Assert (this->dof_handler != 0, ExcInvalidObject());
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->finite_elements->size (),
-          ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ()));
-
-  this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index] = i;
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
 }
 
 
@@ -1408,20 +1409,11 @@ DoFObjectAccessor<1,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int
 template <>
 inline
 void
-DoFObjectAccessor<1,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i)
+DoFObjectAccessor<1,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int)
 {
-  Assert (this->dof_handler != 0, ExcInvalidObject());
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->finite_elements->size (),
-          ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ()));
-
-  this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index] = i;
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
 }
 
 
@@ -1444,6 +1436,10 @@ unsigned int DoFObjectAccessor<2,hp::DoFHandler<2> >::dof_index (const unsigned
   Assert (i<this->get_fe().dofs_per_quad,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
 
+                                  // for quads in 2d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
       ->dof_quad_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,
@@ -1506,6 +1502,10 @@ DoFObjectAccessor<2, hp::DoFHandler<2> >::set_dof_index (const unsigned int i,
   Assert (i<this->get_fe().dofs_per_quad,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_quad));
 
+                                  // for quads in 2d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
                               ->dof_quad_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,
@@ -1523,7 +1523,7 @@ template <>
 inline
 void
 DoFObjectAccessor<2, hp::DoFHandler<3> >::set_dof_index (const unsigned int i,
-                                                      const unsigned int index) const
+                                                        const unsigned int index) const
 {
   typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
 
@@ -1566,11 +1566,15 @@ inline
 const FiniteElement<3> &
 DoFObjectAccessor<2,hp::DoFHandler<3> >::get_fe () const
 {
-  return (*dof_handler->finite_elements)[active_fe_index ()];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return (*dof_handler->finite_elements)[0];
 }
 
 
 
+
 template <>
 inline
 unsigned int
@@ -1588,22 +1592,20 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::active_fe_index () const
 
 
 
+
 template <>
 inline
 unsigned int
 DoFObjectAccessor<2,hp::DoFHandler<3> >::active_fe_index () const
 {
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  return this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index];
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
+  return 0;
 }
 
 
+
 template <>
 inline
 void
@@ -1630,20 +1632,11 @@ DoFObjectAccessor<2,hp::DoFHandler<2> >::set_active_fe_index (const unsigned int
 template <>
 inline
 void
-DoFObjectAccessor<2,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int i)
+DoFObjectAccessor<2,hp::DoFHandler<3> >::set_active_fe_index (const unsigned int)
 {
-  Assert (this->dof_handler != 0, ExcInvalidObject());
-  Assert (static_cast<unsigned int>(this->present_level) < this->dof_handler->levels.size(),
-          ExcMessage ("DoFHandler not initialized"));
-  Assert (static_cast<std::vector<unsigned int>::size_type>(this->present_index) <
-         this->dof_handler->levels[this->present_level]->active_fe_indices.size (),
-         ExcIndexRange (this->present_index, 0,
-                        this->dof_handler->levels[this->present_level]->active_fe_indices.size ()));
-  Assert (i < this->dof_handler->finite_elements->size (),
-          ExcIndexRange(i, 0, this->dof_handler->finite_elements->size ()));
-
-  this->dof_handler->levels[this->present_level]
-      ->active_fe_indices[this->present_index] = i;
+  Assert (false, ExcMessage ("Only cells, not lower-dimensional objects, are "
+                            "associated with active_fe_indices and corresponding "
+                            "finite element objects"));
 }
 
 
@@ -1667,6 +1660,10 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::dof_index (const unsigned int i) const
   Assert (i<this->get_fe().dofs_per_hex,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
 
+                                  // for hexes in 3d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
       ->dof_hex_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,
@@ -1679,11 +1676,12 @@ DoFObjectAccessor<3,hp::DoFHandler<3> >::dof_index (const unsigned int i) const
 }
 
 
+
 template <>
 inline
 void
 DoFObjectAccessor<3, hp::DoFHandler<3> >::set_dof_index (const unsigned int i,
-                                                      const unsigned int index) const
+                                                        const unsigned int index) const
 {
   typedef DoFAccessor<hp::DoFHandler<3> > BaseClass;
     
@@ -1698,6 +1696,10 @@ DoFObjectAccessor<3, hp::DoFHandler<3> >::set_dof_index (const unsigned int i,
   Assert (i<this->get_fe().dofs_per_hex,
          ExcIndexRange (i, 0, this->get_fe().dofs_per_hex));
 
+                                  // for hexes in 3d, we only have to
+                                  // take care of the offset, no
+                                  // linked lists or whatever (see
+                                  // hp::DoFLevels)
   const unsigned int offset = this->dof_handler->levels[this->present_level]
                               ->dof_hex_index_offset[this->present_index];
   Assert (offset != this->dof_handler->invalid_dof_index,

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.