]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add functions to recursively set or clear user flags.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 3 Jan 1999 18:49:54 +0000 (18:49 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 3 Jan 1999 18:49:54 +0000 (18:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@721 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/source/grid/tria_accessor.cc

index a708b8075e028b9cebc3347d3048ccb8e31f8e56..275a1d74b4073d1b2167c7dd7bc2a430fab11ae4 100644 (file)
@@ -341,6 +341,20 @@ class LineAccessor :  public TriaAccessor<dim> {
                                      */
     void clear_user_flag () const;
 
+                                    /**
+                                     *  set the user flag of this object
+                                     *  and of all its children and their
+                                     *  children, etc.
+                                     */
+    void recursively_set_user_flag () const;
+
+                                    /**
+                                     *  Clear the user flag of this object
+                                     *  and of all its children and their
+                                     *  children, etc.
+                                     */
+    void recursively_clear_user_flag () const;
+
                                     /**
                                      * Set the user pointer of this line
                                      * to #p#.
@@ -656,6 +670,20 @@ class QuadAccessor :  public TriaAccessor<dim> {
                                      */
     void clear_user_flag () const;
 
+                                    /**
+                                     *  set the user flag of this object
+                                     *  and of all its children and their
+                                     *  children, etc.
+                                     */
+    void recursively_set_user_flag () const;
+
+                                    /**
+                                     *  Clear the user flag of this object
+                                     *  and of all its children and their
+                                     *  children, etc.
+                                     */
+    void recursively_clear_user_flag () const;
+
                                     /**
                                      * Set the user pointer of this line
                                      * to #p#.
index 3d7585e8bcc2665dfcbd13f4f06ed389cb766508..3cd54727f607889c814da1399ed93d62898c02a9 100644 (file)
@@ -138,6 +138,36 @@ void LineAccessor<dim>::set_user_flag () const {
 
 
 
+template <int dim>
+void LineAccessor<dim>::clear_user_flag () const {
+  Assert (used(), ExcCellNotUsed());
+  tria->levels[present_level]->lines.user_flags[present_index] = false;
+};
+
+
+
+template <int dim>
+void LineAccessor<dim>::recursively_set_user_flag () const {
+  set_user_flag ();
+
+  if (has_children())
+    for (unsigned int c=0; c<2; ++c)
+      child(c)->recursively_set_user_flag ();
+};
+
+
+
+template <int dim>
+void LineAccessor<dim>::recursively_clear_user_flag () const {
+  clear_user_flag ();
+
+  if (has_children())
+    for (unsigned int c=0; c<2; ++c)
+      child(c)->recursively_clear_user_flag ();
+};
+
+
+
 template <int dim>
 void LineAccessor<dim>::set_user_pointer (void *p) const {
   Assert (used(), ExcCellNotUsed());
@@ -163,14 +193,6 @@ void * LineAccessor<dim>::user_pointer () const {
   
 
 
-template <int dim>
-void LineAccessor<dim>::clear_user_flag () const {
-  Assert (used(), ExcCellNotUsed());
-  tria->levels[present_level]->lines.user_flags[present_index] = false;
-};
-
-
-
 template <int dim>
 TriaIterator<dim,LineAccessor<dim> >
 LineAccessor<dim>::child (const unsigned int i) const {
@@ -415,6 +437,28 @@ void QuadAccessor<dim>::clear_user_flag () const {
 
 
 
+template <int dim>
+void QuadAccessor<dim>::recursively_set_user_flag () const {
+  set_user_flag ();
+
+  if (has_children())
+    for (unsigned int c=0; c<4; ++c)
+      child(c)->recursively_set_user_flag ();
+};
+
+
+
+template <int dim>
+void QuadAccessor<dim>::recursively_clear_user_flag () const {
+  clear_user_flag ();
+
+  if (has_children())
+    for (unsigned int c=0; c<4; ++c)
+      child(c)->recursively_clear_user_flag ();
+};
+
+
+
 template <int dim>
 void QuadAccessor<dim>::set_user_pointer (void *p) const {
   Assert (used(), ExcCellNotUsed());

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.