From 291f24d16a247b0e21841c8e446f6e61aad00675 Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 4 Oct 2011 00:34:29 +0000 Subject: [PATCH] New class IteratorFilters::LocallyOwnedCell. git-svn-id: https://svn.dealii.org/trunk@24518 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 5 ++- .../include/deal.II/grid/filtered_iterator.h | 39 ++++++++++++++++++- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 71fe365876..281de06e7b 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -327,13 +327,16 @@ and DoF handlers embedded in higher dimensional space have been added.

Specific improvements

    +
  1. New: There is a new predicate IteratorFilters::LocallyOwnedCell +for filtered iterators. +
    +(Wolfgang Bangerth, 2011/10/03)
  2. Improved: The class BlockList used in RelaxationBlock has been replaced by SparsityPattern, since it only reproduced its functionality.
    (Guido Kanschat, 2011/09/26) -
  3. New: SparsityPattern::row_position() finds a column index in a row and returns its "local" index or numbers::invalid_unsigned_int.
    diff --git a/deal.II/include/deal.II/grid/filtered_iterator.h b/deal.II/include/deal.II/grid/filtered_iterator.h index 3f35e196d5..c902cfaed7 100644 --- a/deal.II/include/deal.II/grid/filtered_iterator.h +++ b/deal.II/include/deal.II/grid/filtered_iterator.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2011 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -189,6 +189,31 @@ namespace IteratorFilters */ const types::subdomain_id_t subdomain_id; }; + + + + /** + * Filter for iterators that evaluates to + * true if a cell is owned by the current + * processor, i.e., if it is a + * @ref GlossLocallyOwnedCell "locally owned cell". + * + * This class is used in step-32, in + * connection with the methods of the @ref + * distributed module. + * + * @ingroup Iterators + */ + class LocallyOwnedCell + { + public: + /** + * Evaluation operator. Returns true if + * the cell is locally owned. + */ + template + bool operator () (const Iterator &i) const; + }; } @@ -1113,6 +1138,18 @@ namespace IteratorFilters { return (i->subdomain_id() == subdomain_id); } + + + +// ---------------- IteratorFilters::LocallyOwnedCell --------- + + template + inline + bool + LocallyOwnedCell::operator () (const Iterator &i) const + { + return (i->is_locally_owned()); + } } -- 2.39.5