]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new orientation
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Jun 2003 09:18:07 +0000 (09:18 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 24 Jun 2003 09:18:07 +0000 (09:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@7809 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_values.h
deal.II/deal.II/source/fe/fe_values.cc
deal.II/doc/news/c-4-0.html

index 1b9b5f9c9658c6452f8260cefb176c20e4af14cf..95d108f51d5d0b78c519258039d5acd2ad34409a 100644 (file)
@@ -983,6 +983,25 @@ class FEFaceValuesBase : public FEValuesBase<dim>
                                      * @p{n.ds}.
                                      */
     const Tensor<1,dim> & boundary_form (const unsigned int i) const;
+
+                                    /**
+                                     * Get the natural orientation of
+                                     * the face.
+                                     *
+                                     * If this is true, then the
+                                     * natural normal vector of the
+                                     * face points outwards (faces
+                                     * 0,1 in two dimensions, faces
+                                     * 0,2,4 in three). On the other
+                                     * faces, the natural normal
+                                     * vector points inwards.
+                                     *
+                                     * With this function, you have
+                                     * access to a consistent and
+                                     * unique orientation of all
+                                     * faces.
+                                     */
+    bool orientation () const;
     
                                     /**
                                      * Return the list of outward normal
@@ -1017,6 +1036,20 @@ class FEFaceValuesBase : public FEValuesBase<dim>
                                      * formula here.
                                      */
     const Quadrature<dim-1> quadrature;
+
+                                    /**
+                                     * Value for orientation function.
+                                     */
+    bool my_orientation;
+                                    /**
+                                     * Data table for orientation
+                                     * values. Since the faces are
+                                     * numbered in a creative
+                                     * fashion, we stores these
+                                     * values instead of computing
+                                     * them.
+                                     */
+    static const bool orientation_table[];
 };
 
 
@@ -1064,8 +1097,8 @@ class FEFaceValues : public FEFaceValuesBase<dim>
                                      * number @p{face_no} of @p{cell}
                                      * and the given finite element.
                                      */
-    void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
-                const unsigned int                    face_no);
+    void reinit (const typename DoFHandler<dim>::cell_iteratorcell,
+                const unsigned int face_no);
 
   private:
 
@@ -1124,9 +1157,9 @@ class FESubfaceValues : public FEFaceValuesBase<dim>
                                      * number @p{face_no} of @p{cell}
                                      * and the given finite element.
                                      */
-    void reinit (const typename DoFHandler<dim>::cell_iterator &cell,
-                const unsigned int                    face_no,
-                const unsigned int                    subface_no);
+    void reinit (const typename DoFHandler<dim>::cell_iteratorcell,
+                const unsigned int face_no,
+                const unsigned int subface_no);
 
                                     /**
                                      * Exception
@@ -1480,6 +1513,14 @@ FEFaceValuesBase<dim>::normal_vector (const unsigned int i) const
 }
 
 
+template <int dim>
+bool
+FEFaceValuesBase<dim>::orientation () const
+{
+  return my_orientation;
+}
+
+
 template <int dim>
 const Quadrature<dim-1> &
 FEFaceValuesBase<dim>::get_quadrature () const 
index ade7867c254f02fe9f0bdad77422e7387b8d0fdf..e47beacb666ba0532fc2a0228479cab313e8f433 100644 (file)
@@ -621,6 +621,36 @@ FEValues<dim>::memory_consumption () const
 /*------------------------------- FEFaceValuesBase --------------------------*/
 
 
+#if deal_II_dimension == 1
+template <>
+const bool
+FEFaceValuesBase<deal_II_dimension>::orientation_table[] =
+{
+      false, true
+};
+#endif
+
+
+#if deal_II_dimension == 2
+template <>
+const bool
+FEFaceValuesBase<deal_II_dimension>::orientation_table[] =
+{
+      true, true, false, false
+};
+#endif
+
+
+#if deal_II_dimension == 3
+template <>
+const bool
+FEFaceValuesBase<deal_II_dimension>::orientation_table[] =
+{
+      true, false, true, false, true, false
+};
+#endif
+
+
 template <int dim>
 FEFaceValuesBase<dim>::FEFaceValuesBase (const unsigned int n_q_points,
                                         const unsigned int dofs_per_cell,
@@ -739,7 +769,8 @@ void FEFaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator &c
          typename FEValuesBase<dim>::ExcFEDontMatch());
 
   this->present_cell = cell;
-
+  this->my_orientation = this->orientation_table[face_no];
+  
   this->get_mapping().fill_fe_face_values(cell, face_no,
                                          this->quadrature,
                                          *this->mapping_data,
@@ -836,6 +867,7 @@ void FESubfaceValues<dim>::reinit (const typename DoFHandler<dim>::cell_iterator
          ExcIndexRange (subface_no, 0, GeometryInfo<dim>::subfaces_per_face));
   
   this->present_cell  = cell;
+  this->my_orientation = this->orientation_table[face_no];
 
   this->get_mapping().fill_fe_subface_values(cell, face_no, subface_no,
                                             this->quadrature,
index a978fd45fdd0f9e4b0901d6263407c922ca254db..127517d45fc2d17c633097bba7d5234acda7181e 100644 (file)
@@ -67,6 +67,13 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>
+  Improved: <code class="class">FEFaceValuesBase</code> has a new
+  function <code class="member">orientation</code> accessing a unique
+  and consistent orientation for each face.
+  <br>
+  (GK 2003/06/23)
+
   <li> <p> 
        Changed: Embedding and restriction matrices for intergrid transfer are
        now computed in the constructor of most elements, rather than taken from
@@ -74,7 +81,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        elements are available since the old tables were only precomputed for
        certain polynomial degrees and are now available for all.
        <br>
-       (WB 2002/06/09)
+       (WB 2003/06/09)
        </p>
 
   <li> <p> 
@@ -87,7 +94,7 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        this function if it implements the desired interpolation, and falls back
        to the old algorithm if this is not the case.
        <br>
-       (WB 2002/06/09)
+       (WB 2003/06/09)
        </p>
 
   <li> <p> 
@@ -95,14 +102,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
        class="member">get_name</class>, which can be used to identify a finite
        element by its name.
        <br>
-       (WB 2002/06/09)
+       (WB 2003/06/09)
        </p>
 
   <li> <p> 
        New: Raviart-Thomas elements are now implemented in the <code
        class="class">FE_RaviartThomas</class> class.
        <br>
-       (WB 2002/06/09)
+       (WB 2003/06/09)
        </p>
 </ol>
 

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.