]> https://gitweb.dealii.org/ - dealii.git/commitdiff
On meshes with non-standard face_orientation, face_flip or face_rotation we could...
authorTobias Leicht <tobias.leicht@dlr.de>
Thu, 11 Oct 2007 13:18:37 +0000 (13:18 +0000)
committerTobias Leicht <tobias.leicht@dlr.de>
Thu, 11 Oct 2007 13:18:37 +0000 (13:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@15288 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/source/grid/tria_accessor.cc

index b2bd31b35fbaf01893fc5260709a739cbcf72a57..d82eb7e96d6124856f2068bba399400e4229c1cd 100644 (file)
@@ -3261,7 +3261,7 @@ class CellAccessor :  public TriaObjectAccessor<dim,dim>
                                      * pair of numbers, face_no and
                                      * subface_no, with the following
                                      * property:
-                                     * <tt>cell->neighbor(neighbor)->face(face_no)->child(subface_no)==cell->face(neighbor)</tt>.
+                                     * <tt>cell->neighbor(neighbor)->neighbor_child_on_subface(face_no,subface_no)==cell</tt>.
                                      *
                                      * This function is impossible
                                      * for <tt>dim==1</tt>.
index 64b10d230762e9a6078238b7d0a4982fad2cf90a..f4d752102282f5f71ef66198e2b7ae2ac6f552e9 100644 (file)
@@ -2266,7 +2266,15 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
   if (face_guess->has_children())
     for (unsigned int subface_no=0; subface_no<face_guess->n_children(); ++subface_no)
       if (face_guess->child_index(subface_no)==this_face_index)
-       return std::make_pair (face_no_guess, subface_no);
+                                        // return the result, but don't forget
+                                        // to take care of possible rotation,
+                                        // flip and wrong orientation of the
+                                        // neighbor's face...
+       return std::make_pair (face_no_guess,
+                              GeometryInfo<dim>::real_to_standard_face_vertex(subface_no,
+                                                                              neighbor_cell->face_orientation(face_no_guess),
+                                                                              neighbor_cell->face_flip(face_no_guess),
+                                                                              neighbor_cell->face_rotation(face_no_guess)));
 
                                     // if the guess was false, then
                                     // we need to loop over all faces
@@ -2281,7 +2289,15 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
          if (face->has_children())
            for (unsigned int subface_no=0; subface_no<face->n_children(); ++subface_no)
              if (face->child_index(subface_no)==this_face_index)
-               return std::make_pair (face_no, subface_no);
+                                                // return the result, but don't forget
+                                                // to take care of possible rotation,
+                                                // flip and wrong orientation of the
+                                                // neighbor's face...
+               return std::make_pair (face_no,
+                                      GeometryInfo<dim>::real_to_standard_face_vertex(subface_no,
+                                                                                      neighbor_cell->face_orientation(face_no),
+                                                                                      neighbor_cell->face_flip(face_no),
+                                                                                      neighbor_cell->face_rotation(face_no)));
        }
     }
   

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.