From: wolf Date: Fri, 29 Oct 2004 21:50:10 +0000 (+0000) Subject: Undo Ralf's change until we have a real fix for the problem. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16feecaeb6211c139207b7e6c3c02ce412e64974;p=dealii-svn.git Undo Ralf's change until we have a real fix for the problem. git-svn-id: https://svn.dealii.org/trunk@9741 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/tria_accessor.cc b/deal.II/deal.II/source/grid/tria_accessor.cc index 2da17baf17..d4bf896089 100644 --- a/deal.II/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/deal.II/source/grid/tria_accessor.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -2168,44 +2168,42 @@ neighbor_child_on_subface (const unsigned int face, template <> TriaIterator<3,CellAccessor<3> > CellAccessor<3>:: -neighbor_child_on_subface (const unsigned int face_no, - const unsigned int subface_no) const +neighbor_child_on_subface (const unsigned int face, + const unsigned int subface) const { Assert (!this->has_children(), ExcMessage ("The present cell must not have children!")); - Assert (!this->at_boundary(face_no), + Assert (!this->at_boundary(face), ExcMessage ("The present cell must have a valid neighbor!")); - const TriaIterator<3,CellAccessor<3> > neighbor=this->neighbor(face_no); - Assert (neighbor->level() == this->level(), + Assert (this->neighbor(face)->level() == this->level(), ExcMessage ("The neighbor must be on the same level as this cell!")); - Assert (this->neighbor(face_no)->has_children() == true, + Assert (this->neighbor(face)->has_children() == true, ExcMessage ("The neighbor must have children!")); - + + static const unsigned int subface_translation[4] + = { 0, 3, 2, 1 }; + // see whether face and + // the neighbor's + // counterface share the + // same indexing of + // children. if not so, + // translate child + // indices const unsigned int neighbor_neighbor - = this->neighbor_of_neighbor (face_no); + = this->neighbor_of_neighbor (face); const bool face_orientations_match - = (neighbor->face_orientation(neighbor_neighbor) == this->face_orientation(face_no)); - unsigned int neighbor_child_index=0; - if (face_orientations_match) - neighbor_child_index=GeometryInfo<3>::child_cell_on_face( - neighbor_neighbor, subface_no); - else - { - // face and neighbor's face do not - // share same indexing of children: - // search the specific child among - // all children - const TriaIterator<3,TriaObjectAccessor<2, 3> > subface= - this->face(face_no)->child(subface_no); - for (; neighbor_child_index::children_per_cell; ++neighbor_child_index) - if (neighbor->child(neighbor_child_index)->face(neighbor_neighbor)==subface) - break; - } - + = (this->neighbor(face)->face_orientation(neighbor_neighbor) == + this->face_orientation(face)); + const unsigned int neighbor_child_index + = (GeometryInfo<3>:: + child_cell_on_face(neighbor_neighbor, + (face_orientations_match ? + subface : + subface_translation[subface]))); TriaIterator<3,CellAccessor<3> > neighbor_child= - neighbor->child(neighbor_child_index); + this->neighbor(face)->child(neighbor_child_index); - Assert(this->face(face_no)->child(subface_no)== + Assert(this->face(face)->child(subface)== neighbor_child->face(neighbor_neighbor), ExcInternalError()); return neighbor_child;