]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New class IteratorFilters::LocallyOwnedCell.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Oct 2011 00:34:29 +0000 (00:34 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 4 Oct 2011 00:34:29 +0000 (00:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@24518 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/changes.h
deal.II/include/deal.II/grid/filtered_iterator.h

index 71fe365876d9b81892bdd0c0ac38bf4ded4fac9c..281de06e7b7d51e7c73685937005f70601f3b7a1 100644 (file)
@@ -327,13 +327,16 @@ and DoF handlers embedded in higher dimensional space have been added.
 <h3>Specific improvements</h3>
 
 <ol>
+<li> New: There is a new predicate IteratorFilters::LocallyOwnedCell
+for filtered iterators.
+<br>
+(Wolfgang Bangerth, 2011/10/03)
 
 <li> Improved: The class BlockList used in RelaxationBlock has been replaced
 by SparsityPattern, since it only reproduced its functionality.
 <br>
 (Guido Kanschat, 2011/09/26)
 
-
 <li> New: SparsityPattern::row_position() finds a column index in a row and returns
 its "local" index or numbers::invalid_unsigned_int.
 <br>
index 3f35e196d5d0f2769e835270cc562829d661a85e..c902cfaed72246fab235dd921c666585eb51b937 100644 (file)
@@ -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 <class Iterator>
+      bool operator () (const Iterator &i) const;
+  };
 }
 
 
@@ -1113,6 +1138,18 @@ namespace IteratorFilters
   {
     return (i->subdomain_id() == subdomain_id);
   }
+
+
+
+// ---------------- IteratorFilters::LocallyOwnedCell ---------
+
+  template <class Iterator>
+  inline
+  bool
+  LocallyOwnedCell::operator () (const Iterator &i) const
+  {
+    return (i->is_locally_owned());
+  }
 }
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.