// $Id$
// Version: $Name$
//
-// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 by the deal.II authors
+// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
*/
namespace DoFRenumbering
{
+ /**
+ * Direction based comparator for
+ * cell iterators: it returns @p
+ * true if the center of the second
+ * cell is downstream of the center
+ * of the first one with respect to
+ * the direction given to the
+ * constructor.
+ */
+ template <class Iterator, int dim>
+ struct CompareDownstream
+ {
+ /**
+ * Constructor.
+ */
+ CompareDownstream (const Point<dim> &dir)
+ :
+ dir(dir)
+ {}
+ /**
+ * Return true if c1 less c2.
+ */
+ bool operator () (const Iterator &c1, const Iterator &c2) const
+ {
+ const Point<dim> diff = c2->center() - c1->center();
+ return (diff*dir > 0);
+ }
+
+ private:
+ /**
+ * Flow direction.
+ */
+ const Point<dim> dir;
+ };
+
/**
* A namespace for the
* implementation of some
T::operator++;
T::operator==;
};
-
-
-
-/**
- * Provide comparator for DoFCellAccessors: it returns @p true if the center
- * of the second cell is downstream of the center of the first one with
- * respect to the direction given to the constructor.
- */
- template <int dim>
- struct CompareDownstream
- {
- /**
- * Constructor.
- */
- CompareDownstream (const Point<dim> &dir)
- :
- dir(dir)
- {}
- /**
- * Return true if c1 < c2.
- */
- template <class DHCellIterator>
- bool operator () (const DHCellIterator &c1,
- const DHCellIterator &c2) const
- {
- const Point<dim> diff = c2->center() - c1->center();
- return (diff*dir > 0);
- }
-
- private:
- /**
- * Flow direction.
- */
- const Point<dim> dir;
- };
}
namespace boost
{
std::vector<typename DH::cell_iterator>
ordered_cells(dof.get_tria().n_active_cells());
- const internal::CompareDownstream<dim> comparator(direction);
+ const CompareDownstream<typename DH::cell_iterator, dim> comparator(direction);
typename DH::active_cell_iterator begin = dof.begin_active();
typename DH::active_cell_iterator end = dof.end();
{
std::vector<typename DH::cell_iterator>
ordered_cells(dof.get_tria().n_active_cells());
- const internal::CompareDownstream<dim> comparator(direction);
+ const CompareDownstream<typename DH::cell_iterator, dim> comparator(direction);
typename DH::active_cell_iterator begin = dof.begin_active();
typename DH::active_cell_iterator end = dof.end();
{
std::vector<typename DH::cell_iterator>
ordered_cells(dof.get_tria().n_active_cells());
- const internal::CompareDownstream<dim> comparator(direction);
+ const CompareDownstream<typename DH::cell_iterator, dim> comparator(direction);
typename DH::active_cell_iterator begin = dof.begin_active();
typename DH::active_cell_iterator end = dof.end();
{
std::vector<typename MGDoFHandler<dim>::cell_iterator>
ordered_cells(dof.get_tria().n_cells(level));
- const internal::CompareDownstream<dim> comparator(direction);
+ const CompareDownstream<typename MGDoFHandler<dim>::cell_iterator, dim> comparator(direction);
typename MGDoFHandler<dim>::cell_iterator begin = dof.begin(level);
typename MGDoFHandler<dim>::cell_iterator end = dof.end(level);
{
std::vector<typename MGDoFHandler<dim>::cell_iterator>
ordered_cells(dof.get_tria().n_cells(level));
- const internal::CompareDownstream<dim> comparator(direction);
+ const CompareDownstream<typename MGDoFHandler<dim>::cell_iterator, dim> comparator(direction);
typename MGDoFHandler<dim>::cell_iterator begin = dof.begin(level);
typename MGDoFHandler<dim>::cell_iterator end = dof.end(level);