]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Do the same in FESubfaceValues, i.e. avoid code duplication by moving common code...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Mar 2008 14:51:50 +0000 (14:51 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 25 Mar 2008 14:51:50 +0000 (14:51 +0000)
git-svn-id: https://svn.dealii.org/trunk@15932 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_values.cc

index efcc7630cc528e2899a56a0aa848302c7a2c1a21..62247421f524ff1bd0bc8cac6859f02b873e61c7 100644 (file)
@@ -1772,15 +1772,6 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
                       "already refined. Iterate over their children "
                       "instead in these cases."));
 
-                                  // set the present face index
-  unsigned int real_subface_no=subface_no;
-  if (dim==3)
-    real_subface_no=GeometryInfo<dim>::standard_to_real_face_vertex(
-      subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no));
-  if (cell->face(face_no)->has_children())
-    this->present_face_index=cell->face(face_no)->child_index(real_subface_no);
-  else
-    this->present_face_index=cell->face_index(face_no);
                                    // set new cell. auto_ptr will take
                                    // care that old object gets
                                    // destroyed and also that this
@@ -1831,13 +1822,6 @@ void FESubfaceValues<dim>::reinit (const typename hp::DoFHandler<dim>::cell_iter
     (new typename FEValuesBase<dim>::template
      CellIterator<typename hp::DoFHandler<dim>::cell_iterator> (cell));
 
-                                  // set the present face index
-  unsigned int real_subface_no=subface_no;
-  if (dim==3)
-    real_subface_no=GeometryInfo<dim>::standard_to_real_face_vertex(
-      subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no));
-  this->present_face_index=cell->face(face_no)->child_index(real_subface_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1873,13 +1857,6 @@ void FESubfaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterat
     (new typename FEValuesBase<dim>::template
      CellIterator<typename MGDoFHandler<dim>::cell_iterator> (cell));
 
-                                  // set the present face index
-  unsigned int real_subface_no=subface_no;
-  if (dim==3)
-    real_subface_no=GeometryInfo<dim>::standard_to_real_face_vertex(
-      subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no));
-  this->present_face_index=cell->face(face_no)->child_index(real_subface_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1908,13 +1885,6 @@ void FESubfaceValues<dim>::reinit (const typename Triangulation<dim>::cell_itera
   this->present_cell.reset 
     (new typename FEValuesBase<dim>::TriaCellIterator (cell));
 
-                                  // set the present face index
-  unsigned int real_subface_no=subface_no;
-  if (dim==3)
-    real_subface_no=GeometryInfo<dim>::standard_to_real_face_vertex(
-      subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no));
-  this->present_face_index=cell->face(face_no)->child_index(real_subface_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1929,6 +1899,18 @@ template <int dim>
 void FESubfaceValues<dim>::do_reinit (const unsigned int face_no,
                                       const unsigned int subface_no)
 {
+
+                                  // set the present face index
+  const typename Triangulation<dim>::cell_iterator cell=*this->present_cell;
+  unsigned int real_subface_no=subface_no;
+  if (dim==3)
+    real_subface_no=GeometryInfo<dim>::standard_to_real_face_vertex(
+      subface_no, cell->face_orientation(face_no), cell->face_flip(face_no), cell->face_rotation(face_no));
+  if (cell->face(face_no)->has_children())
+    this->present_face_index=cell->face(face_no)->child_index(real_subface_no);
+  else
+    this->present_face_index=cell->face_index(face_no);
+
   this->get_mapping().fill_fe_subface_values(*this->present_cell,
                                              face_no, subface_no,
                                             this->quadrature,

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.