From: Guido Kanschat Date: Tue, 24 Jun 2003 09:18:07 +0000 (+0000) Subject: new orientation X-Git-Tag: v8.0.0~16400 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d00fdf62bbd4706d3cec9095c5de429005cdf6f;p=dealii.git new orientation git-svn-id: https://svn.dealii.org/trunk@7809 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 1b9b5f9c96..95d108f51d 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -983,6 +983,25 @@ class FEFaceValuesBase : public FEValuesBase * @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 * formula here. */ const Quadrature 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 * number @p{face_no} of @p{cell} * and the given finite element. */ - void reinit (const typename DoFHandler::cell_iterator &cell, - const unsigned int face_no); + void reinit (const typename DoFHandler::cell_iterator& cell, + const unsigned int face_no); private: @@ -1124,9 +1157,9 @@ class FESubfaceValues : public FEFaceValuesBase * number @p{face_no} of @p{cell} * and the given finite element. */ - void reinit (const typename DoFHandler::cell_iterator &cell, - const unsigned int face_no, - const unsigned int subface_no); + void reinit (const typename DoFHandler::cell_iterator& cell, + const unsigned int face_no, + const unsigned int subface_no); /** * Exception @@ -1480,6 +1513,14 @@ FEFaceValuesBase::normal_vector (const unsigned int i) const } +template +bool +FEFaceValuesBase::orientation () const +{ + return my_orientation; +} + + template const Quadrature & FEFaceValuesBase::get_quadrature () const diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index ade7867c25..e47beacb66 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -621,6 +621,36 @@ FEValues::memory_consumption () const /*------------------------------- FEFaceValuesBase --------------------------*/ +#if deal_II_dimension == 1 +template <> +const bool +FEFaceValuesBase::orientation_table[] = +{ + false, true +}; +#endif + + +#if deal_II_dimension == 2 +template <> +const bool +FEFaceValuesBase::orientation_table[] = +{ + true, true, false, false +}; +#endif + + +#if deal_II_dimension == 3 +template <> +const bool +FEFaceValuesBase::orientation_table[] = +{ + true, false, true, false, true, false +}; +#endif + + template FEFaceValuesBase::FEFaceValuesBase (const unsigned int n_q_points, const unsigned int dofs_per_cell, @@ -739,7 +769,8 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c typename FEValuesBase::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::reinit (const typename DoFHandler::cell_iterator ExcIndexRange (subface_no, 0, GeometryInfo::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, diff --git a/deal.II/doc/news/c-4-0.html b/deal.II/doc/news/c-4-0.html index a978fd45fd..127517d45f 100644 --- a/deal.II/doc/news/c-4-0.html +++ b/deal.II/doc/news/c-4-0.html @@ -67,6 +67,13 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK

deal.II

    +
  1. + Improved: FEFaceValuesBase has a new + function orientation accessing a unique + and consistent orientation for each face. +
    + (GK 2003/06/23) +

  2. 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.
    - (WB 2002/06/09) + (WB 2003/06/09)

  3. @@ -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.
    - (WB 2002/06/09) + (WB 2003/06/09)

  4. @@ -95,14 +102,14 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK class="member">get_name, which can be used to identify a finite element by its name.
    - (WB 2002/06/09) + (WB 2003/06/09)

  5. New: Raviart-Thomas elements are now implemented in the FE_RaviartThomas class.
    - (WB 2002/06/09) + (WB 2003/06/09)