]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New get_face function in FEFaceValues and FESubfaceValues.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Jun 2000 15:38:17 +0000 (15:38 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 26 Jun 2000 15:38:17 +0000 (15:38 +0000)
git-svn-id: https://svn.dealii.org/trunk@3079 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 1505ca2441028d0d3bf57c417743326597c6bb31..a77b7bb9884676e518ea9a78d4e6861b02e794d4 100644 (file)
@@ -960,8 +960,15 @@ class FEFaceValuesBase : public FEValuesBase<dim>
                      const unsigned int n_faces_or_subfaces,
                      const UpdateFlags         update_flags,
                      const FiniteElement<dim> &fe);
-
-                                    /**
+    
+                                    /**
+                                     * Virtual destructor needed for
+                                     * the virtual @p{get_face}
+                                     * function.
+                                     */
+    virtual ~FEFaceValuesBase ();
+    
+                                    /**
                                      * Return the outward normal vector to
                                      * the cell at the @p{i}th quadrature
                                      * point. The length of the vector
@@ -976,6 +983,14 @@ class FEFaceValuesBase : public FEValuesBase<dim>
                                      */
     const vector<Point<dim> > & get_normal_vectors () const;
 
+                                    /**
+                                     * Return the present
+                                     * face. Implemented in the
+                                     * derived classes.
+                                     */
+    virtual DoFHandler<dim>::face_iterator get_face() const=0;
+
+
   protected:
                                     /**
                                      * Store the gradients of the shape
@@ -1115,6 +1130,12 @@ class FEFaceValues : public FEFaceValuesBase<dim>
                                      */
     void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
                 const unsigned int                    face_no);
+
+    
+                                    /**
+                                     * Return the present face.
+                                     */
+    virtual DoFHandler<dim>::face_iterator get_face() const;
 };
 
 
@@ -1252,12 +1273,31 @@ class FESubfaceValues : public FEFaceValuesBase<dim>
                 const unsigned int                    face_no,
                 const unsigned int                    subface_no);
 
+                                    /**
+                                     * Return the present face.
+                                     */
+    virtual DoFHandler<dim>::face_iterator get_face() const;
+
                                     /**
                                      * Exception
                                      */
     DeclException0 (ExcReinitCalledWithBoundaryFace);
-};
 
+                                    /**
+                                     * Exception
+                                     */
+    DeclException0 (ExcFaceHasNoSubfaces);
+
+  protected:
+    
+                                    /**
+                                     * Store the subface selected
+                                     * last time the @p{reinit}
+                                     * function was called. Is used
+                                     * by the @p{get_face} fuction.
+                                     */
+    DoFHandler<dim>::face_iterator present_subface;
+};
 
 
 
@@ -1352,6 +1392,12 @@ FEValuesBase<dim>::get_cell() const
 /*------------------------ Inline functions: FEFaceValuesBase --------------------*/
 
 
+template <int dim>
+inline
+FEFaceValuesBase<dim>::~FEFaceValuesBase()
+{};
+
+
 template <int dim>
 inline
 const vector<Point<dim> > &
@@ -1363,4 +1409,25 @@ FEFaceValuesBase<dim>::get_normal_vectors () const
 };
 
 
+/*------------------------ Inline functions: FEFaceValues ------------------------*/
+
+template <int dim>
+inline
+DoFHandler<dim>::face_iterator
+FEFaceValues<dim>::get_face() const {
+  return present_cell->face(selected_dataset);
+};
+
+
+
+/*------------------------ Inline functions: FESubfaceValues ------------------------*/
+
+template <int dim>
+inline
+DoFHandler<dim>::face_iterator
+FESubfaceValues<dim>::get_face() const {
+  return present_subface;
+};
+
+
 #endif
index b048988e4f9e8e96c84f39be0b3a9c7f50117f9b..95763dcce3feba7da5ac5ba918f6986bd21cef4b 100644 (file)
@@ -739,10 +739,17 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
                                   const unsigned int         face_no,
                                   const unsigned int         subface_no)
 {
+  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->face(face_no)->at_boundary() == false,
          ExcReinitCalledWithBoundaryFace());
+  Assert (cell->face(face_no)->has_children()== true,
+         ExcFaceHasNoSubfaces());
   
   present_cell  = cell;
+  present_subface = cell->face(face_no)->child(subface_no);
   selected_dataset = face_no*(1<<(dim-1)) + subface_no;
 
                                   // assert that the finite elements
@@ -753,10 +760,6 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
          ==
          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));
     
                                   // fill jacobi matrices and real
                                   // quadrature points

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.