From: maier Date: Sat, 1 Dec 2012 17:16:18 +0000 (+0000) Subject: Bugfix: Fix GeometryInfo<2>::child_cell_on_face to respect face_flip X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0abdcde8157bd5fca195e335d37f57f4e78bce56;p=dealii-svn.git Bugfix: Fix GeometryInfo<2>::child_cell_on_face to respect face_flip This change does not trigger any regression in the test suite git-svn-id: https://svn.dealii.org/trunk@27714 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/geometry_info.h b/deal.II/include/deal.II/base/geometry_info.h index fe77dda1b5..1862b363ed 100644 --- a/deal.II/include/deal.II/base/geometry_info.h +++ b/deal.II/include/deal.II/base/geometry_info.h @@ -1200,8 +1200,8 @@ struct GeometryInfo<0> * normal vector is pointing the other direction. There are not very many * places in application programs where you need this information actually, * but a few places in the library make use of this. Note that in 2d, the - * result is always @p true. More information on the topic can be found in the - * @ref GlossFaceOrientation "glossary" article on this topic. + * result is always @p true. More information on the topic can be found in this + * @ref GlossFaceOrientation "glossary" article. * * In order to allow all kinds of meshes in 3d, including * Moebius-loops, for example, a face might even be rotated looking @@ -1792,8 +1792,10 @@ struct GeometryInfo * face_orientation defaults to * true, face_flip and * face_rotation default to - * false (standard orientation) - * and has no effect in 2d. + * false (standard orientation). + * In 2d only face_flip is considered. + * See this @ref GlossFaceOrientation "glossary" + * article for more information. * * As the children of a cell are * ordered according to the diff --git a/deal.II/source/base/geometry_info.cc b/deal.II/source/base/geometry_info.cc index 833981f70d..60c190ee1e 100644 --- a/deal.II/source/base/geometry_info.cc +++ b/deal.II/source/base/geometry_info.cc @@ -1099,7 +1099,7 @@ unsigned int GeometryInfo<2>::child_cell_on_face (const RefinementCase<2> &ref_case, const unsigned int face, const unsigned int subface, - const bool, const bool, const bool, + const bool, const bool face_flip, const bool, const RefinementCase<1> &) { Assert (face::child_cell_on_face (const RefinementCase<2> &ref_case, // refined neighbor. this simplifies setting neighbor // information in execute_refinement. static const unsigned int - subcells[RefinementCase<2>::isotropic_refinement][faces_per_cell][max_children_per_face] = + subcells[2][RefinementCase<2>::isotropic_refinement][faces_per_cell][max_children_per_face] = { - {{0,0},{1,1},{0,1},{0,1}}, // cut_x - {{0,1},{0,1},{0,0},{1,1}}, // cut_y - {{0,2},{1,3},{0,1},{2,3}} - }; // cut_xy + { + // Normal orientation (face_filp = false) + {{0,0},{1,1},{0,1},{0,1}}, // cut_x + {{0,1},{0,1},{0,0},{1,1}}, // cut_y + {{0,2},{1,3},{0,1},{2,3}} // cut_z + }, + { + // Flipped orientation (face_flip = true) + {{0,0},{1,1},{1,0},{1,0}}, // cut_x + {{1,0},{1,0},{0,0},{1,1}}, // cut_y + {{2,0},{3,1},{1,0},{3,2}} // cut_z + } + }; - return subcells[ref_case-1][face][subface]; + return subcells[face_flip][ref_case-1][face][subface]; }