From: bangerth Date: Sun, 30 Jul 2006 22:19:50 +0000 (+0000) Subject: Fix bits/fe_face_to_cell_index, which yielded wrong results because face 0 now has... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdb8920590cc0ffe75ac495be3ad85e22d39f3f6;p=dealii-svn.git Fix bits/fe_face_to_cell_index, which yielded wrong results because face 0 now has vertices 0 and 2 adjacent (in 2d), rather than as previously 0 and 1 git-svn-id: https://svn.dealii.org/trunk@13527 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/fe/fe_base.h b/deal.II/deal.II/include/fe/fe_base.h index 89454d79b6..349df628d5 100644 --- a/deal.II/deal.II/include/fe/fe_base.h +++ b/deal.II/deal.II/include/fe/fe_base.h @@ -612,10 +612,17 @@ face_to_equivalent_cell_index (const unsigned int index) const { Assert (index < dofs_per_face, ExcIndexRange (index, 0, dofs_per_face)); - return (index < (this->first_face_line_index) - ? index - : this->first_line_index + - (index - this->first_face_line_index)); + + // on face 0, the vertices are 0 and 2 + if (index < this->dofs_per_vertex) + return index; + else if (index < 2*this->dofs_per_vertex) + return index + this->dofs_per_vertex; + else + // this is a dof on line 0, so on the + // cell there are now 4 vertices instead + // of only 2 ahead of this one + return index + 2*this->dofs_per_vertex; } @@ -627,16 +634,10 @@ unsigned int FiniteElementData<3>:: face_to_equivalent_cell_index (const unsigned int index) const { - Assert (index < dofs_per_face, - ExcIndexRange (index, 0, dofs_per_face)); - return (index < (GeometryInfo<3>::vertices_per_face * - this->dofs_per_vertex) - ? index - : (index < (this->first_face_quad_index) - ? this->first_line_index + - (index - this->first_face_line_index) - : this->first_quad_index + - (index - this->first_face_quad_index))); + // this case is just way too + // complicated. fall back to + // face_to_cell_index + return face_to_cell_index(index, 0, true); }