]> https://gitweb.dealii.org/ - dealii.git/commitdiff
improve documentation on user data
authorGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 2 Jul 2010 20:27:02 +0000 (20:27 +0000)
committerGuido Kanschat <dr.guido.kanschat@gmail.com>
Fri, 2 Jul 2010 20:27:02 +0000 (20:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@21451 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/include/grid/tria_accessor.h

index 339fa9ac81a9d696c6af736b178bff7e73ecae4f..d200bd14a423f8d8bc15817cc4f08f4a11b0b258 100644 (file)
@@ -1012,7 +1012,7 @@ namespace internal
  *
  *   <h3>User flags and data</h3>
  *
- *   A triangulation offers one bit per line, quad, etc for user data.
+ *   A triangulation offers one bit per line, quad, etc for user flags.
  *   This field can be
  *   accessed as all other data using iterators. Normally, this user flag is
  *   used if an algorithm walks over all cells and needs information whether
@@ -1067,6 +1067,11 @@ namespace internal
  *   obviously in place here; responsibility for correctness of types etc
  *   lies entirely with the user of the pointer.
  *
+ *   @note User pointers and user indices are stored in the same
+ *   place. In order to avoid unwanted conversions, Triangulation
+ *   checks which one of them is in use and does not allow access to
+ *   the other one, until clear_user_data() has been called.
+ *
  *   Just like the user flags, this field is not available for vertices,
  *   which does no harm since the vertices have a unique and continuous number
  *   unlike the structured objects lines and quads.
index a1d8d8b8e830275d472af3fd6e514cf64a2fc11f..01e476bae9147a2dfa1c4d18ec5e5826286a8c76 100644 (file)
@@ -1119,6 +1119,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                     /**
                                      * Set the user pointer
                                      * to @p p.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      */
     void set_user_pointer (void *p) const;
 
@@ -1138,6 +1146,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * style cast operator to
                                      * maintain a minimum of
                                      * typesafety, e.g.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      * <tt>A *a=static_cast<A*>(cell->user_pointer());</tt>.
                                      */
     void * user_pointer () const;
@@ -1168,6 +1184,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * recursively set the user
                                      * pointer of all finer levels of
                                      * the triangulation.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      */
     void recursively_set_user_pointer (void *p) const;
 
@@ -1184,6 +1208,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                     /**
                                      * Set the user index
                                      * to @p p.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      */
     void set_user_index (const unsigned int p) const;
 
@@ -1195,6 +1227,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                     /**
                                      * Access the value of the user
                                      * index.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      */
     unsigned int user_index () const;
 
@@ -1215,6 +1255,14 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      * function to recursively set
                                      * the user index of all finer
                                      * levels of the triangulation.
+                                     *
+                                     * @note User pointers and user
+                                     * indices are mutually
+                                     * exclusive. Therefore, you can
+                                     * only use one of them, unless
+                                     * you call
+                                     * Triangulation::clear_user_data()
+                                     * in between.
                                      */
     void recursively_set_user_index (const unsigned int p) const;
 

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.