]> https://gitweb.dealii.org/ - dealii.git/commitdiff
vertex_index now returns an unsigned int instead of an int.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Sun, 30 Mar 2008 09:07:51 +0000 (09:07 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Sun, 30 Mar 2008 09:07:51 +0000 (09:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@15952 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 62082fdefbc592707f9aa502745b3b6baf797c41..0f59aedefcf9f5a12cf1bf6b993ec9351b6ac4bc 100644 (file)
@@ -543,7 +543,7 @@ class TriaObjectAccessor :  public TriaAccessor<celldim,dim>
                                      *  @p DoFAccessor::vertex_dof_index
                                      *  functions.
                                      */ 
-    int vertex_index (const unsigned int i) const;
+    unsigned int vertex_index (const unsigned int i) const;
 
                                     /**
                                      *  Return a reference to the
@@ -1284,7 +1284,7 @@ class TriaObjectAccessor<1, dim> :  public TriaAccessor<1,dim>
                                      *  @p DoFAccessor::vertex_dof_index
                                      *  functions.
                                      */ 
-    int vertex_index (const unsigned int i) const;
+    unsigned int vertex_index (const unsigned int i) const;
 
                                     /**
                                      *  Return a reference to the
@@ -1919,7 +1919,7 @@ class TriaObjectAccessor<2, dim> :  public TriaAccessor<2,dim>
                                      * DoFAccessor::vertex_dof_index
                                      * functions.
                                      */ 
-    int vertex_index (const unsigned int i) const;
+    unsigned int vertex_index (const unsigned int i) const;
 
                                     /**
                                      *  Return a reference to the
@@ -2612,7 +2612,7 @@ class TriaObjectAccessor<3, dim> :  public TriaAccessor<3,dim>
                                      *  @p DoFAccessor::vertex_dof_index
                                      *  functions.
                                      */ 
-    int vertex_index (const unsigned int i) const;
+    unsigned int vertex_index (const unsigned int i) const;
 
                                     /**
                                      *  Return a reference to the
index ae66929542c26f7c3997c5cc4555ae55d04e2b19..487443be793260a341b47c046553de1a62403337 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -609,7 +609,7 @@ GridTools::find_cells_adjacent_to_vertex(const Container<dim> &container,
                                    // if the vertex is part of that cell
    for (; cell != endc; ++cell)
       for (unsigned v = 0; v < GeometryInfo<dim>::vertices_per_cell; v++)
-         if (cell->vertex_index(v) == (int)vertex)
+         if (cell->vertex_index(v) == vertex)
             {
                                    // OK, we found a cell that contains
                                    // the particular vertex. We add it
@@ -659,7 +659,7 @@ GridTools::find_cells_adjacent_to_vertex(const Container<dim> &container,
                             {
                               bool found = false;
                               for (unsigned v=0; v<GeometryInfo<dim>::vertices_per_cell; v++)
-                                 if (nb->vertex_index(v) == (int)vertex)
+                                 if (nb->vertex_index(v) == vertex)
                                   {
                                     found = true;
                                     break;
index 5d8a0567225664b52b886fa28285be1065c0d164..ca121b498ab52b0ba0ab116054f8f5df1449f30b 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
+//    Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -4853,7 +4853,7 @@ unsigned int Triangulation<dim>::max_adjacent_cells () const
   unsigned int max_vertex_index = 0;
   for (; cell!=endc; ++cell)
     for (unsigned vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
-      if (cell->vertex_index(vertex) > (signed int)max_vertex_index)
+      if (cell->vertex_index(vertex) > max_vertex_index)
        max_vertex_index = cell->vertex_index(vertex);
 
                                   // store the number of times a cell
@@ -6817,13 +6817,13 @@ Triangulation<3>::execute_refinement ()
                                             // first vertex is the same middle
                                             // vertex.
            for (unsigned int i=0; i<24; ++i)
-             if (lines[i]->vertex_index((i+1)%2)==static_cast<int>(vertex_indices[i/4]))
+             if (lines[i]->vertex_index((i+1)%2)==vertex_indices[i/4])
                line_orientation[i]=true;
              else
                {
                                                   // it must be the other way
                                                   // round then
-                 Assert(lines[i]->vertex_index(i%2)==static_cast<int>(vertex_indices[i/4]),
+                 Assert(lines[i]->vertex_index(i%2)==vertex_indices[i/4],
                         ExcInternalError());
                  line_orientation[i]=false;
                }
index 03084618967f4813a66605df391ebdd6ff9a0755..5b4a937e9d3ee05fc6d14b0613b8e65b27cfc19b 100644 (file)
@@ -47,7 +47,7 @@ TriaObjectAccessor<1, dim>::set (const internal::Triangulation::TriaObject<1>  &
 
 
 template <int dim>
-int TriaObjectAccessor<1, dim>::vertex_index (const unsigned int i) const
+unsigned int TriaObjectAccessor<1, dim>::vertex_index (const unsigned int i) const
 {
   Assert (i<2, ExcIndexRange(i,0,2));
   return objects().cells[this->present_index].face (i);
@@ -348,7 +348,7 @@ TriaObjectAccessor<2, dim>::set (const internal::Triangulation::TriaObject<2> &q
 
 
 template <int dim>
-int TriaObjectAccessor<2, dim>::vertex_index (const unsigned int corner) const
+unsigned int TriaObjectAccessor<2, dim>::vertex_index (const unsigned int corner) const
 {
   Assert (corner<4, ExcIndexRange(corner,0,4));
 
@@ -889,7 +889,7 @@ TriaObjectAccessor<3, 3>::set (const internal::Triangulation::TriaObject<3> &hex
 
 
 template <int dim>
-int TriaObjectAccessor<3, dim>::vertex_index (const unsigned int corner) const
+unsigned int TriaObjectAccessor<3, dim>::vertex_index (const unsigned int corner) const
 {
   Assert (corner<8, ExcIndexRange(corner,0,8));
 

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.