From: bangerth Date: Sat, 13 Nov 2010 00:56:20 +0000 (+0000) Subject: Instead of giving -1, let index() for vertex iterators return the global index of... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5cf34d13f63189922f75518493739edade0c6196;p=dealii-svn.git Instead of giving -1, let index() for vertex iterators return the global index of the vertex. git-svn-id: https://svn.dealii.org/trunk@22714 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/grid/tria_accessor.h b/deal.II/include/deal.II/grid/tria_accessor.h index 444d9ed428..829bc179fe 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.h +++ b/deal.II/include/deal.II/grid/tria_accessor.h @@ -122,6 +122,7 @@ namespace internal } template class TriaAccessor; template class TriaAccessor<0, dim, spacedim>; +template class TriaAccessor<0, 1, spacedim>; // note: the file tria_accessor.templates.h is included at the end of // this file. this includes a lot of templates. originally, this was @@ -1744,11 +1745,11 @@ class TriaAccessor<0, 1, spacedim> static int level (); /** - * Index of this object. Vertices - * have no index, so this - * function always returns -1. + * Index of this object. Returns + * the global index of the vertex + * this object points to. */ - static int index (); + int index () const; /** * @name Advancement of iterators diff --git a/deal.II/include/deal.II/grid/tria_accessor.templates.h b/deal.II/include/deal.II/grid/tria_accessor.templates.h index 6258e1d2cc..21455826f1 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.templates.h +++ b/deal.II/include/deal.II/grid/tria_accessor.templates.h @@ -2057,9 +2057,9 @@ TriaAccessor<0, 1, spacedim>::level () template inline int -TriaAccessor<0, 1, spacedim>::index () +TriaAccessor<0, 1, spacedim>::index () const { - return -1; + return global_vertex_index; } diff --git a/tests/deal.II/dof_accessor_01/cmp/generic b/tests/deal.II/dof_accessor_01/cmp/generic index 0c55aa31de..5bfd19ba7f 100644 --- a/tests/deal.II/dof_accessor_01/cmp/generic +++ b/tests/deal.II/dof_accessor_01/cmp/generic @@ -1,4 +1,4 @@ -DEAL::-1 -1 +DEAL::3 3 DEAL::40 40 DEAL::281 281