]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add missing reinit functions taking MGDoFHandler::cell_iterators.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jun 2004 10:43:46 +0000 (10:43 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 28 Jun 2004 10:43:46 +0000 (10:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@9472 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 18a620e16142e9391ca079ab106e7bc5a2900219..24fd2e44fc4fdc05a6367cb1ac99ac42dc935229 100644 (file)
@@ -1720,6 +1720,22 @@ class FEFaceValues : public FEFaceValuesBase<dim>
                                      */
     void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
                 const unsigned int                            face_no);
+    
+                                    /**
+                                     * Reinitialize the gradients,
+                                     * Jacobi determinants, etc for
+                                     * the given cell of type
+                                     * "iterator into a MGDoFHandler
+                                     * object", and the finite
+                                     * element associated with this
+                                     * object. It is assumed that the
+                                     * finite element used by the
+                                     * given cell is also the one
+                                     * used by this @p FEValues
+                                     * object.
+                                     */
+    void reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
+                const unsigned int                               face_no);
 
                                     /**
                                      * Reinitialize the gradients,
@@ -1835,6 +1851,23 @@ class FESubfaceValues : public FEFaceValuesBase<dim>
                                      * @p FESubfaceValues object.
                                      */
     void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
+                const unsigned int                    face_no,
+                const unsigned int                    subface_no);
+
+                                    /**
+                                     * Reinitialize the gradients,
+                                     * Jacobi determinants, etc for
+                                     * the given cell of type
+                                     * "iterator into a MGDoFHandler
+                                     * object", and the finite
+                                     * element associated with this
+                                     * object. It is assumed that the
+                                     * finite element used by the
+                                     * given cell is also the one
+                                     * used by this @p FEValues
+                                     * object.
+                                     */
+    void reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
                 const unsigned int                    face_no,
                 const unsigned int                    subface_no);
 
index 6ae075c98e3fe39d1ac7ac01df2af07aa4159f60..39a0d3e737f244d29700a68d678748466ad05afe 100644 (file)
@@ -1045,6 +1045,39 @@ void FEFaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &c
 }
 
 
+template <int dim>
+void FEFaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
+                               const unsigned int              face_no)
+{
+                                  // assert that the finite elements
+                                  // passed to the constructor and
+                                  // used by the DoFHandler used by
+                                  // this cell, are the same
+  Assert (static_cast<const FiniteElementData<dim>&>(*this->fe) ==
+         static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+         typename FEValuesBase<dim>::ExcFEDontMatch());
+
+  Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+         ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+  
+                                   // set new cell. auto_ptr will take
+                                   // care that old object gets
+                                   // destroyed and also that this
+                                   // object gets destroyed in the
+                                   // destruction of this class
+  this->present_cell.reset 
+    (new typename FEValuesBase<dim>::template
+     CellIterator<typename MGDoFHandler<dim>::cell_iterator> (cell));
+
+                                   // this was the part of the work
+                                   // that is dependent on the actual
+                                   // data type of the iterator. now
+                                   // pass on to the function doing
+                                   // the real work.
+  do_reinit (face_no);
+}
+
+
 
 template <int dim>
 void FEFaceValues<dim>::reinit (const typename Triangulation<dim>::cell_iterator &cell,
@@ -1192,6 +1225,46 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
 
 
 
+template <int dim>
+void FESubfaceValues<dim>::reinit (const typename MGDoFHandler<dim>::cell_iterator &cell,
+                                  const unsigned int         face_no,
+                                  const unsigned int         subface_no)
+{
+                                  // assert that the finite elements
+                                  // passed to the constructor and
+                                  // used by the DoFHandler used by
+                                  // this cell, are the same
+  Assert (static_cast<const FiniteElementData<dim>&>(*this->fe) ==
+         static_cast<const FiniteElementData<dim>&>(cell->get_dof_handler().get_fe()),
+         typename FEValuesBase<dim>::ExcFEDontMatch());
+  Assert (face_no < GeometryInfo<dim>::faces_per_cell,
+         ExcIndexRange (face_no, 0, GeometryInfo<dim>::faces_per_cell));
+  Assert (subface_no < GeometryInfo<dim>::subfaces_per_face,
+         ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
+  Assert (cell->has_children() == false,
+          ExcMessage ("You can't use subface data for cells that are "
+                      "already refined. Iterate over their children "
+                      "instead in these cases."));
+  
+                                   // set new cell. auto_ptr will take
+                                   // care that old object gets
+                                   // destroyed and also that this
+                                   // object gets destroyed in the
+                                   // destruction of this class
+  this->present_cell.reset 
+    (new typename FEValuesBase<dim>::template
+     CellIterator<typename MGDoFHandler<dim>::cell_iterator> (cell));
+
+                                   // this was the part of the work
+                                   // that is dependent on the actual
+                                   // data type of the iterator. now
+                                   // pass on to the function doing
+                                   // the real work.
+  do_reinit (face_no, subface_no);
+}
+
+
+
 template <int dim>
 void FESubfaceValues<dim>::reinit (const typename Triangulation<dim>::cell_iterator &cell,
                                   const unsigned int         face_no,

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.