]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Only access data to which we have access.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 2 May 2006 02:28:50 +0000 (02:28 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 2 May 2006 02:28:50 +0000 (02:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@12955 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/multigrid/mg_dof_accessor.cc

index 51b2ff6a9e19bd266889ced599ccddd34b1f1a5c..e9aa7b2322a5003306b25f79da298b0412c60cd5 100644 (file)
@@ -40,19 +40,11 @@ MGDoFObjectAccessor<1, dim>::MGDoFObjectAccessor (const Triangulation<dim> *tria
 template <int dim>
 unsigned int MGDoFObjectAccessor<1, dim>::mg_dof_index (const unsigned int i) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_line,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line));
-
   return this->mg_dof_handler->mg_levels[this->present_level]
-    ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i];
+    ->get_line_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i);
 }
 
 
@@ -60,19 +52,12 @@ template <int dim>
 void MGDoFObjectAccessor<1, dim>::set_mg_dof_index (const unsigned int i,
                                                    const unsigned int index) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_line,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_line));
-
   this->mg_dof_handler->mg_levels[this->present_level]
-    ->line_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_line+i] = index;
+    ->set_line_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i,
+                         index);
 }
 
 
@@ -215,19 +200,11 @@ MGDoFObjectAccessor<2, dim>::MGDoFObjectAccessor (const Triangulation<dim> *tria
 template <int dim>
 unsigned int MGDoFObjectAccessor<2, dim>::mg_dof_index (const unsigned int i) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_quad,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad));
-
   return this->mg_dof_handler->mg_levels[this->present_level]
-    ->quad_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_quad+i];
+    ->get_quad_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i);
 }
 
 
@@ -235,19 +212,12 @@ template <int dim>
 void MGDoFObjectAccessor<2, dim>::set_mg_dof_index (const unsigned int i,
                                                    const unsigned int index) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_quad,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_quad));
-
   this->mg_dof_handler->mg_levels[this->present_level]
-    ->quad_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_quad+i] = index;
+    ->set_quad_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i,
+                         index);
 }
 
 
@@ -415,19 +385,11 @@ MGDoFObjectAccessor<3, dim>::MGDoFObjectAccessor (const Triangulation<dim> *tria
 template <int dim>
 unsigned int MGDoFObjectAccessor<3, dim>::mg_dof_index (const unsigned int i) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_hex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex));
-
   return this->mg_dof_handler->mg_levels[this->present_level]
-    ->hex_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_hex+i];
+    ->get_hex_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i);
 }
 
 
@@ -435,19 +397,12 @@ template <int dim>
 void MGDoFObjectAccessor<3, dim>::set_mg_dof_index (const unsigned int i,
                                                    const unsigned int index) const
 {
-  Assert (this->dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (this->mg_dof_handler != 0,
-         typename BaseClass::ExcInvalidObject());
-                                  // make sure a FE has been selected
-                                  // and enough room was reserved
-  Assert (&this->dof_handler->get_fe() != 0,
-         typename BaseClass::ExcInvalidObject());
-  Assert (i<this->dof_handler->get_fe().dofs_per_hex,
-         ExcIndexRange (i, 0, this->dof_handler->get_fe().dofs_per_hex));
-
   this->mg_dof_handler->mg_levels[this->present_level]
-    ->hex_dofs[this->present_index*this->dof_handler->get_fe().dofs_per_hex+i] = index;
+    ->set_hex_dof_index(*this->dof_handler,
+                         this->present_index,
+                         0,
+                         i,
+                         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.