]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
recursively_{set,clear}_user_pointer
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Apr 2003 21:24:12 +0000 (21:24 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 11 Apr 2003 21:24:12 +0000 (21:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@7392 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/source/grid/tria_accessor.cc
deal.II/doc/news/2002/c-3-4.html

index 7c6dfe6f5051ae2c4de03ed01a5a3bf1b75db08e..ec11df6aa12556dacaaddce2cd5b4b0c49d89398 100644 (file)
@@ -445,7 +445,7 @@ class TriaObjectAccessor :  public TriaAccessor<dim>
                                      * to a @p{NULL} pointer.
                                      */
     void clear_user_pointer () const;
-
+    
                                     /**
                                      * Access the value of the user
                                      * pointer. It is in the
@@ -460,6 +460,45 @@ class TriaObjectAccessor :  public TriaAccessor<dim>
                                      */
     void * user_pointer () const;
 
+                                    /**
+                                     * Set the user pointer of this
+                                     * object and all its children to
+                                     * the given value. This is
+                                     * useful for example if all
+                                     * cells of a certain subdomain,
+                                     * or all faces of a certain part
+                                     * of the boundary should have
+                                     * user pointers pointing to
+                                     * objects describing this part
+                                     * of the domain or boundary.
+                                     *
+                                     * Note that the user pointer is
+                                     * not inherited under mesh
+                                     * refinement, so after mesh
+                                     * refinement there might be
+                                     * cells or faces that don't have
+                                     * user pointers pointing to the
+                                     * describing object. In this
+                                     * case, simply loop over all the
+                                     * elements of the coarsest level
+                                     * that has this information, and
+                                     * use this function to
+                                     * recursively set the user
+                                     * pointer of all finer levels of
+                                     * the triangulation.
+                                     */
+    void recursively_set_user_pointer (void *p) const;
+
+                                    /**
+                                     * Clear the user pointer of this
+                                     * object and all of its
+                                     * descendants. The same holds as
+                                     * said for the
+                                     * @ref{recursively_set_user_pointer}
+                                     * function.
+                                     */
+    void recursively_clear_user_pointer () const;
+
                                     /**
                                      *  Pointer to the @p{i}th
                                      *  child.
@@ -834,6 +873,45 @@ class TriaObjectAccessor<1, dim> :  public TriaAccessor<dim>
                                      */
     void set_user_pointer (void *p) const;
 
+                                    /**
+                                     * Set the user pointer of this
+                                     * object and all its children to
+                                     * the given value. This is
+                                     * useful for example if all
+                                     * cells of a certain subdomain,
+                                     * or all faces of a certain part
+                                     * of the boundary should have
+                                     * user pointers pointing to
+                                     * objects describing this part
+                                     * of the domain or boundary.
+                                     *
+                                     * Note that the user pointer is
+                                     * not inherited under mesh
+                                     * refinement, so after mesh
+                                     * refinement there might be
+                                     * cells or faces that don't have
+                                     * user pointers pointing to the
+                                     * describing object. In this
+                                     * case, simply loop over all the
+                                     * elements of the coarsest level
+                                     * that has this information, and
+                                     * use this function to
+                                     * recursively set the user
+                                     * pointer of all finer levels of
+                                     * the triangulation.
+                                     */
+    void recursively_set_user_pointer (void *p) const;
+
+                                    /**
+                                     * Clear the user pointer of this
+                                     * object and all of its
+                                     * descendants. The same holds as
+                                     * said for the
+                                     * @ref{recursively_set_user_pointer}
+                                     * function.
+                                     */
+    void recursively_clear_user_pointer () const;
+
                                     /**
                                      * Reset the user pointer of this
                                      * line to a @p{NULL} pointer.
@@ -1253,6 +1331,45 @@ class TriaObjectAccessor<2, dim> :  public TriaAccessor<dim>
                                      */
     void * user_pointer () const;
 
+                                    /**
+                                     * Set the user pointer of this
+                                     * object and all its children to
+                                     * the given value. This is
+                                     * useful for example if all
+                                     * cells of a certain subdomain,
+                                     * or all faces of a certain part
+                                     * of the boundary should have
+                                     * user pointers pointing to
+                                     * objects describing this part
+                                     * of the domain or boundary.
+                                     *
+                                     * Note that the user pointer is
+                                     * not inherited under mesh
+                                     * refinement, so after mesh
+                                     * refinement there might be
+                                     * cells or faces that don't have
+                                     * user pointers pointing to the
+                                     * describing object. In this
+                                     * case, simply loop over all the
+                                     * elements of the coarsest level
+                                     * that has this information, and
+                                     * use this function to
+                                     * recursively set the user
+                                     * pointer of all finer levels of
+                                     * the triangulation.
+                                     */
+    void recursively_set_user_pointer (void *p) const;
+
+                                    /**
+                                     * Clear the user pointer of this
+                                     * object and all of its
+                                     * descendants. The same holds as
+                                     * said for the
+                                     * @ref{recursively_set_user_pointer}
+                                     * function.
+                                     */
+    void recursively_clear_user_pointer () const;
+
                                     /**
                                      *  Return a pointer to the @p{i}th
                                      *  child.
@@ -1695,6 +1812,45 @@ class TriaObjectAccessor<3, dim> :  public TriaAccessor<dim>
                                      */
     void * user_pointer () const;
 
+                                    /**
+                                     * Set the user pointer of this
+                                     * object and all its children to
+                                     * the given value. This is
+                                     * useful for example if all
+                                     * cells of a certain subdomain,
+                                     * or all faces of a certain part
+                                     * of the boundary should have
+                                     * user pointers pointing to
+                                     * objects describing this part
+                                     * of the domain or boundary.
+                                     *
+                                     * Note that the user pointer is
+                                     * not inherited under mesh
+                                     * refinement, so after mesh
+                                     * refinement there might be
+                                     * cells or faces that don't have
+                                     * user pointers pointing to the
+                                     * describing object. In this
+                                     * case, simply loop over all the
+                                     * elements of the coarsest level
+                                     * that has this information, and
+                                     * use this function to
+                                     * recursively set the user
+                                     * pointer of all finer levels of
+                                     * the triangulation.
+                                     */
+    void recursively_set_user_pointer (void *p) const;
+
+                                    /**
+                                     * Clear the user pointer of this
+                                     * object and all of its
+                                     * descendants. The same holds as
+                                     * said for the
+                                     * @ref{recursively_set_user_pointer}
+                                     * function.
+                                     */
+    void recursively_clear_user_pointer () const;
+
                                     /**
                                      *  Return a pointer to the
                                      *  @p{i}th child.
index 455ac5b55fe93d45f982d45edb7b504c753bba4f..f96000286855110fdd0c5fa85249f502bd9920db 100644 (file)
@@ -122,6 +122,32 @@ void * TriaObjectAccessor<1, dim>::user_pointer () const
 
 
 
+template <int dim>
+void
+TriaObjectAccessor<1, dim>::recursively_set_user_pointer (void *p) const
+{
+  set_user_pointer (p);
+
+  if (has_children())
+    for (unsigned int c=0; c<2; ++c)
+      child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<1, dim>::recursively_clear_user_pointer () const
+{
+  clear_user_pointer ();
+
+  if (has_children())
+    for (unsigned int c=0; c<2; ++c)
+      child(c)->recursively_clear_user_pointer ();
+}
+
+
+
 template <int dim>
 void TriaObjectAccessor<1, dim>::set_children (const int index) const
 {
@@ -324,6 +350,32 @@ void * TriaObjectAccessor<2, dim>::user_pointer () const
 
 
 
+template <int dim>
+void
+TriaObjectAccessor<2, dim>::recursively_set_user_pointer (void *p) const
+{
+  set_user_pointer (p);
+
+  if (has_children())
+    for (unsigned int c=0; c<4; ++c)
+      child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<2, dim>::recursively_clear_user_pointer () const
+{
+  clear_user_pointer ();
+
+  if (has_children())
+    for (unsigned int c=0; c<4; ++c)
+      child(c)->recursively_clear_user_pointer ();
+}
+
+
+
 template <int dim>
 void TriaObjectAccessor<2, dim>::set_children (const int index) const
 {
@@ -719,6 +771,32 @@ void * TriaObjectAccessor<3, dim>::user_pointer () const
 
 
 
+template <int dim>
+void
+TriaObjectAccessor<3, dim>::recursively_set_user_pointer (void *p) const
+{
+  set_user_pointer (p);
+
+  if (has_children())
+    for (unsigned int c=0; c<8; ++c)
+      child(c)->recursively_set_user_pointer (p);
+}
+
+
+
+template <int dim>
+void
+TriaObjectAccessor<3, dim>::recursively_clear_user_pointer () const
+{
+  clear_user_pointer ();
+
+  if (has_children())
+    for (unsigned int c=0; c<8; ++c)
+      child(c)->recursively_clear_user_pointer ();
+}
+
+
+
 template <int dim>
 void TriaObjectAccessor<3, dim>::set_children (const int index) const
 {
index 3c53bdc8b0d9d85014f6e5cb88e16433d6aba76d..e93362d6c8197635d1805d45a7b58464a6178927 100644 (file)
@@ -747,10 +747,21 @@ contributor's names are abbreviated by WB (Wolfgang Bangerth), GK
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>
+       New: There are now functions <code
+       class="member">recursively_set/clear_user_pointer</code> that
+       do much the same as  <code
+       class="member">recursively_set/clear_user_flag</code> on a
+       line/quad/hex and all of its descendants, but on user pointers
+       rather than flags.
+       <br>
+       (WB 2003/04/11)
+       </p>
+
   <li> <p>
        New: The functions in the <code
        class="class">DerivativeApproximation</code> class can now also
-       work on <code class="class">BlockVector</code>s/
+       work on <code class="class">BlockVector</code>.
        <br>
        (WB 2003/04/11)
        </p>

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.