]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Implementation of CellAccessor<1>::neighbor_of_coarser_neighbor. Add some std's
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 13:28:35 +0000 (13:28 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Nov 2001 13:28:35 +0000 (13:28 +0000)
git-svn-id: https://svn.dealii.org/trunk@5236 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e040cd209e4fd6ebfda54f2fd13a4368b5500f7a..970f69cf7c1ab7eb1fd9a2712f2092519d336823 100644 (file)
@@ -1883,9 +1883,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 11d45037db546b9b7a01db787d420643e95eba22..cb8c7676da271a1a0ef77d52b93b1ff803772f9d 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
 
 
@@ -1807,7 +1818,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
@@ -1842,7 +1853,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
@@ -1857,7 +1868,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);
        }
     }
   
@@ -1865,8 +1876,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.