From 8d0818df0bffbc0f55785f22e4e16a18b21f8a49 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Tue, 22 Sep 2015 11:10:06 -0500 Subject: [PATCH] Improve test for vertex_iterator. --- include/deal.II/grid/tria_accessor.h | 2 +- .../deal.II/grid/tria_accessor.templates.h | 20 +- tests/grid/vertex_iterator.cc | 14 +- tests/grid/vertex_iterator.output | 208 ++++++++++++++++++ 4 files changed, 227 insertions(+), 17 deletions(-) diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index 70f74cc865..ed642565f1 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -632,7 +632,7 @@ public: * dim=1. */ typename dealii::internal::Triangulation::Iterators::vertex_iterator - vertex_it (const unsigned int i) const; + vertex_iterator (const unsigned int i) const; /** * Return the global index of i-th vertex of the current object. The diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 249d03edee..c316abc82b 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -1163,7 +1163,7 @@ TriaAccessor::used () const template inline typename dealii::internal::Triangulation::Iterators::vertex_iterator -TriaAccessor::vertex_it (const unsigned int i) const +TriaAccessor::vertex_iterator (const unsigned int i) const { return typename dealii::internal::Triangulation::Iterators::vertex_iterator (this->tria, 0, vertex_index (i)); @@ -2267,10 +2267,8 @@ TriaAccessor<0, dim, spacedim>::operator != (const TriaAccessor &t) const template inline unsigned int -TriaAccessor<0, dim, spacedim>::vertex_index (const unsigned int i) const +TriaAccessor<0, dim, spacedim>::vertex_index (const unsigned int) const { - Assert(i==0, ExcIndexRange(i, 0, 1)); - (void)i; return global_vertex_index; } @@ -2279,10 +2277,8 @@ TriaAccessor<0, dim, spacedim>::vertex_index (const unsigned int i) const template inline Point & -TriaAccessor<0, dim, spacedim>::vertex (const unsigned int i) const +TriaAccessor<0, dim, spacedim>::vertex (const unsigned int) const { - Assert(i==0, ExcIndexRange(i, 0, 1)); - (void)i; return const_cast &> (this->tria->vertices[global_vertex_index]); } @@ -2343,9 +2339,8 @@ TriaAccessor<0, dim, spacedim>::diameter () const template inline double -TriaAccessor<0, dim, spacedim>::extent_in_direction (const unsigned int axis) const +TriaAccessor<0, dim, spacedim>::extent_in_direction (const unsigned int) const { - (void) axis; return 0.; } @@ -2354,12 +2349,9 @@ TriaAccessor<0, dim, spacedim>::extent_in_direction (const unsigned int axis) co template inline Point -TriaAccessor<0, dim, spacedim>::center (const bool respect_manifold, - const bool use_laplace_transformation) const +TriaAccessor<0, dim, spacedim>::center (const bool, + const bool) const { - // Silence warning - (void) respect_manifold; - (void) use_laplace_transformation; return this->tria->vertices[global_vertex_index]; } diff --git a/tests/grid/vertex_iterator.cc b/tests/grid/vertex_iterator.cc index 4372685c82..c9b6df4e31 100644 --- a/tests/grid/vertex_iterator.cc +++ b/tests/grid/vertex_iterator.cc @@ -35,9 +35,19 @@ void test () for (typename Triangulation<2>::active_cell_iterator cell = tria.begin_active(); cell != tria.end(); ++cell) { - for (unsigned int i = 0; i<4; ++i) - deallog << cell->vertex_it(i)->center() <vertex_iterator(i)->center() <::active_cell_iterator + cell = tria.begin_active(); cell != tria.end(); ++cell) + for (unsigned int i=0; i<4; ++i) + { + for (unsigned int j=0; j<2; ++j) + deallog << cell->line(i)->vertex_iterator(j)->center() <