]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid code duplication by moving common code from FEFaceValue::reinit to do_reinit.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 25 Mar 2008 14:37:18 +0000 (14:37 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 25 Mar 2008 14:37:18 +0000 (14:37 +0000)
git-svn-id: https://svn.dealii.org/trunk@15931 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 2a94eab2a9c24dc1b3e024e49a76f376d3037aed..efcc7630cc528e2899a56a0aa848302c7a2c1a21 100644 (file)
@@ -1539,9 +1539,6 @@ void FEFaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &c
   this->present_cell.reset 
     (new typename FEValuesBase<dim>::template
      CellIterator<typename DoFHandler<dim>::cell_iterator> (cell));
-
-                                  // set the present face index
-  this->present_face_index=cell->face_index(face_no);
   
                                    // this was the part of the work
                                    // that is dependent on the actual
@@ -1578,9 +1575,6 @@ void FEFaceValues<dim>::reinit (const typename hp::DoFHandler<dim>::cell_iterato
     (new typename FEValuesBase<dim>::template
      CellIterator<typename hp::DoFHandler<dim>::cell_iterator> (cell));
 
-                                  // set the present face index
-  this->present_face_index=cell->face_index(face_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1614,9 +1608,6 @@ void FEFaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator
     (new typename FEValuesBase<dim>::template
      CellIterator<typename MGDoFHandler<dim>::cell_iterator> (cell));
 
-                                  // set the present face index
-  this->present_face_index=cell->face_index(face_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1641,9 +1632,6 @@ void FEFaceValues<dim>::reinit (const typename Triangulation<dim>::cell_iterator
   this->present_cell.reset 
     (new typename FEValuesBase<dim>::TriaCellIterator (cell));
 
-                                  // set the present face index
-  this->present_face_index=cell->face_index(face_no);
-
                                    // this was the part of the work
                                    // that is dependent on the actual
                                    // data type of the iterator. now
@@ -1657,6 +1645,12 @@ void FEFaceValues<dim>::reinit (const typename Triangulation<dim>::cell_iterator
 template <int dim>
 void FEFaceValues<dim>::do_reinit (const unsigned int face_no)
 {
+                                  // first of all, set the
+                                  // present_face_index (if
+                                  // available)
+  const typename Triangulation<dim>::cell_iterator cell=*this->present_cell;
+  this->present_face_index=cell->face_index(face_no);
+  
   this->get_mapping().fill_fe_face_values(*this->present_cell, face_no,
                                          this->quadrature,
                                          *this->mapping_data,

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.