]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add a new IteratorFilters AtBoundary.
authorBruno Turcksin <bruno.turcksin@gmail.com>
Thu, 18 Feb 2016 17:38:27 +0000 (12:38 -0500)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 4 Mar 2016 14:26:13 +0000 (09:26 -0500)
include/deal.II/grid/filtered_iterator.h

index 0be6f669c528c922c022643a0f9e63c0c61861a8..3ba88db58496a48ca6b114458e7e45dd4483066e 100644 (file)
@@ -299,6 +299,24 @@ namespace IteratorFilters
      */
     const bool only_locally_owned;
   };
+
+  /**
+   * Filter for iterators that evaluates to true if the iterator of the object
+   * pointed to is on the boundary.
+   *
+   * @author Bruno Turcksin, 2016
+   *
+   * @ingroup Iterators
+   */
+  class AtBoundary
+  {
+  public:
+    /**
+     * Evaluate the iterator and return true if the object at the boundary.
+     */
+    template <class Iterator>
+    bool operator () (const Iterator &i) const;
+  };
 }
 
 
@@ -1215,6 +1233,17 @@ namespace IteratorFilters
            active_fe_indices.find(i->active_fe_index()) != active_fe_indices.end();
   }
 
+
+
+// ---------------- IteratorFilters::AtBoundary ---------
+
+  template <class Iterator>
+  inline
+  bool
+  AtBoundary::operator () (const Iterator &i) const
+  {
+    return (i->at_boundary());
+  }
 }
 
 

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.