]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix neighbor_of_coarser_neighbor for 1d.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 15:40:01 +0000 (15:40 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 15:40:01 +0000 (15:40 +0000)
git-svn-id: https://svn.dealii.org/branches/Branch-3-2@5237 0785d39b-7218-0410-832d-ea1e28bc413d

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

index dbfc55ccd37672c9088e1aa7860ca8237f14b63b..718f38c1a4423e70521a0a5143a87472798f50a0 100644 (file)
@@ -1882,9 +1882,13 @@ class CellAccessor :  public TriaObjectAccessor<dim,dim>
                                      * pair of numbers, face_no and
                                      * subface_no, with the following
                                      * property:
-                                     * @p{cell->neighbor(neighbor)->face(face_no)->child(subface_no)==cell}.
+                                     * @p{cell->neighbor(neighbor)->face(face_no)->child(subface_no)==cell->face(neighbor)}.
+                                     *
+                                     * This function is impossible
+                                     * for @p{dim==1}.
                                      */
-    std::pair<unsigned int, unsigned int> neighbor_of_coarser_neighbor (const unsigned int neighbor) const;
+    std::pair<unsigned int, unsigned int>
+    neighbor_of_coarser_neighbor (const unsigned int neighbor) const;
     
                                     /**
                                      *  Return whether the @p{i}th
index 5019e76d6974fea1006dc8a11a4beacd79b8c80c..f7b2722b63c3c89a05458156f1b58511d327a42d 100644 (file)
@@ -1572,6 +1572,17 @@ bool CellAccessor<1>::point_inside (const Point<1> &p) const
   return (vertex(0)[0] <= p[0]) && (p[0] <= vertex(1)[0]);
 }
 
+
+template <>
+std::pair<unsigned int, unsigned int>
+CellAccessor<1>::neighbor_of_coarser_neighbor (const unsigned int) const
+{
+  Assert(false, ExcImpossibleInDim(1));
+  return std::make_pair (static_cast<unsigned int>(-1),
+                        static_cast<unsigned int>(-1));
+}
+
+
 #endif
 
 
@@ -1787,7 +1798,7 @@ unsigned int CellAccessor<dim>::neighbor_of_neighbor (const unsigned int neighbo
 
 
 template <int dim>
-pair<unsigned int, unsigned int>
+std::pair<unsigned int, unsigned int>
 CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) const
 {
                                   // make sure that the neighbor is
@@ -1822,7 +1833,7 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
   if (face_guess->has_children())
     for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
       if (face_guess->child(subface_no)==this_face)
-       return pair<unsigned int,unsigned int> (face_no_guess, subface_no);
+       return std::make_pair (face_no_guess, subface_no);
 
                                     // if the guess was false, then
                                     // we need to loop over all faces
@@ -1837,7 +1848,7 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
          if (face->has_children())
            for (unsigned int subface_no=0; subface_no<GeometryInfo<dim>::subfaces_per_face; ++subface_no)
              if (face->child(subface_no)==this_face)
-               return pair<unsigned int,unsigned int> (face_no, subface_no);
+               return std::make_pair (face_no, subface_no);
        }
     }
   
@@ -1845,8 +1856,8 @@ CellAccessor<dim>::neighbor_of_coarser_neighbor (const unsigned int neighbor) co
                                   // since then we did not find
                                   // our way back...
   Assert (false, ExcInternalError());
-  return pair<unsigned int,unsigned int> (static_cast<unsigned int>(-1),
-                                         static_cast<unsigned int>(-1));
+  return std::make_pair (static_cast<unsigned int>(-1),
+                        static_cast<unsigned int>(-1));
 };
 
 

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.