From 3df8fcd2122daaaa544521169b34afd8b9906201 Mon Sep 17 00:00:00 2001
From: Wolfgang Bangerth
Date: Sat, 13 Oct 2012 21:12:41 +0000
Subject: [PATCH] Reintegrate branch_eliminate_iterator_functions.
git-svn-id: https://svn.dealii.org/trunk@27110 0785d39b-7218-0410-832d-ea1e28bc413d
---
deal.II/doc/news/changes.h | 42 +-
deal.II/include/deal.II/distributed/tria.h | 1 -
deal.II/include/deal.II/dofs/dof_accessor.h | 28 +-
.../deal.II/dofs/dof_accessor.templates.h | 49 +-
deal.II/include/deal.II/dofs/dof_handler.h | 550 +-
deal.II/include/deal.II/grid/tria.h | 1109 +-
deal.II/include/deal.II/hp/dof_handler.h | 539 +-
.../deal.II/multigrid/mg_dof_handler.h | 523 +-
.../deal.II/numerics/vector_tools.templates.h | 33 +-
deal.II/source/dofs/dof_handler.cc | 825 +-
deal.II/source/dofs/dof_renumbering.cc | 2 +-
deal.II/source/grid/grid_generator.cc | 8 +-
deal.II/source/grid/grid_out.cc | 121 +-
deal.II/source/grid/tria.cc | 1293 +-
deal.II/source/hp/dof_handler.cc | 1806 +-
deal.II/source/multigrid/mg_dof_handler.cc | 1095 +-
tests/Makefile.paths.in | 2 +-
tests/deal.II/dof_iterators_01.cc | 413 -
tests/deal.II/dof_iterators_01/cmp/generic | 380 -
tests/deal.II/grid_output_input/cmp/generic | 424 +-
.../inhomogeneous_constraints_block.cc | 87 +-
.../inhomogeneous_constraints_nonsymmetric.cc | 79 +-
.../inhomogeneous_constraints_vector.cc | 55 +-
tests/deal.II/iterators_3d.cc | 114 -
tests/deal.II/iterators_3d/cmp/generic | 160 -
tests/deal.II/user_data_01.cc | 183 +-
tests/fe/abf_01.cc | 119 +-
tests/fe/deformed_projection.h | 156 +-
tests/fe/mapping.cc | 72 +-
tests/hp/crash_09.cc | 46 +-
tests/hp/crash_11.cc | 47 +-
tests/hp/crash_16.cc | 93 +-
tests/hp/crash_16/cmp/generic | 14892 ++++++++--------
tests/hp/renumber_block_wise_01a.cc | 118 +
tests/hp/renumber_block_wise_01a/cmp/generic | 2 +
tests/hp/renumber_block_wise_01b.cc | 110 +
tests/hp/renumber_block_wise_01b/cmp/generic | 6 +
tests/serialization/dof_handler_01.cc | 4 +-
tests/serialization/triangulation_01.cc | 4 +-
tests/serialization/triangulation_02.cc | 4 +-
40 files changed, 10135 insertions(+), 15459 deletions(-)
delete mode 100644 tests/deal.II/dof_iterators_01.cc
delete mode 100644 tests/deal.II/dof_iterators_01/cmp/generic
delete mode 100644 tests/deal.II/iterators_3d.cc
delete mode 100644 tests/deal.II/iterators_3d/cmp/generic
create mode 100644 tests/hp/renumber_block_wise_01a.cc
create mode 100644 tests/hp/renumber_block_wise_01a/cmp/generic
create mode 100644 tests/hp/renumber_block_wise_01b.cc
create mode 100644 tests/hp/renumber_block_wise_01b/cmp/generic
diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h
index 31b9d59707..49469fe476 100644
--- a/deal.II/doc/news/changes.h
+++ b/deal.II/doc/news/changes.h
@@ -24,6 +24,46 @@ inconvenience this causes.
+- Removed: The Triangulation and DoFHandler classes had a great number
+of functions that allowed to get the first and last iterators to cells,
+faces, lines, quads and hexes overall and on each level of the mesh
+hierarchy individually. While conceptually a nice idea to offer such a
+rich set of functions, there are two factors that led us to drastically
+reduce this set of functions: (i) A large interface makes it more
+difficult to fully document what every function is doing and more
+difficult to find what one is looking for. (ii) A large interface
+makes it incredibly difficult to evolve the data structures on which
+these functions operate. We felt that the many functions we have impeded
+our ability to make changes to the internal storage of data. A survey
+of the deal.II code base as well as some larger applications also shows
+that most of these functions are rarely used, if at all.
+
+Consequently, most of these functions have been removed. The only functions
+that remain are the following (for each of the Triangulation and the
+various DoFHandler classes):
+
+
+ cell_iterator begin (const unsigned int level = 0) const;
+ active_cell_iterator begin_active(const unsigned int level = 0) const;
+ cell_iterator end () const;
+ cell_iterator end (const unsigned int level) const;
+ active_cell_iterator end_active (const unsigned int level) const;
+
+
+
+Codes that have previously used functions like begin_active_line
+etc. to loop over the lines or quads of a triangulation need to be changed
+to loop over cells, and on each cell loop over the lines or quads of this
+cell. In most cases we have encountered (in deal.II or its testsuite) this
+was a rather trivial modification. A case to watch out for is that the
+old loop over all lines encountered all lines only once whereas one may
+encounter it multiple times when looping over all cells and then the lines
+of each cell. This case is easily avoided by flagging each treated line
+using the @ref GlossUserFlags "user flags" associated with lines, quads,
+and cells.
+
+(Wolfgang Bangerth, 2012/09/22)
+
- New: In the past, deal.II used a std::vector of bools in many places
to denote component masks (see @ref GlossComponentMask) as well as for
block masks (see @ref GlossBlockMask). This was neither
@@ -53,7 +93,7 @@ one that takes a BlockMask. Call sites need to be adjusted.
(Wolfgang Bangerth, 2012/09/22)
- - Changed: the optional argument offset got removed from
+
- Removed: the optional argument offset got removed from
DoFHandler and MGDoFHandler::distribute_dofs() because it was
never working correctly and it is not used.
diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h
index c91de99454..797d8c436f 100644
--- a/deal.II/include/deal.II/distributed/tria.h
+++ b/deal.II/include/deal.II/distributed/tria.h
@@ -224,7 +224,6 @@ namespace parallel
*/
typedef typename dealii::Triangulation::active_cell_iterator active_cell_iterator;
typedef typename dealii::Triangulation::cell_iterator cell_iterator;
- typedef typename dealii::Triangulation::raw_cell_iterator raw_cell_iterator;
/**
* Generic settings for distributed
diff --git a/deal.II/include/deal.II/dofs/dof_accessor.h b/deal.II/include/deal.II/dofs/dof_accessor.h
index 80e764059c..c675f1e55c 100644
--- a/deal.II/include/deal.II/dofs/dof_accessor.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.h
@@ -310,14 +310,24 @@ class DoFAccessor : public dealii::internal::DoFAccessor::Inheritance::line_iterator
line (const unsigned int i) const;
/**
* Pointer to the @p ith quad
- * bounding this object.
+ * bounding this object. If the
+ * current object is a quad itself,
+ * then the only valid index is
+ * @p i equals to zero, and the
+ * function returns an iterator
+ * to itself.
*/
typename dealii::internal::DoFHandler::Iterators::quad_iterator
quad (const unsigned int i) const;
@@ -974,14 +984,24 @@ class DoFAccessor<0,DH<1,spacedim> > : public TriaAccessor<0,1,spacedim>
/**
* Pointer to the @p ith line
- * bounding this object.
+ * bounding this object. If the
+ * current object is a line itself,
+ * then the only valid index is
+ * @p i equals to zero, and the
+ * function returns an iterator
+ * to itself.
*/
typename dealii::internal::DoFHandler::Iterators >::line_iterator
line (const unsigned int i) const;
/**
* Pointer to the @p ith quad
- * bounding this object.
+ * bounding this object. If the
+ * current object is a quad itself,
+ * then the only valid index is
+ * @p i equals to zero, and the
+ * function returns an iterator
+ * to itself.
*/
typename dealii::internal::DoFHandler::Iterators >::quad_iterator
quad (const unsigned int i) const;
diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
index 3db0ddefe8..cefac603cc 100644
--- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
@@ -737,7 +737,8 @@ namespace internal
Assert ((dim==structdim
?
typename
- dealii::DoFHandler::
+ dealii::internal::DoFHandler::
+ Iterators >::
raw_cell_iterator (&dof_handler.get_tria(),
obj_level,
obj_index,
@@ -746,7 +747,8 @@ namespace internal
(structdim==1
?
typename
- dealii::DoFHandler::
+ dealii::internal::DoFHandler::
+ Iterators >::
raw_line_iterator (&dof_handler.get_tria(),
obj_level,
obj_index,
@@ -787,7 +789,8 @@ namespace internal
Assert ((dim==structdim
?
typename
- dealii::DoFHandler::
+ dealii::internal::DoFHandler::
+ Iterators >::
raw_cell_iterator (&dof_handler.get_tria(),
obj_level,
obj_index,
@@ -796,7 +799,8 @@ namespace internal
(structdim==1
?
typename
- dealii::DoFHandler::
+ dealii::internal::DoFHandler::
+ Iterators >::
raw_line_iterator (&dof_handler.get_tria(),
obj_level,
obj_index,
@@ -1782,7 +1786,23 @@ inline
typename dealii::internal::DoFHandler::Iterators::line_iterator
DoFAccessor::line (const unsigned int i) const
{
- Assert (structdim > 1, ExcImpossibleInDim(structdim));
+ // if we are asking for a
+ // particular line and this object
+ // refers to a line, then the only
+ // valid index is i==0 and we
+ // should return *this
+ if (structdim == 1)
+ {
+ Assert (i==0, ExcMessage ("You can only ask for line zero if the "
+ "current object is a line itself."));
+ return
+ typename dealii::internal::DoFHandler::Iterators::cell_iterator
+ (&this->get_triangulation(),
+ this->level(),
+ this->index(),
+ &this->get_dof_handler());
+ }
+
// checking of 'i' happens in
// line_index(i)
@@ -1801,6 +1821,25 @@ inline
typename dealii::internal::DoFHandler::Iterators::quad_iterator
DoFAccessor::quad (const unsigned int i) const
{
+ // if we are asking for a
+ // particular quad and this object
+ // refers to a quad, then the only
+ // valid index is i==0 and we
+ // should return *this
+ if (structdim == 2)
+ {
+ Assert (i==0, ExcMessage ("You can only ask for quad zero if the "
+ "current object is a quad itself."));
+ return
+ typename dealii::internal::DoFHandler::Iterators::cell_iterator
+ (&this->get_triangulation(),
+ this->level(),
+ this->index(),
+ &this->get_dof_handler());
+ }
+
+ // otherwise we need to be in
+ // structdim>=3
Assert (structdim > 2, ExcImpossibleInDim(structdim));
// checking of 'i' happens in
// quad_index(i)
diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h
index 4083a4c94b..204e1b747f 100644
--- a/deal.II/include/deal.II/dofs/dof_handler.h
+++ b/deal.II/include/deal.II/dofs/dof_handler.h
@@ -71,21 +71,20 @@ namespace internal
*
* The class offers iterators to traverse all cells, in much the same way as
* the Triangulation class does. Using the begin() and end() functions (and
- * all their companions, like begin_active(), begin_line(), etc, just as for
- * the Triangulation class), one can obtain iterators to walk over cells, and
+ * companions, like begin_active()), one can obtain iterators to walk over cells, and
* query the degree of freedom structures as well as the triangulation data.
* These iterators are built on top of those of the Triangulation class, but
- * offer the additional information on degrees of freedom functionality than
+ * offer the additional information on degrees of freedom functionality compared to
* pure triangulation iterators. The order in which dof iterators are
* presented by the ++ and -- operators is the same as that
- * for the corresponding triangulation iterators.
+ * for the corresponding iterators traversing the triangulation on which this
+ * DoFHandler is constructed.
*
* The spacedim parameter has to be used if one wants to
- * solve problems in the boundary element method formulation or in an
- * equivalent one, as it is explained in the Triangulation class. If
- * not specified, this parameter takes the default value =dim
- * so that this class can be used to solve problems in the finite
- * element method formulation.
+ * solve problems on surfaces. If not specified, this parameter takes
+ * the default value =dim implying that we want to solve
+ * problems in a domain whose dimension equals the dimension of the
+ * space in which it is embedded.
*
*
* Distribution of indices for degrees of freedom
@@ -176,23 +175,18 @@ class DoFHandler : public Subscriptor
typedef typename IteratorSelector::CellAccessor cell_accessor;
typedef typename IteratorSelector::FaceAccessor face_accessor;
- typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
typedef typename IteratorSelector::line_iterator line_iterator;
typedef typename IteratorSelector::active_line_iterator active_line_iterator;
- typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
typedef typename IteratorSelector::quad_iterator quad_iterator;
typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
- typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
typedef typename IteratorSelector::hex_iterator hex_iterator;
typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
- typedef typename IteratorSelector::raw_cell_iterator raw_cell_iterator;
typedef typename IteratorSelector::cell_iterator cell_iterator;
typedef typename IteratorSelector::active_cell_iterator active_cell_iterator;
- typedef typename IteratorSelector::raw_face_iterator raw_face_iterator;
typedef typename IteratorSelector::face_iterator face_iterator;
typedef typename IteratorSelector::active_face_iterator active_face_iterator;
@@ -469,539 +463,53 @@ class DoFHandler : public Subscriptor
*/
unsigned int max_couplings_between_boundary_dofs () const;
+ /*--------------------------------------*/
+
/**
* @name Cell iterator functions
*/
/*@{*/
/**
- * Iterator to the first cell, used
- * or not, on level @p level. If a level
- * has no cells, a past-the-end iterator
- * is returned.
- */
- raw_cell_iterator begin_raw (const unsigned int level = 0) const DEAL_II_DEPRECATED;
-
- /**
- * Iterator to the first used cell
- * on level @p level.
- *
- * This function calls @p begin_line
- * in 1D and @p begin_quad in 2D.
+ * Iterator to the first used
+ * cell on level @p level.
*/
cell_iterator begin (const unsigned int level = 0) const;
/**
- * Iterator to the first active
- * cell on level @p level.
- *
- * This function calls @p begin_active_line
- * in 1D and @p begin_active_quad in 2D.
+ * Iterator to the first active
+ * cell on level @p level.
*/
active_cell_iterator begin_active(const unsigned int level = 0) const;
/**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- *
- * This function calls @p end_line
- * in 1D and @p end_quad in 2D.
+ * Iterator past the end; this
+ * iterator serves for
+ * comparisons of iterators with
+ * past-the-end or
+ * before-the-beginning states.
*/
- raw_cell_iterator end () const;
+ cell_iterator end () const;
/**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
+ * Return an iterator which is
+ * the first iterator not on
+ * level. If @p level is the
+ * last level, then this returns
* end().
*/
cell_iterator end (const unsigned int level) const;
/**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_cell_iterator end_raw (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
+ * Return an active iterator
+ * which is the first iterator
+ * not on level. If @p level is
+ * the last level, then this
+ * returns end().
*/
active_cell_iterator end_active (const unsigned int level) const;
- /**
- * Return an iterator pointing to the
- * last cell, used or not.
- */
- raw_cell_iterator last_raw () const DEAL_II_DEPRECATED;
-
- /**
- * Return an iterator pointing to the last
- * cell of the level @p level, used or not.
- */
- raw_cell_iterator last_raw (const unsigned int level) const DEAL_II_DEPRECATED;
-
- /**
- * Return an iterator pointing to the last
- * used cell.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
- */
- cell_iterator last () const;
-
- /**
- * Return an iterator pointing to the last
- * used cell on level @p level.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
- */
- cell_iterator last (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active cell.
- *
- * This function calls @p last_active_line
- * in 1D and @p last_active_quad in 2D.
- */
- active_cell_iterator last_active () const;
-
- /**
- * Return an iterator pointing to the last
- * active cell on level @p level.
- *
- * This function calls @p last_active_line
- * in 1D and @p last_active_quad in 2D.
- */
- active_cell_iterator last_active (const unsigned int level) const;
- //@}
-
- /*---------------------------------------*/
-
- /**
- * @name Face iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first face, used
- * or not, on level @p level. If a level
- * has no faces, a past-the-end iterator
- * is returned.
- */
- raw_face_iterator begin_raw_face () const DEAL_II_DEPRECATED;
-
- /**
- * Iterator to the first used face
- * on level @p level.
- *
- * This function calls @p begin_line
- * in 2D and @p begin_quad in 3D.
- */
- face_iterator begin_face () const;
-
- /**
- * Iterator to the first active
- * face on level @p level.
- *
- * This function calls @p begin_active_line
- * in 2D and @p begin_active_quad in 3D.
- */
- active_face_iterator begin_active_face() const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- *
- * This function calls @p end_line
- * in 2D and @p end_quad in 3D.
- */
- raw_face_iterator end_face () const;
-
- /**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_face_iterator end_raw_face () const DEAL_II_DEPRECATED;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_face_iterator end_active_face () const;
-
- /**
- * Return an iterator pointing to the
- * last face, used or not.
- */
- raw_face_iterator last_raw_face () const DEAL_II_DEPRECATED;
-
- /**
- * Return an iterator pointing to the last
- * used face.
- *
- * This function calls @p last_line
- * in 2D and @p last_quad in 3D.
- */
- face_iterator last_face () const;
-
- /**
- * Return an iterator pointing to the last
- * used face on level @p level.
- *
- * This function calls @p last_line
- * in 2D and @p last_quad in 3D.
- */
- face_iterator last_face (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active face.
- *
- * This function calls @p last_active_line
- * in 2D and @p last_active_quad in 3D.
- */
- active_face_iterator last_active_face () const;
-
//@}
-
- /*---------------------------------------*/
-
- /**
- * @name Line iterator functions
- */
- /*@{*/
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Iterator to the first line, used
- * or not, on level @p level. If a level
- * has no lines, a past-the-end iterator
- * is returned.
- */
- raw_line_iterator begin_raw_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used line
- * on level @p level.
- */
- line_iterator begin_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * line on level @p level.
- */
- active_line_iterator begin_active_line(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_line_iterator end_line () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- line_iterator end_line (const unsigned int level) const;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_line_iterator end_raw_line (const unsigned int level) const DEAL_II_DEPRECATED;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_line_iterator end_active_line (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to the
- * last line, used or not.
- */
- raw_line_iterator last_raw_line () const;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return an iterator pointing to the last
- * line of the level @p level, used or not.
- */
- raw_line_iterator last_raw_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used line.
- */
- line_iterator last_line () const;
-
- /**
- * Return an iterator pointing to the last
- * used line on level @p level.
- */
- line_iterator last_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active line.
- */
- active_line_iterator last_active_line () const;
-
- /**
- * Return an iterator pointing to the last
- * active line on level @p level.
- */
- active_line_iterator last_active_line (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Quad iterator functions*/
- /*@{
- */
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Iterator to the first quad, used
- * or not, on level @p level. If a level
- * has no quads, a past-the-end iterator
- * is returned.
- */
- raw_quad_iterator begin_raw_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used quad
- * on level @p level.
- */
- quad_iterator begin_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * quad on level @p level.
- */
- active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_quad_iterator end_quad () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- quad_iterator end_quad (const unsigned int level) const;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_quad_iterator end_raw_quad (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_quad_iterator end_active_quad (const unsigned int level) const;
-
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return an iterator pointing to the
- * last quad, used or not.
- */
- raw_quad_iterator last_raw_quad () const;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return an iterator pointing to the last
- * quad of the level @p level, used or not.
- */
- raw_quad_iterator last_raw_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used quad.
- */
- quad_iterator last_quad () const;
-
- /**
- * Return an iterator pointing to the last
- * used quad on level @p level.
- */
- quad_iterator last_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active quad.
- */
- active_quad_iterator last_active_quad () const;
-
- /**
- * Return an iterator pointing to the last
- * active quad on level @p level.
- */
- active_quad_iterator last_active_quad (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Hex iterator functions*/
- /*@{
- */
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Iterator to the first hex, used
- * or not, on level @p level. If a level
- * has no hexs, a past-the-end iterator
- * is returned.
- */
- raw_hex_iterator
- begin_raw_hex (const unsigned int level = 0) const DEAL_II_DEPRECATED;
-
- /**
- * Iterator to the first used hex
- * on level @p level.
- */
- hex_iterator
- begin_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * hex on level @p level.
- */
- active_hex_iterator
- begin_active_hex(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_hex_iterator end_hex () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- hex_iterator end_hex (const unsigned int level) const;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_hex_iterator end_raw_hex (const unsigned int level) const DEAL_II_DEPRECATED;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_hex_iterator end_active_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last hex, used or not.
- */
- raw_hex_iterator last_raw_hex () const DEAL_II_DEPRECATED;
-
- /**
- * @deprecated Raw iterators
- * should not be used.
- *
- * Return an iterator pointing to the last
- * hex of the level @p level, used or not.
- */
- raw_hex_iterator last_raw_hex (const unsigned int level) const DEAL_II_DEPRECATED;
-
- /**
- * Return an iterator pointing to the last
- * used hex.
- */
- hex_iterator
- last_hex () const;
-
- /**
- * Return an iterator pointing to the last
- * used hex on level @p level.
- */
- hex_iterator
- last_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active hex.
- */
- active_hex_iterator
- last_active_hex () const;
-
- /**
- * Return an iterator pointing to the last
- * active hex on level @p level.
- */
- active_hex_iterator
- last_active_hex (const unsigned int level) const;
- /*@}*/
-
/*---------------------------------------*/
diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h
index 98cf4aaf72..5a86a54f24 100644
--- a/deal.II/include/deal.II/grid/tria.h
+++ b/deal.II/include/deal.II/grid/tria.h
@@ -48,6 +48,8 @@ namespace internal
template class TriaLevel;
template class TriaFaces;
+ template class TriaObjects;
+
/**
* Forward declaration of a class into
* which we put much of the
@@ -1428,38 +1430,18 @@ class Triangulation : public Subscriptor
maximum_smoothing = 0xffff ^ allow_anisotropic_smoothing
};
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- */
- typedef TriaRawIterator > raw_cell_iterator;
typedef TriaIterator > cell_iterator;
typedef TriaActiveIterator > active_cell_iterator;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- */
- typedef TriaRawIterator > raw_face_iterator;
typedef TriaIterator > face_iterator;
typedef TriaActiveIterator > active_face_iterator;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- */
- typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
typedef typename IteratorSelector::line_iterator line_iterator;
typedef typename IteratorSelector::active_line_iterator active_line_iterator;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- */
- typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
typedef typename IteratorSelector::quad_iterator quad_iterator;
typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- */
- typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
typedef typename IteratorSelector::hex_iterator hex_iterator;
typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
@@ -2605,35 +2587,15 @@ class Triangulation : public Subscriptor
* @name Cell iterator functions
*/
/*@{*/
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Iterator to the first cell, used
- * or not, on level @p level. If a level
- * has no cells, a past-the-end iterator
- * is returned.
- *
- * This function calls begin_raw_line()
- * in 1D and begin_raw_quad() in 2D.
- */
- raw_cell_iterator begin_raw (const unsigned int level = 0) const;
-
/**
* Iterator to the first used cell
* on level @p level.
- *
- * This function calls @p begin_line
- * in 1D and @p begin_quad in 2D.
*/
cell_iterator begin (const unsigned int level = 0) const;
/**
* Iterator to the first active
* cell on level @p level.
- *
- * This function calls @p
- * begin_active_line in 1D and @p
- * begin_active_quad in 2D.
*/
active_cell_iterator begin_active(const unsigned int level = 0) const;
@@ -2642,11 +2604,8 @@ class Triangulation : public Subscriptor
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
- *
- * This function calls @p end_line
- * in 1D and @p end_quad in 2D.
*/
- raw_cell_iterator end () const;
+ cell_iterator end () const;
/**
* Return an iterator which is the first
@@ -2656,16 +2615,6 @@ class Triangulation : public Subscriptor
*/
cell_iterator end (const unsigned int level) const;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_cell_iterator end_raw (const unsigned int level) const;
-
/**
* Return an active iterator which is the
* first iterator not on level. If @p level
@@ -2675,63 +2624,27 @@ class Triangulation : public Subscriptor
active_cell_iterator end_active (const unsigned int level) const;
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last cell, used or not.
- *
- * This function calls @p last_raw_line
- * in 1D and @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last cell of the level @p level, used
- * or not.
- *
- * This function calls @p last_raw_line
- * in 1D and @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw (const unsigned int level) const;
-
/**
* Return an iterator pointing to the
* last used cell.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
*/
cell_iterator last () const;
/**
* Return an iterator pointing to the
* last used cell on level @p level.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
*/
cell_iterator last (const unsigned int level) const;
/**
* Return an iterator pointing to the
* last active cell.
- *
- * This function calls @p
- * last_active_line in 1D and @p
- * last_active_quad in 2D.
*/
active_cell_iterator last_active () const;
/**
* Return an iterator pointing to the
* last active cell on level @p level.
- *
- * This function calls @p last_active_line
- * in 1D and @p last_active_quad in 2D.
*/
active_cell_iterator last_active (const unsigned int level) const;
/*@}*/
@@ -2743,33 +2656,14 @@ class Triangulation : public Subscriptor
* @name Face iterator functions
*/
/*@{*/
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Iterator to the first face, used
- * or not. As faces have no level,
- * no argument can be given.
- *
- * This function calls @p begin_raw_line
- * in 2D and @p begin_raw_quad in 3D.
- */
- raw_face_iterator begin_raw_face () const;
-
/**
* Iterator to the first used face.
- *
- * This function calls @p begin_line
- * in 2D and @p begin_quad in 3D.
*/
face_iterator begin_face () const;
/**
* Iterator to the first active
* face.
- *
- * This function calls @p
- * begin_active_line in 2D and @p
- * begin_active_quad in 3D.
*/
active_face_iterator begin_active_face() const;
@@ -2778,638 +2672,170 @@ class Triangulation : public Subscriptor
* iterator serves for comparisons of
* iterators with past-the-end or
* before-the-beginning states.
- *
- * This function calls @p end_line
- * in 2D and @p end_quad in 3D.
- */
- raw_face_iterator end_face () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return a raw iterator which is past
- * the end. This is the same as
- * end() and is only for
- * combatibility with older versions.
- */
- raw_face_iterator end_raw_face () const;
-
- /**
- * Return an active iterator which is
- * past the end. This is the same as
- * end() and is only for
- * combatibility with older versions.
- */
- active_face_iterator end_active_face () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last face, used or not.
- *
- * This function calls @p last_raw_line
- * in 2D and @p last_raw_quad in 3D.
- */
- raw_face_iterator last_raw_face () const;
-
- /**
- * Return an iterator pointing to the
- * last used face.
- *
- * This function calls @p last_line in
- * 2D and @p last_quad in 3D.
- */
- face_iterator last_face () const;
-
- /**
- * Return an iterator pointing to the
- * last active face.
- *
- * This function calls @p
- * last_active_line in 2D and @p
- * last_active_quad in 3D.
*/
- active_face_iterator last_active_face () const;
-
+ face_iterator end_face () const;
/*@}*/
/*---------------------------------------*/
/**
- * @name Line iterator functions
+ * @name Information about the triangulation
*/
/*@{*/
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Iterator to the first line, used or
- * not, on level @p level. If a level
- * has no lines, a past-the-end iterator
- * is returned.
- * If lines are no cells, i.e. for @p dim>1
- * no @p level argument must be given.
- * The same applies for all the other functions
- * above, of course.
- */
- raw_line_iterator
- begin_raw_line (const unsigned int level = 0) const;
/**
- * Iterator to the first used line
- * on level @p level.
+ * In the following, most
+ * functions are provided in two
+ * versions, with and without an
+ * argument describing the
+ * level. The versions with this
+ * argument are only applicable
+ * for objects describing the
+ * cells of the present
+ * triangulation. For example: in
+ * 2D n_lines(level)
+ * cannot be called, only
+ * n_lines(), as lines
+ * are faces in 2D and therefore
+ * have no level.
*/
- line_iterator
- begin_line (const unsigned int level = 0) const;
/**
- * Iterator to the first active
- * line on level @p level.
+ * Return total number of used lines,
+ * active or not.
*/
- active_line_iterator
- begin_active_line(const unsigned int level = 0) const;
+ unsigned int n_lines () const;
/**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
+ * Return total number of used lines,
+ * active or not on level @p level.
*/
- raw_line_iterator
- end_line () const;
+ unsigned int n_lines (const unsigned int level) const;
/**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
+ * Return total number of active lines.
*/
- line_iterator end_line (const unsigned int level) const;
+ unsigned int n_active_lines () const;
/**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return a raw iterator which is the
- * first iterator not on level. If @p
- * level is the last level, then this
- * returns end().
+ * Return total number of active lines,
+ * on level @p level.
*/
- raw_line_iterator end_raw_line (const unsigned int level) const;
+ unsigned int n_active_lines (const unsigned int level) const;
/**
- * Return an active iterator which is the
- * first iterator not on level. If @p
- * level is the last level, then this
- * returns end().
+ * Return total number of used quads,
+ * active or not.
*/
- active_line_iterator end_active_line (const unsigned int level) const;
+ unsigned int n_quads () const;
/**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last line, used or not.
+ * Return total number of used quads,
+ * active or not on level @p level.
*/
- raw_line_iterator
- last_raw_line () const;
+ unsigned int n_quads (const unsigned int level) const;
/**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last line of the level @p level, used
- * or not.
+ * Return total number of active quads,
+ * active or not.
*/
- raw_line_iterator
- last_raw_line (const unsigned int level) const;
+ unsigned int n_active_quads () const;
/**
- * Return an iterator pointing to the
- * last used line.
+ * Return total number of active quads,
+ * active or not on level @p level.
*/
- line_iterator
- last_line () const;
+ unsigned int n_active_quads (const unsigned int level) const;
/**
- * Return an iterator pointing to the
- * last used line on level @p level.
+ * Return total number of used
+ * hexahedra, active or not.
*/
- line_iterator
- last_line (const unsigned int level) const;
+ unsigned int n_hexs() const;
/**
- * Return an iterator pointing to the
- * last active line.
+ * Return total number of used
+ * hexahedra, active or not on level @p
+ * level.
*/
- active_line_iterator
- last_active_line () const;
+ unsigned int n_hexs(const unsigned int level) const;
/**
- * Return an iterator pointing to the
- * last active line on level @p level.
+ * Return total number of active
+ * hexahedra, active or not.
*/
- active_line_iterator
- last_active_line (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
+ unsigned int n_active_hexs() const;
/**
- * @name Quad iterator functions
- */
- /*@{
+ * Return total number of active
+ * hexahedra, active or not on level @p
+ * level.
*/
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Iterator to the first quad, used or
- * not, on the given level. If a level
- * has no quads, a past-the-end iterator
- * is returned. If quads are no cells,
- * i.e. for $dim>2$ no level argument
- * must be given.
+ unsigned int n_active_hexs(const unsigned int level) const;
+ /**
+ * Return total number of used cells,
+ * active or not. Maps to
+ * n_lines() in one space
+ * dimension and so on.
*/
- raw_quad_iterator
- begin_raw_quad (const unsigned int level = 0) const;
+ unsigned int n_cells () const;
/**
- * Iterator to the first used quad
- * on level @p level.
+ * Return total number of used cells,
+ * active or not, on level @p level.
+ * Maps to n_lines(level) in
+ * one space dimension and so on.
*/
- quad_iterator
- begin_quad (const unsigned int level = 0) const;
+ unsigned int n_cells (const unsigned int level) const;
/**
- * Iterator to the first active
- * quad on level @p level.
+ * Return total number of active cells.
+ * Maps to n_active_lines() in
+ * one space dimension and so on.
*/
- active_quad_iterator
- begin_active_quad(const unsigned int level = 0) const;
+ unsigned int n_active_cells () const;
/**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
+ * Return total number of active cells on
+ * level @p level. Maps to
+ * n_active_lines(level) in one
+ * space dimension and so on.
*/
- raw_quad_iterator end_quad () const;
+ unsigned int n_active_cells (const unsigned int level) const;
/**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
+ * Return total number of used faces,
+ * active or not. In 2D, the result
+ * equals n_lines(), while in 3D it
+ * equals n_quads(). Since there are no
+ * face objects in 1d, the function
+ * returns zero in 1d.
*/
- quad_iterator end_quad (const unsigned int level) const;
+ unsigned int n_faces () const;
/**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return a raw iterator which is the
- * first iterator not on level. If @p
- * level is the last level, then this
- * returns end().
+ * Return total number of active faces,
+ * active or not. In 2D, the result
+ * equals n_active_lines(), while in 3D
+ * it equals n_active_quads(). Since
+ * there are no face objects in 1d, the
+ * function returns zero in 1d.
*/
- raw_quad_iterator end_raw_quad (const unsigned int level) const;
+ unsigned int n_active_faces () const;
/**
- * Return an active iterator which is the
- * first iterator not on level. If @p
- * level is the last level, then this
- * returns end().
+ * Return number of levels in use. This
+ * may be less than the number of levels
+ * existing in the triangulation if by
+ * coarsening the highest level was
+ * completely depopulated. That level is
+ * not removed, since it will most likely
+ * be repopulated soon by the next
+ * refinement process.
*/
- active_quad_iterator end_active_quad (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last quad, used or not.
- */
- raw_quad_iterator
- last_raw_quad () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last quad of the level @p level, used
- * or not.
-
- */
- raw_quad_iterator
- last_raw_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last used quad.
- */
- quad_iterator
- last_quad () const;
-
- /**
- * Return an iterator pointing to the
- * last used quad on level @p level.
- */
- quad_iterator
- last_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last active quad.
- */
- active_quad_iterator
- last_active_quad () const;
-
- /**
- * Return an iterator pointing to the
- * last active quad on level @p level.
- */
- active_quad_iterator
- last_active_quad (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Hex iterator functions
- */
- /*@{
- */
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Iterator to the first hex, used
- * or not, on level @p level. If a level
- * has no hexs, a past-the-end iterator
- * is returned.
- */
- raw_hex_iterator
- begin_raw_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used hex
- * on level @p level.
- */
- hex_iterator
- begin_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * hex on level @p level.
- */
- active_hex_iterator
- begin_active_hex(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_hex_iterator end_hex () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- hex_iterator end_hex (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_hex_iterator end_raw_hex (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p
- * level is the last level, then this
- * returns end().
- */
- active_hex_iterator end_active_hex (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last hex, used or not.
- */
- raw_hex_iterator last_raw_hex () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return an iterator pointing to the
- * last hex of the level @p level, used
- * or not.
-
- */
- raw_hex_iterator
- last_raw_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last used hex.
- */
- hex_iterator
- last_hex () const;
-
- /**
- * Return an iterator pointing to the
- * last used hex on level @p level.
- */
- hex_iterator
- last_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last active hex.
- */
- active_hex_iterator
- last_active_hex () const;
-
- /**
- * Return an iterator pointing to the
- * last active hex on level @p level.
- */
- active_hex_iterator
- last_active_hex (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Information about the triangulation
- */
- /*@{*/
-
- /**
- * In the following, most
- * functions are provided in two
- * versions, with and without an
- * argument describing the
- * level. The versions with this
- * argument are only applicable
- * for objects descibing the
- * cells of the present
- * triangulation. For example: in
- * 2D n_lines(level)
- * cannot be called, only
- * n_lines(), as lines
- * are faces in 2D and therefore
- * have no level.
- */
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Total Number of lines, used or
- * unused.
- */
- unsigned int n_raw_lines () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Number of lines, used or
- * unused, on the given level.
- */
- unsigned int n_raw_lines (const unsigned int level) const;
-
- /**
- * Return total number of used lines,
- * active or not.
- */
- unsigned int n_lines () const;
-
- /**
- * Return total number of used lines,
- * active or not on level @p level.
- */
- unsigned int n_lines (const unsigned int level) const;
-
- /**
- * Return total number of active lines.
- */
- unsigned int n_active_lines () const;
-
- /**
- * Return total number of active lines,
- * on level @p level.
- */
- unsigned int n_active_lines (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Total number of quads, used or
- * unused.
- */
- unsigned int n_raw_quads () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Number of quads, used or
- * unused, on the given level.
- */
- unsigned int n_raw_quads (const unsigned int level) const;
-
- /**
- * Return total number of used quads,
- * active or not.
- */
- unsigned int n_quads () const;
-
- /**
- * Return total number of used quads,
- * active or not on level @p level.
- */
- unsigned int n_quads (const unsigned int level) const;
-
- /**
- * Return total number of active quads,
- * active or not.
- */
- unsigned int n_active_quads () const;
-
- /**
- * Return total number of active quads,
- * active or not on level @p level.
- */
- unsigned int n_active_quads (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Total number of hexs, used or
- * unused.
- */
- unsigned int n_raw_hexs () const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Number of hexs, used or
- * unused, on the given level.
- */
- unsigned int n_raw_hexs (const unsigned int level) const;
-
- /**
- * Return total number of used
- * hexahedra, active or not.
- */
- unsigned int n_hexs() const;
-
- /**
- * Return total number of used
- * hexahedra, active or not on level @p
- * level.
- */
- unsigned int n_hexs(const unsigned int level) const;
-
- /**
- * Return total number of active
- * hexahedra, active or not.
- */
- unsigned int n_active_hexs() const;
-
- /**
- * Return total number of active
- * hexahedra, active or not on level @p
- * level.
- */
- unsigned int n_active_hexs(const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Number of cells, used or
- * unused, on the given level.
- */
- unsigned int n_raw_cells (const unsigned int level) const;
-
- /**
- * Return total number of used cells,
- * active or not. Maps to
- * n_lines() in one space
- * dimension and so on.
- */
- unsigned int n_cells () const;
-
- /**
- * Return total number of used cells,
- * active or not, on level @p level.
- * Maps to n_lines(level) in
- * one space dimension and so on.
- */
- unsigned int n_cells (const unsigned int level) const;
-
- /**
- * Return total number of active cells.
- * Maps to n_active_lines() in
- * one space dimension and so on.
- */
- unsigned int n_active_cells () const;
-
- /**
- * Return total number of active cells on
- * level @p level. Maps to
- * n_active_lines(level) in one
- * space dimension and so on.
- */
- unsigned int n_active_cells (const unsigned int level) const;
-
- /**
- * @deprecated The use of raw iterators is highly disencouraged and they might go away in future releases
- *
- * Return total number of faces,
- * used or not. In 2d, the result
- * equals n_raw_lines(), while in 3d it
- * equals n_raw_quads().
- */
- unsigned int n_raw_faces () const;
-
- /**
- * Return total number of used faces,
- * active or not. In 2D, the result
- * equals n_lines(), while in 3D it
- * equals n_quads(). Since there are no
- * face objects in 1d, the function
- * returns zero in 1d.
- */
- unsigned int n_faces () const;
-
- /**
- * Return total number of active faces,
- * active or not. In 2D, the result
- * equals n_active_lines(), while in 3D
- * it equals n_active_quads(). Since
- * there are no face objects in 1d, the
- * function returns zero in 1d.
- */
- unsigned int n_active_faces () const;
-
- /**
- * Return number of levels in use. This
- * may be less than the number of levels
- * existing in the triangulation if by
- * coarsening the highest level was
- * completely depopulated. That level is
- * not removed, since it will most likely
- * be repopulated soon by the next
- * refinement process.
- */
- unsigned int n_levels () const;
+ unsigned int n_levels () const;
/**
* Return the total number of
@@ -3510,6 +2936,167 @@ class Triangulation : public Subscriptor
virtual types::subdomain_id locally_owned_subdomain () const;
/*@}*/
+ /**
+ * @name Internal information about the number of objects
+ */
+ /*@{*/
+
+ /**
+ * Total number of lines, used or
+ * unused.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_lines () const;
+
+ /**
+ * Number of lines, used or
+ * unused, on the given level.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_lines (const unsigned int level) const;
+
+ /**
+ * Total number of quads, used or
+ * unused.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_quads () const;
+
+ /**
+ * Number of quads, used or
+ * unused, on the given level.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_quads (const unsigned int level) const;
+
+ /**
+ * Total number of hexs, used or
+ * unused.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_hexs () const;
+
+ /**
+ * Number of hexs, used or
+ * unused, on the given level.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_hexs (const unsigned int level) const;
+
+ /**
+ * Number of cells, used or
+ * unused, on the given level.
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_cells (const unsigned int level) const;
+
+ /**
+ * Return total number of faces,
+ * used or not. In 2d, the result
+ * equals n_raw_lines(), while in 3d it
+ * equals n_raw_quads().
+ *
+ * @note This function really
+ * exports internal information
+ * about the triangulation. It
+ * shouldn't be used in
+ * applications. The function is
+ * only part of the public
+ * interface of this class
+ * because it is used in some of
+ * the other classes that build
+ * very closely on it (in
+ * particular, the DoFHandler
+ * class).
+ */
+ unsigned int n_raw_faces () const;
+
+ /*@}*/
+
/**
* Determine an estimate for the
* memory consumption (in bytes)
@@ -3537,7 +3124,8 @@ class Triangulation : public Subscriptor
* general documentation of this class.
*/
template
- void save (Archive & ar, const unsigned int version) const;
+ void save (Archive & ar,
+ const unsigned int version) const;
/**
* Read the data of this object from a
@@ -3564,7 +3152,8 @@ class Triangulation : public Subscriptor
* documentation of this class.
*/
template
- void load (Archive & ar, const unsigned int version);
+ void load (Archive & ar,
+ const unsigned int version);
BOOST_SERIALIZATION_SPLIT_MEMBER()
@@ -3668,6 +3257,173 @@ class Triangulation : public Subscriptor
std::istream &in);
private:
+ /**
+ * @name Cell iterator functions for internal use
+ */
+ /*@{*/
+ /**
+ * Declare a number of iterator types for
+ * raw iterators, i.e., iterators that also
+ * iterate over holes in the list of cells
+ * left by cells that have been coarsened
+ * away in previous mesh refinement cycles.
+ *
+ * Since users should never have
+ * to access these internal
+ * properties of how we store
+ * data, these iterator types are
+ * made private.
+ */
+ typedef TriaRawIterator > raw_cell_iterator;
+ typedef TriaRawIterator > raw_face_iterator;
+ typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
+ typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
+ typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
+
+ /**
+ * Iterator to the first cell, used
+ * or not, on level @p level. If a level
+ * has no cells, a past-the-end iterator
+ * is returned.
+ */
+ raw_cell_iterator begin_raw (const unsigned int level = 0) const;
+
+ /**
+ * Return a raw iterator which is the first
+ * iterator not on level. If @p level is
+ * the last level, then this returns
+ * end().
+ */
+ raw_cell_iterator end_raw (const unsigned int level) const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Line iterator functions for internal use
+ */
+ /*@{*/
+
+ /**
+ * Iterator to the first line, used or
+ * not, on level @p level. If a level
+ * has no lines, a past-the-end iterator
+ * is returned.
+ * If lines are no cells, i.e. for @p dim>1
+ * no @p level argument must be given.
+ * The same applies for all the other functions
+ * above, of course.
+ */
+ raw_line_iterator
+ begin_raw_line (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used line
+ * on level @p level.
+ */
+ line_iterator
+ begin_line (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * line on level @p level.
+ */
+ active_line_iterator
+ begin_active_line(const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ line_iterator end_line () const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Quad iterator functions for internal use
+ */
+ /*@{
+ */
+ /**
+ * Iterator to the first quad, used or
+ * not, on the given level. If a level
+ * has no quads, a past-the-end iterator
+ * is returned. If quads are no cells,
+ * i.e. for $dim>2$ no level argument
+ * must be given.
+
+ */
+ raw_quad_iterator
+ begin_raw_quad (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used quad
+ * on level @p level.
+ */
+ quad_iterator
+ begin_quad (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * quad on level @p level.
+ */
+ active_quad_iterator
+ begin_active_quad (const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ quad_iterator
+ end_quad () const;
+ /*@}*/
+
+ /*---------------------------------------*/
+
+ /**
+ * @name Hex iterator functions for internal use
+ */
+ /*@{
+ */
+ /**
+ * Iterator to the first hex, used
+ * or not, on level @p level. If a level
+ * has no hexs, a past-the-end iterator
+ * is returned.
+ */
+ raw_hex_iterator
+ begin_raw_hex (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first used hex
+ * on level @p level.
+ */
+ hex_iterator
+ begin_hex (const unsigned int level = 0) const;
+
+ /**
+ * Iterator to the first active
+ * hex on level @p level.
+ */
+ active_hex_iterator
+ begin_active_hex (const unsigned int level = 0) const;
+
+ /**
+ * Iterator past the end; this
+ * iterator serves for comparisons of
+ * iterators with past-the-end or
+ * before-the-beginning states.
+ */
+ hex_iterator
+ end_hex () const;
+ /*@}*/
+
+
/**
* The (public) function clear() will
* only work when the triangulation is
@@ -3856,6 +3612,9 @@ class Triangulation : public Subscriptor
friend class hp::DoFHandler;
friend struct dealii::internal::Triangulation::Implementation;
+
+ template
+ friend class dealii::internal::Triangulation::TriaObjects;
};
diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h
index ecec9505a4..f69db086b0 100644
--- a/deal.II/include/deal.II/hp/dof_handler.h
+++ b/deal.II/include/deal.II/hp/dof_handler.h
@@ -80,23 +80,18 @@ namespace hp
typedef typename IteratorSelector::CellAccessor cell_accessor;
typedef typename IteratorSelector::FaceAccessor face_accessor;
- typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
typedef typename IteratorSelector::line_iterator line_iterator;
typedef typename IteratorSelector::active_line_iterator active_line_iterator;
- typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
typedef typename IteratorSelector::quad_iterator quad_iterator;
typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
- typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
typedef typename IteratorSelector::hex_iterator hex_iterator;
typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
- typedef typename IteratorSelector::raw_cell_iterator raw_cell_iterator;
typedef typename IteratorSelector::cell_iterator cell_iterator;
typedef typename IteratorSelector::active_cell_iterator active_cell_iterator;
- typedef typename IteratorSelector::raw_face_iterator raw_face_iterator;
typedef typename IteratorSelector::face_iterator face_iterator;
typedef typename IteratorSelector::active_face_iterator active_face_iterator;
@@ -289,512 +284,50 @@ namespace hp
*/
unsigned int max_couplings_between_boundary_dofs () const;
- /**
- * @name Cell iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first cell, used
- * or not, on level @p level. If a level
- * has no cells, a past-the-end iterator
- * is returned.
- *
- * This function calls @p begin_raw_line
- * in 1D and @p begin_raw_quad in 2D.
- */
- raw_cell_iterator begin_raw (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used cell
- * on level @p level.
- *
- * This function calls @p begin_line
- * in 1D and @p begin_quad in 2D.
- */
+ /**
+ * @name Cell iterator functions
+ */
+ /*@{*/
+ /**
+ * Iterator to the first used
+ * cell on level @p level.
+ */
cell_iterator begin (const unsigned int level = 0) const;
- /**
- * Iterator to the first active
- * cell on level @p level.
- *
- * This function calls @p begin_active_line
- * in 1D and @p begin_active_quad in 2D.
- */
+ /**
+ * Iterator to the first active
+ * cell on level @p level.
+ */
active_cell_iterator begin_active(const unsigned int level = 0) const;
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- *
- * This function calls @p end_line
- * in 1D and @p end_quad in 2D.
- */
- raw_cell_iterator end () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
+ /**
+ * Iterator past the end; this
+ * iterator serves for
+ * comparisons of iterators with
+ * past-the-end or
+ * before-the-beginning states.
+ */
+ cell_iterator end () const;
+
+ /**
+ * Return an iterator which is
+ * the first iterator not on
+ * level. If @p level is the
+ * last level, then this returns
+ * end().
+ */
cell_iterator end (const unsigned int level) const;
- /**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_cell_iterator end_raw (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
+ /**
+ * Return an active iterator
+ * which is the first iterator
+ * not on level. If @p level is
+ * the last level, then this
+ * returns end().
+ */
active_cell_iterator end_active (const unsigned int level) const;
- /**
- * Return an iterator pointing to the
- * last cell, used or not.
- *
- * This function calls @p last_raw_line
- * in 1D and @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw () const;
-
- /**
- * Return an iterator pointing to the last
- * cell of the level @p level, used or not.
- *
- * This function calls @p last_raw_line
- * in 1D and @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used cell.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
- */
- cell_iterator last () const;
-
- /**
- * Return an iterator pointing to the last
- * used cell on level @p level.
- *
- * This function calls @p last_line
- * in 1D and @p last_quad in 2D.
- */
- cell_iterator last (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active cell.
- *
- * This function calls @p last_active_line
- * in 1D and @p last_active_quad in 2D.
- */
- active_cell_iterator last_active () const;
-
- /**
- * Return an iterator pointing to the last
- * active cell on level @p level.
- *
- * This function calls @p last_active_line
- * in 1D and @p last_active_quad in 2D.
- */
- active_cell_iterator last_active (const unsigned int level) const;
- //@}
-
- /*---------------------------------------*/
-
- /**
- * @name Face iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first face, used
- * or not.
- *
- * This function calls @p begin_raw_line
- * in 2D and @p begin_raw_quad in 3D.
- */
- raw_face_iterator begin_raw_face () const;
-
- /**
- * Iterator to the first used face.
- *
- * This function calls @p begin_line
- * in 2D and @p begin_quad in 3D.
- */
- face_iterator begin_face () const;
-
- /**
- * Iterator to the first active face.
- *
- * This function calls @p begin_active_line
- * in 2D and @p begin_active_quad in 3D.
- */
- active_face_iterator begin_active_face() const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- *
- * This function calls @p end_line
- * in 2D and @p end_quad in 3D.
- */
- raw_face_iterator end_face () const;
-
- /**
- * Return a raw iterator past-the-end.
- * This is the same as end_face().
- */
- raw_face_iterator end_raw_face () const;
-
- /**
- * Return an active iterator past-the-end.
- * This is the same as end_face().
- */
- active_face_iterator end_active_face () const;
-
- /**
- * Return an iterator pointing to the
- * last face, used or not.
- *
- * This function calls @p last_raw_line
- * in 2D and @p last_raw_quad in 3D.
- */
- raw_face_iterator last_raw_face () const;
-
- /**
- * Return an iterator pointing to the last
- * used face.
- *
- * This function calls @p last_line
- * in 2D and @p last_quad in 3D.
- */
- face_iterator last_face () const;
-
- /**
- * Return an iterator pointing to the last
- * active face.
- *
- * This function calls @p last_active_line
- * in 2D and @p last_active_quad in 3D.
- */
- active_face_iterator last_active_face () const;
-
- //@}
-
-
- /*---------------------------------------*/
-
- /**
- * @name Line iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first line, used
- * or not, on level @p level. If a level
- * has no lines, a past-the-end iterator
- * is returned.
- */
- raw_line_iterator begin_raw_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used line
- * on level @p level.
- */
- line_iterator begin_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * line on level @p level.
- */
- active_line_iterator begin_active_line(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_line_iterator end_line () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- line_iterator end_line (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_line_iterator end_raw_line (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_line_iterator end_active_line (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to the
- * last line, used or not.
- */
- raw_line_iterator last_raw_line () const;
-
- /**
- * Return an iterator pointing to the last
- * line of the level @p level, used or not.
-
- */
- raw_line_iterator last_raw_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used line.
- */
- line_iterator last_line () const;
-
- /**
- * Return an iterator pointing to the last
- * used line on level @p level.
- */
- line_iterator last_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active line.
- */
- active_line_iterator last_active_line () const;
-
- /**
- * Return an iterator pointing to the last
- * active line on level @p level.
- */
- active_line_iterator last_active_line (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Quad iterator functions*/
- /*@{
- */
- /**
- * Iterator to the first quad, used
- * or not, on level @p level. If a level
- * has no quads, a past-the-end iterator
- * is returned.
- */
- raw_quad_iterator begin_raw_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used quad
- * on level @p level.
- */
- quad_iterator begin_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * quad on level @p level.
- */
- active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_quad_iterator end_quad () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- quad_iterator end_quad (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_quad_iterator end_raw_quad (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_quad_iterator end_active_quad (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to the
- * last quad, used or not.
- */
- raw_quad_iterator last_raw_quad () const;
-
- /**
- * Return an iterator pointing to the last
- * quad of the level @p level, used or not.
-
- */
- raw_quad_iterator last_raw_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used quad.
- */
- quad_iterator last_quad () const;
-
- /**
- * Return an iterator pointing to the last
- * used quad on level @p level.
- */
- quad_iterator last_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active quad.
- */
- active_quad_iterator last_active_quad () const;
-
- /**
- * Return an iterator pointing to the last
- * active quad on level @p level.
- */
- active_quad_iterator last_active_quad (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Hex iterator functions*/
- /*@{
- */
- /**
- * Iterator to the first hex, used
- * or not, on level @p level. If a level
- * has no hexs, a past-the-end iterator
- * is returned.
- */
- raw_hex_iterator
- begin_raw_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used hex
- * on level @p level.
- */
- hex_iterator
- begin_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * hex on level @p level.
- */
- active_hex_iterator
- begin_active_hex(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for comparisons of
- * iterators with past-the-end or
- * before-the-beginning states.
- */
- raw_hex_iterator
- end_hex () const;
-
- /**
- * Return an iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- hex_iterator end_hex (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is the first
- * iterator not on level. If @p level is
- * the last level, then this returns
- * end().
- */
- raw_hex_iterator end_raw_hex (const unsigned int level) const;
-
- /**
- * Return an active iterator which is the
- * first iterator not on level. If @p level
- * is the last level, then this returns
- * end().
- */
- active_hex_iterator end_active_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the
- * last hex, used or not.
- */
- raw_hex_iterator
- last_raw_hex () const;
-
- /**
- * Return an iterator pointing to the last
- * hex of the level @p level, used or not.
-
- */
- raw_hex_iterator
- last_raw_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * used hex.
- */
- hex_iterator
- last_hex () const;
-
- /**
- * Return an iterator pointing to the last
- * used hex on level @p level.
- */
- hex_iterator
- last_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to the last
- * active hex.
- */
- active_hex_iterator
- last_active_hex () const;
-
- /**
- * Return an iterator pointing to the last
- * active hex on level @p level.
- */
- active_hex_iterator
- last_active_hex (const unsigned int level) const;
- /*@}*/
+ //@}
/*---------------------------------------*/
diff --git a/deal.II/include/deal.II/multigrid/mg_dof_handler.h b/deal.II/include/deal.II/multigrid/mg_dof_handler.h
index 3eab55be99..a224216370 100644
--- a/deal.II/include/deal.II/multigrid/mg_dof_handler.h
+++ b/deal.II/include/deal.II/multigrid/mg_dof_handler.h
@@ -59,23 +59,18 @@ class MGDoFHandler : public DoFHandler
typedef typename IteratorSelector::CellAccessor cell_accessor;
typedef typename IteratorSelector::FaceAccessor face_accessor;
- typedef typename IteratorSelector::raw_line_iterator raw_line_iterator;
typedef typename IteratorSelector::line_iterator line_iterator;
typedef typename IteratorSelector::active_line_iterator active_line_iterator;
- typedef typename IteratorSelector::raw_quad_iterator raw_quad_iterator;
typedef typename IteratorSelector::quad_iterator quad_iterator;
typedef typename IteratorSelector::active_quad_iterator active_quad_iterator;
- typedef typename IteratorSelector::raw_hex_iterator raw_hex_iterator;
typedef typename IteratorSelector::hex_iterator hex_iterator;
typedef typename IteratorSelector::active_hex_iterator active_hex_iterator;
- typedef typename IteratorSelector::raw_cell_iterator raw_cell_iterator;
typedef typename IteratorSelector::cell_iterator cell_iterator;
typedef typename IteratorSelector::active_cell_iterator active_cell_iterator;
- typedef typename IteratorSelector::raw_face_iterator raw_face_iterator;
typedef typename IteratorSelector::face_iterator face_iterator;
typedef typename IteratorSelector::active_face_iterator active_face_iterator;
@@ -159,37 +154,15 @@ class MGDoFHandler : public DoFHandler
* @name Cell iterator functions
*/
/*@{*/
- /**
- * Iterator to the first cell,
- * used or not, on level
- * @p level. If a level has no
- * cells, a past-the-end iterator
- * is returned.
- *
- * This function calls
- * @p begin_raw_line in 1D and
- * @p begin_raw_quad in 2D.
- */
- raw_cell_iterator begin_raw (const unsigned int level = 0) const;
-
/**
* Iterator to the first used
* cell on level @p level.
- *
- * This function calls
- * @p begin_line in 1D and
- * @p begin_quad in 2D.
*/
cell_iterator begin (const unsigned int level = 0) const;
/**
* Iterator to the first active
* cell on level @p level.
- *
- * This function calls
- * @p begin_active_line in 1D
- * and @p begin_active_quad in
- * 2D.
*/
active_cell_iterator begin_active(const unsigned int level = 0) const;
@@ -199,12 +172,8 @@ class MGDoFHandler : public DoFHandler
* comparisons of iterators with
* past-the-end or
* before-the-beginning states.
- *
- * This function calls
- * @p end_line in 1D and
- * @p end_quad in 2D.
*/
- raw_cell_iterator end () const;
+ cell_iterator end () const;
/**
* Return an iterator which is
@@ -215,15 +184,6 @@ class MGDoFHandler : public DoFHandler
*/
cell_iterator end (const unsigned int level) const;
- /**
- * Return a raw iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- raw_cell_iterator end_raw (const unsigned int level) const;
-
/**
* Return an active iterator
* which is the first iterator
@@ -233,490 +193,9 @@ class MGDoFHandler : public DoFHandler
*/
active_cell_iterator end_active (const unsigned int level) const;
- /**
- * Return an iterator pointing to
- * the last cell, used or not.
- *
- * This function calls
- * @p last_raw_line in 1D and
- * @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw () const;
-
- /**
- * Return an iterator pointing to
- * the last cell of the level
- * @p level, used or not.
- *
- * This function calls
- * @p last_raw_line in 1D and
- * @p last_raw_quad in 2D.
- */
- raw_cell_iterator last_raw (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last used cell.
- *
- * This function calls
- * @p last_line in 1D and
- * @p last_quad in 2D.
- */
- cell_iterator last () const;
-
- /**
- * Return an iterator pointing to
- * the last used cell on level
- * @p level.
- *
- * This function calls
- * @p last_line in 1D and
- * @p last_quad in 2D.
- */
- cell_iterator last (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last active cell.
- *
- * This function calls
- * @p last_active_line in 1D and
- * @p last_active_quad in 2D.
- */
- active_cell_iterator last_active () const;
-
- /**
- * Return an iterator pointing to
- * the last active cell on level
- * @p level.
- *
- * This function calls
- * @p last_active_line in 1D and
- * @p last_active_quad in 2D.
- */
- active_cell_iterator last_active (const unsigned int level) const;
- //@}
-
- /*---------------------------------------*/
-
- /**
- * @name Face iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first face,
- * used or not.
- *
- * This function calls
- * @p begin_raw_line in 2D and
- * @p begin_raw_quad in 3D.
- */
- raw_face_iterator begin_raw_face () const;
-
- /**
- * Iterator to the first used
- * face.
- *
- * This function calls
- * @p begin_line in 2D and
- * @p begin_quad in 3D.
- */
- face_iterator begin_face () const;
-
- /**
- * Iterator to the first active
- * face.
- *
- * This function calls
- * @p begin_active_line in 2D
- * and @p begin_active_quad in
- * 3D.
- */
- active_face_iterator begin_active_face() const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- *
- * This function calls
- * @p end_line in 2D and
- * @p end_quad in 3D.
- */
- raw_face_iterator end_face () const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- *
- * This is the same as
- * end_face().
- */
- raw_face_iterator end_raw_face () const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- *
- * This is the same as
- * end_face().
- */
- active_face_iterator end_active_face () const;
-
- /**
- * Return an iterator pointing to
- * the last face, used or not.
- *
- * This function calls
- * @p last_raw_line in 2D and
- * @p last_raw_quad in 3D.
- */
- raw_face_iterator last_raw_face () const;
-
- /**
- * Return an iterator pointing to
- * the last used face.
- *
- * This function calls
- * @p last_line in 2D and
- * @p last_quad in 3D.
- */
- face_iterator last_face () const;
-
- /**
- * Return an iterator pointing to
- * the last active face.
- *
- * This function calls
- * @p last_active_line in 2D and
- * @p last_active_quad in 3D.
- */
- active_face_iterator last_active_face () const;
//@}
- /*---------------------------------------*/
-
- /**
- * @name Line iterator functions
- */
- /*@{*/
- /**
- * Iterator to the first line,
- * used or not, on level
- * @p level. If a level has no
- * lines, a past-the-end iterator
- * is returned.
- */
- raw_line_iterator begin_raw_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used
- * line on level @p level.
- */
- line_iterator begin_line (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * line on level @p level.
- */
- active_line_iterator begin_active_line(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- */
- raw_line_iterator end_line () const;
-
- /**
- * Return an iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- line_iterator end_line (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- raw_line_iterator end_raw_line (const unsigned int level) const;
-
- /**
- * Return an active iterator
- * which is the first iterator
- * not on level. If @p level is
- * the last level, then this
- * returns end().
- */
- active_line_iterator end_active_line (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to
- * the last line, used or not.
- */
- raw_line_iterator last_raw_line () const;
-
- /**
- * Return an iterator pointing to
- * the last line of the level
- * @p level, used or not.
- */
- raw_line_iterator last_raw_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last used line.
- */
- line_iterator last_line () const;
-
- /**
- * Return an iterator pointing to
- * the last used line on level
- * @p level.
- */
- line_iterator last_line (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last active line.
- */
- active_line_iterator last_active_line () const;
-
- /**
- * Return an iterator pointing to
- * the last active line on level
- * @p level.
- */
- active_line_iterator last_active_line (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Quad iterator functions*/
- /*@{
- */
- /**
- * Iterator to the first quad,
- * used or not, on level
- * @p level. If a level has no
- * quads, a past-the-end iterator
- * is returned.
- */
- raw_quad_iterator begin_raw_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used
- * quad on level @p level.
- */
- quad_iterator begin_quad (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * quad on level @p level.
- */
- active_quad_iterator begin_active_quad(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- */
- raw_quad_iterator end_quad () const;
-
- /**
- * Return an iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- quad_iterator end_quad (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- raw_quad_iterator end_raw_quad (const unsigned int level) const;
-
- /**
- * Return an active iterator
- * which is the first iterator
- * not on level. If @p level is
- * the last level, then this
- * returns end().
- */
- active_quad_iterator end_active_quad (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to
- * the last quad, used or not.
- */
- raw_quad_iterator last_raw_quad () const;
-
- /**
- * Return an iterator pointing to
- * the last quad of the level
- * @p level, used or not.
- */
- raw_quad_iterator last_raw_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last used quad.
- */
- quad_iterator last_quad () const;
-
- /**
- * Return an iterator pointing to
- * the last used quad on level
- * @p level.
- */
- quad_iterator last_quad (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last active quad.
- */
- active_quad_iterator last_active_quad () const;
-
- /**
- * Return an iterator pointing to
- * the last active quad on level
- * @p level.
- */
- active_quad_iterator last_active_quad (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
- /**
- * @name Hex iterator functions*/
- /*@{
- */
- /**
- * Iterator to the first hex,
- * used or not, on level
- * @p level. If a level has no
- * hexs, a past-the-end iterator
- * is returned.
- */
- raw_hex_iterator begin_raw_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first used hex
- * on level @p level.
- */
- hex_iterator begin_hex (const unsigned int level = 0) const;
-
- /**
- * Iterator to the first active
- * hex on level @p level.
- */
- active_hex_iterator begin_active_hex(const unsigned int level = 0) const;
-
- /**
- * Iterator past the end; this
- * iterator serves for
- * comparisons of iterators with
- * past-the-end or
- * before-the-beginning states.
- */
- raw_hex_iterator end_hex () const;
-
- /**
- * Return an iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- hex_iterator end_hex (const unsigned int level) const;
-
- /**
- * Return a raw iterator which is
- * the first iterator not on
- * level. If @p level is the
- * last level, then this returns
- * end().
- */
- raw_hex_iterator end_raw_hex (const unsigned int level) const;
-
- /**
- * Return an active iterator
- * which is the first iterator
- * not on level. If @p level is
- * the last level, then this
- * returns end().
- */
- active_hex_iterator end_active_hex (const unsigned int level) const;
-
-
- /**
- * Return an iterator pointing to
- * the last hex, used or not.
- */
- raw_hex_iterator last_raw_hex () const;
-
- /**
- * Return an iterator pointing to
- * the last hex of the level
- * @p level, used or not.
- */
- raw_hex_iterator last_raw_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last used hex.
- */
- hex_iterator last_hex () const;
-
- /**
- * Return an iterator pointing to
- * the last used hex on level
- * @p level.
- */
- hex_iterator last_hex (const unsigned int level) const;
-
- /**
- * Return an iterator pointing to
- * the last active hex.
- */
- active_hex_iterator last_active_hex () const;
-
- /**
- * Return an iterator pointing to
- * the last active hex on level
- * @p level.
- */
- active_hex_iterator last_active_hex (const unsigned int level) const;
- /*@}*/
-
- /*---------------------------------------*/
-
/**
* Return the number of degrees
diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h
index aa7adf8d71..d9472ef8f9 100644
--- a/deal.II/include/deal.II/numerics/vector_tools.templates.h
+++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h
@@ -402,23 +402,24 @@ namespace VectorTools
// that is actually wholly on
// the boundary, not only by
// one line or one vertex
- typename dealii::DoFHandler::active_face_iterator
- face = dof_handler.begin_active_face(),
- endf = dof_handler.end_face();
+ typename dealii::DoFHandler::active_cell_iterator
+ cell = dof_handler.begin_active(),
+ endc = dof_handler.end();
std::vector face_dof_indices (fe.dofs_per_face);
- for (; face!=endf; ++face)
- if (face->at_boundary())
- {
- face->get_dof_indices (face_dof_indices);
- for (unsigned int i=0; i::faces_per_cell; ++f)
+ if (cell->at_boundary(f))
+ {
+ cell->face(f)->get_dof_indices (face_dof_indices);
+ for (unsigned int i=0; i);
dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_lines(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_line,
DoFHandler<1,spacedim>::invalid_dof_index);
dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_lines(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_cell,
DoFHandler<1,spacedim>::invalid_dof_index);
}
@@ -298,12 +298,12 @@ namespace internal
dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<2>);
dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_quads(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_quad,
DoFHandler<2,spacedim>::invalid_dof_index);
dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_quads(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_cell,
DoFHandler<2,spacedim>::invalid_dof_index);
}
@@ -330,12 +330,12 @@ namespace internal
dof_handler.levels.push_back (new internal::DoFHandler::DoFLevel<3>);
dof_handler.levels.back()->dof_object.dofs
- .resize (dof_handler.tria->n_raw_hexs(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_hex,
DoFHandler<3,spacedim>::invalid_dof_index);
dof_handler.levels.back()->cell_dof_indices_cache
- .resize (dof_handler.tria->n_raw_hexs(i) *
+ .resize (dof_handler.tria->n_raw_cells(i) *
dof_handler.selected_fe->dofs_per_cell,
DoFHandler<3,spacedim>::invalid_dof_index);
}
@@ -418,24 +418,12 @@ DoFHandler::initialize(
/*------------------------ Cell iterator functions ------------------------*/
-
-template
-typename DoFHandler::raw_cell_iterator
-DoFHandler::begin_raw (const unsigned int level) const
-{
- typename Triangulation::raw_cell_iterator ti = tria->begin_raw(level);
- typename DoFHandler::raw_cell_iterator ri(*ti, this);
- return ri;
-}
-
-
template
typename DoFHandler::cell_iterator
DoFHandler::begin (const unsigned int level) const
{
- typename Triangulation::cell_iterator ti = tria->begin(level);
- typename DoFHandler::cell_iterator ri(*ti, this);
- return ri;
+ return cell_iterator (*this->get_tria().begin(level),
+ this);
}
@@ -444,107 +432,36 @@ template
typename DoFHandler::active_cell_iterator
DoFHandler::begin_active (const unsigned int level) const
{
- typename Triangulation::active_cell_iterator ti = tria->begin_active(level);
- typename DoFHandler::active_cell_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_cell_iterator
-DoFHandler::last_raw () const
-{
- typename Triangulation::raw_cell_iterator ti = tria->last_raw();
- typename DoFHandler::raw_cell_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_cell_iterator
-DoFHandler::last_raw (const unsigned int level) const
-{
- typename Triangulation::raw_cell_iterator ti = tria->last_raw(level);
- typename DoFHandler::raw_cell_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::cell_iterator
-DoFHandler::last () const
-{
- typename Triangulation::cell_iterator ti = tria->last();
- typename DoFHandler::cell_iterator ri(*ti, this);
- return ri;
+ // level is checked in begin
+ cell_iterator i = begin (level);
+ if (i.state() != IteratorState::valid)
+ return i;
+ while (i->has_children())
+ if ((++i).state() != IteratorState::valid)
+ return i;
+ return i;
}
template
typename DoFHandler::cell_iterator
-DoFHandler::last (const unsigned int level) const
-{
- typename Triangulation::cell_iterator ti = tria->last(level);
- typename DoFHandler::cell_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_cell_iterator
-DoFHandler::last_active () const
-{
- typename Triangulation::active_cell_iterator ti = tria->last_active();
- typename DoFHandler::active_cell_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_cell_iterator
-DoFHandler::last_active (const unsigned int level) const
-{
- typename Triangulation::active_cell_iterator ti = tria->last_active(level);
- typename DoFHandler::active_cell_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-//TODO: Check if return type should really be raw
-
-template
-typename DoFHandler::raw_cell_iterator
DoFHandler::end () const
{
- typename Triangulation::raw_cell_iterator ti = tria->end();
- typename DoFHandler::raw_cell_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_cell_iterator
-DoFHandler::end_raw (const unsigned int level) const
-{
- typename Triangulation::raw_cell_iterator ti = tria->end_raw(level);
- typename DoFHandler::raw_cell_iterator ri(ti.access_any(), this);
- return ri;
+ return cell_iterator (&this->get_tria(),
+ -1,
+ -1,
+ this);
}
template
-typename DoFHandler::cell_iterator
-DoFHandler::end (const unsigned int level) const
+typename DoFHandler::cell_iterator
+DoFHandler::end (const unsigned int level) const
{
- typename Triangulation::cell_iterator ti = tria->end(level);
- typename DoFHandler::cell_iterator ri(ti.access_any(), this);
- return ri;
+ return (level == this->get_tria().n_levels()-1 ?
+ end() :
+ begin (level+1));
}
@@ -552,608 +469,13 @@ template
typename DoFHandler::active_cell_iterator
DoFHandler::end_active (const unsigned int level) const
{
- typename Triangulation::active_cell_iterator ti = tria->end_active(level);
- typename DoFHandler::active_cell_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-/*------------------------ Face iterator functions ------------------------*/
-
-
-template
-typename DoFHandler::raw_face_iterator
-DoFHandler::begin_raw_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return begin_raw_line ();
- case 3:
- return begin_raw_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return raw_face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::face_iterator
-DoFHandler::begin_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return begin_line ();
- case 3:
- return begin_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::active_face_iterator
-DoFHandler::begin_active_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return begin_active_line ();
- case 3:
- return begin_active_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return active_face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::raw_face_iterator
-DoFHandler::end_raw_face () const
-{
- return end_face();
-}
-
-
-
-template
-typename DoFHandler::raw_face_iterator
-DoFHandler::end_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return end_line ();
- case 3:
- return end_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return raw_face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::active_face_iterator
-DoFHandler::end_active_face () const
-{
- return active_face_iterator(end_face());
-}
-
-
-
-
-
-template
-typename DoFHandler::raw_face_iterator
-DoFHandler::last_raw_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return last_raw_line ();
- case 3:
- return last_raw_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return raw_face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::face_iterator
-DoFHandler::last_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return last_line ();
- case 3:
- return last_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return raw_face_iterator ();
- }
-}
-
-
-
-template
-typename DoFHandler::active_face_iterator
-DoFHandler::last_active_face () const
-{
- switch (dim)
- {
- case 1:
- Assert (false, ExcImpossibleInDim(1));
- return raw_face_iterator();
- case 2:
- return last_active_line ();
- case 3:
- return last_active_quad ();
- default:
- Assert (false, ExcNotImplemented());
- return face_iterator ();
- }
-}
-
-
-/*------------------------ Line iterator functions ------------------------*/
-
-template
-typename DoFHandler::raw_line_iterator
-DoFHandler::begin_raw_line (const unsigned int level) const
-{
- typename Triangulation::raw_line_iterator ti = tria->begin_raw_line(level);
- typename DoFHandler::raw_line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::line_iterator
-DoFHandler::begin_line (const unsigned int level) const
-{
- typename Triangulation::line_iterator ti = tria->begin_line(level);
- typename DoFHandler::line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_line_iterator
-DoFHandler::begin_active_line (const unsigned int level) const
-{
- typename Triangulation::active_line_iterator ti = tria->begin_active_line(level);
- typename DoFHandler::active_line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_line_iterator
-DoFHandler::end_raw_line (const unsigned int level) const
-{
- typename Triangulation::raw_line_iterator ti = tria->end_raw_line(level);
- typename DoFHandler::raw_line_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-template
-typename DoFHandler::line_iterator
-DoFHandler::end_line (const unsigned int level) const
-{
- typename Triangulation::line_iterator ti = tria->end_line(level);
- typename DoFHandler::line_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-template
-typename DoFHandler::active_line_iterator
-DoFHandler::end_active_line (const unsigned int level) const
-{
- typename Triangulation::active_line_iterator ti = tria->end_active_line(level);
- typename DoFHandler::active_line_iterator ri(ti.access_any(), this);
- return ri;
+ return (level == this->get_tria().n_levels()-1 ?
+ active_cell_iterator(end()) :
+ begin_active (level+1));
}
-template
-typename DoFHandler::raw_line_iterator
-DoFHandler::end_line () const
-{
- typename Triangulation::raw_line_iterator ti = tria->end_line();
- typename DoFHandler::raw_line_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_line_iterator
-DoFHandler::last_raw_line (const unsigned int level) const
-{
- typename Triangulation::raw_line_iterator ti = tria->last_raw_line(level);
- typename DoFHandler::raw_line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_line_iterator
-DoFHandler::last_raw_line () const
-{
- typename Triangulation::raw_line_iterator ti = tria->last_raw_line();
- typename DoFHandler::raw_line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::line_iterator
-DoFHandler::last_line (const unsigned int level) const
-{
- typename Triangulation::line_iterator ti = tria->last_line(level);
- typename DoFHandler::line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::line_iterator
-DoFHandler::last_line () const
-{
- typename Triangulation::line_iterator ti = tria->last_line();
- typename DoFHandler::line_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_line_iterator
-DoFHandler::last_active_line (const unsigned int level) const
-{
- typename Triangulation::active_line_iterator ti = tria->last_active_line(level);
- typename DoFHandler::active_line_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_line_iterator
-DoFHandler::last_active_line () const
-{
- typename Triangulation::active_line_iterator ti = tria->last_active_line();
- typename DoFHandler::active_line_iterator ri(*ti, this);
- return ri;
-}
-
-/*------------------------ Quad iterator functions ------------------------*/
-
-template
-typename DoFHandler::raw_quad_iterator
-DoFHandler::begin_raw_quad (const unsigned int level) const
-{
- typename Triangulation::raw_quad_iterator ti = tria->begin_raw_quad(level);
- typename DoFHandler::raw_quad_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::quad_iterator
-DoFHandler::begin_quad (const unsigned int level) const
-{
- typename Triangulation::quad_iterator ti = tria->begin_quad(level);
- typename DoFHandler::quad_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::active_quad_iterator
-DoFHandler::begin_active_quad (const unsigned int level) const
-{
- typename Triangulation::active_quad_iterator ti = tria->begin_active_quad(level);
- typename DoFHandler::active_quad_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_quad_iterator
-DoFHandler::end_raw_quad (const unsigned int level) const
-{
- typename Triangulation::raw_quad_iterator ti = tria->end_raw_quad(level);
- typename DoFHandler::raw_quad_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-template
-typename DoFHandler::quad_iterator
-DoFHandler::end_quad (const unsigned int level) const
-{
- typename Triangulation::quad_iterator ti = tria->end_quad(level);
- typename DoFHandler::quad_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-template
-typename DoFHandler::active_quad_iterator
-DoFHandler::end_active_quad (const unsigned int level) const
-{
- typename Triangulation::active_quad_iterator ti = tria->end_active_quad(level);
- typename DoFHandler::active_quad_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_quad_iterator
-DoFHandler::end_quad () const
-{
- typename Triangulation::raw_quad_iterator ti = tria->end_quad();
- typename DoFHandler::raw_quad_iterator ri(ti.access_any(), this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_quad_iterator
-DoFHandler::last_raw_quad (const unsigned int level) const
-{
- typename Triangulation::raw_quad_iterator ti = tria->last_raw_quad(level);
- typename DoFHandler::raw_quad_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template
-typename DoFHandler::raw_quad_iterator
-DoFHandler::last_raw_quad () const
-{
- typename Triangulation::raw_quad_iterator ti = tria->last_raw_quad();
- typename DoFHandler::raw_quad_iterator ri(*ti, this);
- return ri;
-}
-
-
-
-template